伊莎贝尔的惯用语演算证明

时间:2016-11-02 04:17:46

标签: isabelle

我正在尝试使用一些简单的真实分析问题来学习Isabelle。以下是我的证据尝试。它会检查到最后一次。

theory l2
  imports 
    "~~/src/HOL/Multivariate_Analysis/Multivariate_Analysis"
    "~~/src/HOL/Multivariate_Analysis/Derivative"
    "~~/src/HOL/Multivariate_Analysis/Integration"
    "~~/src/HOL/Complex_Main"
    "~~/src/HOL/Library/Inner_Product"
    "~~/src/HOL/Real_Vector_Spaces"
  begin

  thm linear.scaleR

  lemma line_fundamental_theorem_calculus:
    fixes x y :: "'a :: real_inner"
    and   s :: "real"
    and   f :: "'a ⇒ real"
    assumes "∀v. (f has_derivative (f' v)) (at v) "
    shows "((λt. f(x+t*⇩R(y-x))) has_derivative (λt. t *⇩R ((f'(x + s*⇩R(y-x))) (y-x)))) (at s)"
  proof -
   let ?z = "(λt. x + t*⇩R(y-x)) :: real ⇒ 'a"
   let ?dzdt = " (λt. t*⇩R(y-x))"
   have c1: "f ∘ ?z = (λt. f(x+t*⇩R(y-x)))" by auto
   have c2: "(f'(x + s*⇩R(y-x))) ∘ (λt. t*⇩R(y-x)) = (λt. (f'(x + s*⇩R(y-x))) (t*⇩R(y-x)))" by auto
   have a1: "(f has_derivative (f' (x + s*⇩R(y-x)))) (at (x + s*⇩R(y-x))) " using assms by auto
   have c3: "linear (f'(x + s*⇩R(y-x)))" using assms has_derivative_linear by auto
   have c5: "(f'(x + s*⇩R(y-x))) (t*⇩R(y-x)) = t *⇩R ((f'(x + s*⇩R(y-x))) (y-x))"  using c3 linear.scaleR by blast

   have h1: "(?z has_derivative ?dzdt) (at s)" by (fastforce intro: derivative_eq_intros)
   hence "((f ∘ ?z) has_derivative ((f'(x + s*⇩R(y-x))) ∘ ?dzdt)) (at s) " using assms a1 c1 by (fastforce intro: derivative_eq_intros)
   hence "((f ∘ ?z) has_derivative ((f'(x + s*⇩R(y-x))) ∘ (λt. t*⇩R(y-x)))) (at s) " by auto
   hence "((f ∘ ?z) has_derivative (λt. (f'(x + s*⇩R(y-x))) (t*⇩R(y-x)))) (at s) " by (auto simp: c2)

   hence "((f ∘ ?z) has_derivative (λt. t *⇩R ((f'(x + s*⇩R(y-x))) (y-x)))) (at s) " 
   then show ?thesis 
  qed                                               

  end

我有几个问题:

  1. 我如何完成证明?在我看来,我可以通过应用c5来证明最后一次,但是我尝试过的各种auto,simp等组合似乎并没有这样做。
  2. 这个证明的isabelle-idomatic版本会是什么?我希望使用has_vector_derivative而不是has_derivative会更简单,但我更感兴趣的是保持has_derivative,但重组。 Isabelle文档中给出的示例似乎在这些语句之间做了更大的步骤,有没有办法在这里做到这一点?
  3. 我发现我需要在这里使用derivative_eq_intros。有没有替代fastforce intro:derivative_eq_intros线会更快?目前需要几秒钟。
  4. 一般来说,对于涉及向量和微积分的这种证明,还有其他规则集,例如derivative_eq_intros,我应该知道吗?默认情况下,使用simp的real_inner数量是什么用的?我可以在这里应用代数方法吗?
  5. Sledgehammer在这个证明中毫无用处,我是否需要传递一些参数或一组定理,以便它有机会证明这里的一些步骤?

2 个答案:

答案 0 :(得分:3)

  1. 您仍然需要从派生的线性运算符下拉出t。你可以做linear_cmult[OF c3]。然后用o_def展开函数组合,你就完成了。

  2. 那里有一些不必要的步骤。简化器可以完成您自己完成的大部分推理。此外,您对f衍生物的假设过于强烈; fD点有一个导数(我们称之为x + s(y - x))就足够了。我在答案的最后给出了证据。

  3. 您可以在“简介”中添加感叹号。这告诉fastforce急切地应用规则而不回溯。这应该谨慎使用(特别是对于非等价的介绍规则),因为它很容易导致不终止,但衍生物的规则通常是安全的。这样可以大大加快这个过程。

  4. 限制有tendsto_introstendsto_eq_intros,但它们的衍生工作往往比其等价物的可靠性低很多,因为通常会有几个限制匹配规则。我没有在Isabelle中使用过多的向量空间,所以我不能对此发表评论。至于algebra,我认为与Gröbner一起使用戒指,所以如果它适用于内部产品我会感到惊讶。快速测试似乎表明它确实不是。一些规则在simp集中,因此简化器将自动使用它们。对于其他人,您将不得不使用find_theorems或查看相应的理论来说明已经证明了哪些属性。

  5. 不是真的。你可以用usingfrom链接其他事实,但是大锤通常很擅长找到相关的事实本身。我不太了解它为什么在这里不是很有帮助;根据我的经验,有时候它有效,有时却没有。

  6. 现在这是证据:

    lemma line_fundamental_theorem_calculus:
      assumes "(f has_derivative D) (at (x + s*⇩R(y-x))) "
      shows "((λt. f(x+t*⇩R(y-x))) has_derivative (λt. t *⇩R (D (y-x)))) (at s)"
    proof -
      let ?z = "(λt. x + t*⇩R(y-x))" and ?dzdt = "λt. t *⇩R (y-x)"
      have lin: "linear D" using assms has_derivative_linear by auto
      have "((f ∘ ?z) has_derivative (D ∘ ?dzdt)) (at s) " 
        using assms by (fastforce intro!: derivative_eq_intros)
      thus ?thesis by (simp add: o_def linear_cmul[OF lin])
    qed
    

答案 1 :(得分:1)

只是对您的导入的简短评论:仅导入   " ~~ / SRC / HOL / Multivariate_Analysis" (将只是" ~~ / src / HOL / Analysis")。 当您使用-lHOL-Multivariate_Analysis启动isabelle / jEdit时,您将获得最佳结果。

您的第一个导入行导入其他所有内容,其他行是不必要的。如果他们不小心修改了一些自动化数据库(例如simp规则,intro / dest / elim规则等),它们可能会成为一个问题。