我刚刚遇到Coq induction的问题,在阅读的证明时丢弃了关于构造的术语的信息。
作者们使用了这样的东西:
remember (WHILE b DO c END) as cw eqn:Heqcw.
在实际归纳H之前重写假设induction H。我真的不喜欢引入一个微不足道的等式的想法,因为它看起来像黑魔法。
这里的一些搜索表明,实际上remember技巧是必要的。然而,有一个答案是,它指出新的dependent induction可以用来避免remember的花招。这很好,但是dependent induction本身看起来有点神奇。
我很难理解dependent induction是
我很难让induction n, m为n和m创建归纳假说,但经过一些尝试,情况似乎并非如此。顺便说一句,我假设是forall (n m : nat)。
那么,induction n, m induction n. induction m和induction n; induction m的区别是什么呢?
以下是我目前的理解:
我知道;是一个组合子,所以a; b可以在a生成的每个子目标上回放b,所以induction n; induction m会为induction n的每个子目标生成m的诱导低幂,对吗?
从同样的意义上说,induction n. induction m只会为当前的目标产生感应
我尝试在余数证明中使用从1开始的归纳法。从this question那里我得到了我需要的归纳原理的证明: Section induction_at_1.
Variable P : nat -> Prop.
Hypothesis p1 : P 1.
Hypothesis pS : forall n, P n -> P (S n).
Theorem induction_at_1:
forall n, n > 0 -> P n.
induction n; intro.
- exfalso; omega.
- destruc
我正在研究字符串语法的理论,但我完全被一个特殊的定理所阻碍。我尝试过的每一种归纳法都以毫无意义和无用的归纳法假设而告终,我不确定我错过了什么。 我现在已经多次重读了这一"Varying the Induction Hypothesis"部分,试图理解我做错了什么,但似乎我很好地遵循了他们关于通用性的建议。 简单地说,我很困惑。非常感谢您的提前指导! 下面是我的定义和困难定理的概述。稍后我会给出完整的脚本。 (* I plan to make these definitions more complex in the future *)
Definition TokenDefi
我正在阅读"Programming and Provin in Isabelle/HOL“的介绍,并尝试做练习2.2。 目前我有以下内容: theory Scratch
imports Main
begin
fun add:: "nat ⇒ nat ⇒ nat" where
"add 0 n = n" |
"add (Suc m) n = Suc(add m n)"
lemma add_02 [simp]: "add m 0 = m"
apply(induction m)
apply(auto)
do
由于coq中的证明是简单的高度复杂的函数,可以通过各种方式中的任何一种来构建,因此似乎有必要为每个既不涉及先前证明的定理也不涉及assert语句的定理提供coq证明。
例如,在没有任何引理的情况下,证明自然数加法的交换性是很简单的,即使有引理可以让它变得更简单:
Theorem plus_comm' :
forall n m : nat, n + m = m + n.
Proof.
induction n.
intro m. simpl. induction m.
reflexivity.
simpl. rewrite <- IHm. re
我很难理解为什么下面的每一个例子要么有效,要么不起作用,更抽象地说,归纳是如何与策略与Isar交互作用的。我正在用最新的Isabelle/HOL (2016-1)在Windows 10上编写和证明在Isabelle/HOL (2016年12月)上的4.3个程序。
有8种情况:引理要么是长的(包括显式名称),要么是短的、结构化的(使用assumes和shows)或者是非结构化的(使用箭头),证明要么是结构化的(Isar),要么是非结构化的(战术)。
theory Confusing_Induction
imports Main
begin
(* 4.3 *)
inductive ev ::
我对自然数的平等有这样的定义:
Fixpoint equal_nat (n m : nat) : bool :=
match n, m with
| O, O => true
| O, S _ => false
| S _, O => false
| S n1, S n2 => equal_nat n1 n2
end.
(这几乎是标准定义)
我试图证明以下观点:
Proposition equal_nat_correct :
forall a b : nat, a = b <-> equal_nat a b =
数据来源: SELECT
CONTENTID, t1.TITLE, t1.PAGEID, COUNT, SPACENAME, CREATIONDATE, LASTMODDATE, VERSION
FROM
(SELECT
SPACEID, TITLE, PAGEID, COUNT(*) AS COUNT
FROM
CONTENT
WHERE
CONTENTTYPE = 'ATTACHMENT'
GROUP BY
TITLE, PAGEID, SPA
我试着从证明plus_n_Sm定理
Theorem succ_is_plus_1: forall n: nat, S n = n + 1.
Proof.
induction n as [| n' ind_hyp].
- simpl. reflexivity.
- simpl. rewrite <- ind_hyp. reflexivity.
Qed.
Theorem plus_n_Sm : forall n m : nat,
S (n + m) = n + (S m).
Proof.
induction n as [| n' ind_hyp ].
我有一个小问题,我正试图解决从一个工作簿复制到另一个工作簿。执行复制的两行代码是有效的,但我只想复制值。实际上,它复制数据,但保留源工作簿中的单元格格式。您会注意到,我注释掉了行尾,当使用时抛出运行时错误1004 ("Unable to get the PasteSpecial property of the range class")。我也看过谷歌搜索的类似问题,但找不到一个适合我的。我希望解决这个问题,这样我就可以继续我的项目。
蒂娅。
下面是我的代码片段:
Private Sub CommandButton77_Click()
'Individual Induct
为了理解Coq是关于什么的,我最终遇到了一种情况,那就是我实际上需要证明a=b -> nat_compare a b = Eq。
我可以通过做这样的事情得到一个方便的开始:
Coq < Theorem foo: forall (a:nat) (b:nat), a=b->nat_compare a b=Eq.
1 subgoal
============================
forall a b : nat, a = b -> nat_compare a b = Eq
foo < intros. rewrite H. destruct b.
这给了我
我试图在构造函数中访问Auth::user()->id;,但它总是返回错误,试图获取非对象的属性。我在laravel文档中研究了会话在构造函数中是不可访问的,并对此进行了搜索。我需要在构造函数中登录用户id,因为我必须从数据库中获取数据,并使其所有方法都可用。我目前的代码是:
public function __construct(){
$this->middleware('auth');
$induction_status = TrainingStatusRecord::where('user_id',Auth::user()-&g
我试图证明这两个加法函数在外延上是相同的,但是我甚至不能证明第二个函数的最简单引理。如何对非本原递归加法函数进行证明?
Fixpoint myadd1 (m n : nat) : nat :=
match m, n with
| 0, n => n
| (S m), n => S (myadd1 m n)
end.
Fixpoint myadd2 (m n : nat) : nat :=
match m, n with
| 0, n => n
| (S m), n => myadd2 m
我最近开始在大学里学习Coq。我有个问题,我被困住了。我需要演示<=定律的传递性,它说明了for all m, n and p, if m <= n and n <= p, then m <= p。我试过了所有可能的基本策略,但我没有弄明白。我想说的是,我是一个初学者,任何基本的解决方案,没有复杂的战术将不胜感激。这也应该通过归纳来完成。谢谢!
Inductive Nat := O : Nat | S : Nat -> Nat.
Fixpoint le_Nat (m n : Nat) : bool :=
match m with
| O => t
它们是在Idris 0.9.14中实现的,我成功地使用了induction作为一些证明。但是,它们只适用于某些库类型;例如,Vect支持它们,而几乎同构的All不支持它们:
-Main.h2> induction ys1 INTERNAL ERROR: induction needs an eliminator for Data.Vect.Quantifiers.All
This is probably a bug, or a missing error message.
Please consider reporting at https://github.com/idris-lang
我正在尝试创建一个团队,添加频道,然后使用Powershell创建一些文件夹。我已经将代码放在下面(我已经注释掉了用户的添加,因为这在此刻产生了另一个问题)。 #Setup named parameters
param ($TeamName, $TeamDescription, $headteacheremail, $hrcontactemail)
#Sign in to Microsoft Teams with mfa.
Connect-MicrosoftTeams -AccountId user@domain.com
Connect-ExchangeOnline -UserPri
我想在证明的顶部断言一些引理,并在未来的每一个目标中重复使用它们。我做了:
Theorem add_comm_eauto_using:
forall n m: nat,
n + m = m + n.
Proof.
intros. induction n.
assert (H: forall n, n + 0 = n) by eauto using n_plus_zero_eq_n.
assert (H': forall n m, S (n + m) = n + S m) by eauto using Sn_plus_m
根据 (第49页),这是平等的完整归纳原则:
Definition path_induction (A : Type) (C : forall x y : A, (x = y) -> Type)
(c : forall x : A, C x x eq_refl) (x y : A) (prEq : x = y)
: C x y prEq :=
match prEq with
| eq_refl => c x
end.
我对HoTT不太了解,但我确实看到路径归纳比eq_rect强:
Lemma path_ind_stronger : forall
我需要通过动态键在映射中获得一个对象,它与字符串一起工作,但在映射时不使用动态名称.
动态对象
data.map((item) => (
console.log("** works with string:", props.programStructure["induction"]),
console.log("** not working with dynamic:", props.programStructure[item.name])
))
我正在尝试解决中的练习4.7。我遇到了一个案例,在这个案例中,我证明了错误,因此证明了一切,但我不能结案,因为我不知道如何引用我的证明义务。
theory ProgProveEx47
imports Main
begin
datatype alpha = a | b | c
inductive S :: "alpha list ⇒ bool" where
Nil: "S []" |
Grow: "S xs ⟹ S ([a]@xs@[b])" |
Append: "S xs ⟹ S ys ⟹ S (xs@ys)"
Lemma in_app_iff : forall A l l' (a:A),
In a (l++l') <-> In a l \/ In a l'.
Proof.
intros.
split.
- induction l.
+ simpl.
induction l'.
* simpl. intros. inversion H.
* simpl.
intros [HL | HR].
right. left. apply HL.
right. r
大约在5到8年前(可能是6到7年),我用Coq写了一篇完整的泡泡类型的形式化文章。最早证实的一个词是标题中的那个,我称之为"sub_succ_r“(或者它可能是标准名称?):
forall n m : nat, (n - (S m))%nat = pred(n - m)
那时候,这是那个引理的一个非常简单的证明:
intros n m.
induction n m using n_double_ind.
simpl.
auto.
apply sub_0_r.
Qed.
"sub__r“是断言
forall n : nat, (n - 0)%nat = n
现在,同样熟悉现代Co
我试图写一个归纳假设,专门用来证明偶数的性质。我提出并证明了以下几点:
Theorem ind_hyp_on_evens:
forall (p : nat -> Prop),
(p 0 -> (forall n, p n -> p (S (S n))) ->
forall n, p (n + n)).
Proof.
intros p P0 P1.
intro n.
assert(p (n + n) /\ p (S (S (n + n)))).
induction n as [| n'].
split. unfold plus. assumption.