如何改善此证明?
我从事Mereology的工作,我想证明给定定理(扩展)遵循我拥有的四个公理。
这是我的代码:
Require Import Classical.
Parameter Entity: Set.
Parameter P : Entity -> Entity -> Prop.
Axiom P_refl : forall x, P x x.
Axiom P_trans : forall x y z,
P x y -> P y z -> P x z.
Axiom P_antisym : forall x y,
P x y -> P y x -> x = y.
Definition PP x y := P x y /\ x <> y.
Definition O x y := exists z, P z x /\ P z y.
Axiom strong_supp : forall x y,
~ P y x -> exists z, P z y /\ ~ O z x.
这是我的证明:
Theorem extension : forall x y,
(exists z, PP z x) -> (forall z, PP z x <-> PP z y) -> x = y.
Proof.
intros x y [w PPwx] H.
apply Peirce.
intros Hcontra.
destruct (classic (P y x)) as [yesP|notP].
- pose proof (H y) as [].
destruct H0.
split; auto.
contradiction.
- pose proof (strong_supp x y notP) as [z []].
assert (y = z).
apply Peirce.
intros Hcontra'.
pose proof (H z) as [].
destruct H3.
split; auto.
destruct H1.
exists z.
split.
apply P_refl.
assumption.
rewrite <- H2 in H1.
pose proof (H w) as [].
pose proof (H3 PPwx).
destruct PPwx.
destruct H5.
destruct H1.
exists w.
split; assumption.
Qed.
我对我完成了此证明的事实感到满意。但是,我发现它很混乱。而且我不知道如何改进它。 (我唯一想到的是使用模式而不是破坏。)有可能改善此证明吗?如果是这样,请不要使用超级复杂的策略:我想了解您建议的升级。
I work on mereology and I wanted to prove that a given theorem (Extensionality) follows from the four axioms I had.
This is my code:
Require Import Classical.
Parameter Entity: Set.
Parameter P : Entity -> Entity -> Prop.
Axiom P_refl : forall x, P x x.
Axiom P_trans : forall x y z,
P x y -> P y z -> P x z.
Axiom P_antisym : forall x y,
P x y -> P y x -> x = y.
Definition PP x y := P x y /\ x <> y.
Definition O x y := exists z, P z x /\ P z y.
Axiom strong_supp : forall x y,
~ P y x -> exists z, P z y /\ ~ O z x.
And this is my proof:
Theorem extension : forall x y,
(exists z, PP z x) -> (forall z, PP z x <-> PP z y) -> x = y.
Proof.
intros x y [w PPwx] H.
apply Peirce.
intros Hcontra.
destruct (classic (P y x)) as [yesP|notP].
- pose proof (H y) as [].
destruct H0.
split; auto.
contradiction.
- pose proof (strong_supp x y notP) as [z []].
assert (y = z).
apply Peirce.
intros Hcontra'.
pose proof (H z) as [].
destruct H3.
split; auto.
destruct H1.
exists z.
split.
apply P_refl.
assumption.
rewrite <- H2 in H1.
pose proof (H w) as [].
pose proof (H3 PPwx).
destruct PPwx.
destruct H5.
destruct H1.
exists w.
split; assumption.
Qed.
I’m happy with the fact that I completed this proof. However, I find it quite messy. And I don’t know how to improve it. (The only thing I think of is to use patterns instead of destruct.) It is possible to improve this proof? If so, please do not use super complex tactics: I would like to understand the upgrades you will propose.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是对您的证明的重构:
主要更改是:
给所有中间假设提供明确且内容丰富的名称(即,避免做
destruct foo foo as [x [x []]
)使用卷曲括号将中间断言的证据与主要证明分开。
使用
一致性
策略来自动化一些低级平等推理。粗略地说,这种策略可以通过以平等的方式重写和用矛盾的陈述来修剪子目标来解决目标,例如x&lt;&gt;&gt; X
。使用
sossert ...通过tactic
condense divial的证明步骤,该步骤不会生成新的子目标。使用
(a&amp; b&amp; c)
破坏性模式,而不是[a [bc]]
,很难阅读。用
x_equiv_y
重写,避免执行序列,例如专业... destruct ... destruct ...在h1
中应用H0
中应用H0,请避免对经典推理的一些不必要的用法。
Here is a refactoring of your proof:
The main changes are:
Give explicit and informative names to all the intermediate hypotheses (i.e., avoid doing
destruct foo as [x []]
)Use curly braces to separate the proofs of the intermediate assertions from the main proof.
Use the
congruence
tactic to automate some of the low-level equality reasoning. Roughly speaking, this tactic solves goals that can be established just by rewriting with equalities and pruning subgoals with contradictory statements likex <> x
.Condense trivial proof steps using the
assert ... by tactic
, which does not generate new subgoals.Use the
(a & b & c)
destruct patterns rather than[a [b c]]
, which are harder to read.Rewrite with
x_equiv_y
to avoid doing sequences such asspecialize... destruct... apply H0 in H1
Avoid some unnecessary uses of classical reasoning.