简体   繁体   English

第五反对称

[英]Rev.v le_antisymmetric

I came to this point: 我到了这一点:

Theorem le_antisymmetric :
  antisymmetric le.
Proof.
  unfold antisymmetric. intros a b H1 H2. generalize dependent a.
  induction b as [|b' IH].
  - intros. inversion H1. reflexivity.
  - intros.

Output: 输出:

b' : nat
IH : forall a : nat, a <= b' -> b' <= a -> a = b'
a : nat
H1 : a <= S b'
H2 : S b' <= a
------------------------------------------------------
a = S b'

My plan was to use transitivity of le : 我的计划是使用le传递性:

a <= b -> b <= c -> a <= c a <= b-> b <= c-> a <= c

And substitute a := a, b := (S b') and c := a. 并替换a:= a,b:=(S b')和c:= a。

So we'll get: 因此,我们将获得:

a <= (S b') -> (S b') <= a -> a <= a a <=(S b')->(S b')<= a-> a <= a

I'll use H1 and H2 as 2 hypotheses needed and get Ha: a <= a. 我将H1和H2用作所需的两个假设,并得到Ha:a <= a。 Then do an inversion upon it, and get the only way construct this is a = a. 然后对其进行反演,并获得构造a = a的唯一方法。

But what syntax should I use to apply transitivity with 2 my hypotheses to get Ha? 但是,我应该使用哪种语法将2个假设应用于传递性以获得Ha?

Your first induction over b here seems unnecessary. 您对b第一次归纳似乎是不必要的。 Consider le : 考虑le

Inductive le (n : nat) : nat -> Prop :=
    le_n : n <= n | le_S : forall m : nat, n <= m -> n <= S m

You should instead be inspecting H1 first. 相反,您应该首先检查H1 If it's le_n , then that's equality, and you're done. 如果是le_n ,那么就相等了,您就完成了。 If it's le_S , then presumably that's somehow impossible. 如果是le_S ,那么大概是不可能的。

intros a b [ | b' H1] H2.
- reflexivity.

This leaves us with 这给我们留下了

a, b, b' : nat (* b is extraneous *)
H1 : a <= b'
H2 : S b' <= a
______________________________________(1/1)
a = S b'

Now , transitivity makes sense. 现在 ,传递性变得有意义。 It can give you S b' <= b' , which is impossible. 它可以给您S b' <= b' ,这是不可能的。 You can derive a contradiction using induction (I think), or you can use an existing lemma. 您可以使用归纳法导出矛盾(我认为),也可以使用现有的引理。 The whole proof is thus. 因此,整个证明就是如此。

intros a b [ | b' H1] H2.
- reflexivity.
- absurd (S b' <= b').
  + apply Nat.nle_succ_diag_l.
  + etransitivity; eassumption.

That last bit is one way to use transitivity. 最后一点是使用传递性的一种方法。 etransitivity turns the goal R xz into R x ?y and R ?yz , for a new existential variable ?y . etransitivity将目标R xz转换为R x ?yR ?yz ,以获得新的存在变量?y eassumption then finds assumptions that match that pattern. eassumption然后找到与该模式匹配的假设。 Here, specifically, you get goals S b' <= ?y and ?y <= b , filled by H2 and H1 respectively. 在这里,具体来说,您将获得目标S b' <= ?y?y <= b ,分别由H2H1填充。 You can also give the intermediate value explicitly, which lets you drop the e xistential prefix. 你也可以给中间值明确,它可以让你放下e xistential前缀。

transitivity a; assumption.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM