Minor cleanup of some proofs

This commit is contained in:
Dan Frumin 2017-06-16 13:24:54 +02:00
parent 6971697c09
commit dce70f517f
1 changed files with 12 additions and 17 deletions

View File

@ -49,11 +49,9 @@ hrecursion Y; try (intros; apply set_path2).
- cbn. reflexivity. - cbn. reflexivity.
- cbn. reflexivity. - cbn. reflexivity.
- intros x y IHa IHb. - intros x y IHa IHb.
cbn.
rewrite IHa. rewrite IHa.
rewrite IHb. rewrite IHb.
rewrite nl. apply union_idem.
reflexivity.
Defined. Defined.
Theorem comprehension_or : forall ϕ ψ (x: FSet A), Theorem comprehension_or : forall ϕ ψ (x: FSet A),
@ -62,7 +60,7 @@ Theorem comprehension_or : forall ϕ ψ (x: FSet A),
Proof. Proof.
intros ϕ ψ. intros ϕ ψ.
hinduction; try (intros; apply set_path2). hinduction; try (intros; apply set_path2).
- cbn. symmetry ; apply nl. - cbn. apply (union_idem _)^.
- cbn. intros. - cbn. intros.
destruct (ϕ a) ; destruct (ψ a) ; symmetry. destruct (ϕ a) ; destruct (ψ a) ; symmetry.
* apply idem. * apply idem.
@ -86,7 +84,7 @@ Theorem comprehension_subset : forall ϕ (X : FSet A),
Proof. Proof.
intros ϕ. intros ϕ.
hrecursion; try (intros ; apply set_path2) ; cbn. hrecursion; try (intros ; apply set_path2) ; cbn.
- apply nl. - apply union_idem.
- intro a. - intro a.
destruct (ϕ a). destruct (ϕ a).
* apply union_idem. * apply union_idem.
@ -110,9 +108,7 @@ try (intros ; apply set_path2).
- reflexivity. - reflexivity.
- intro a. - intro a.
reflexivity. reflexivity.
- unfold intersection. - intros x y P Q.
intros x y P Q.
cbn.
rewrite P. rewrite P.
rewrite Q. rewrite Q.
apply nl. apply nl.
@ -150,27 +146,26 @@ Defined.
Lemma intersection_comm X Y: intersection X Y = intersection Y X. Lemma intersection_comm X Y: intersection X Y = intersection Y X.
Proof. Proof.
hrecursion X; try (intros; apply set_path2). hrecursion X; try (intros; apply set_path2).
- cbn. unfold intersection. apply comprehension_false. - apply intersection_0l.
- cbn. unfold intersection. intros a. - intro a.
hrecursion Y; try (intros; apply set_path2). hrecursion Y; try (intros; apply set_path2).
+ cbn. reflexivity. + reflexivity.
+ cbn. intros b. + intros b.
destruct (dec (a = b)) as [pa|npa]. destruct (dec (a = b)) as [pa|npa].
* rewrite pa. * rewrite pa.
destruct (dec (b = b)) as [|nb]; [reflexivity|]. destruct (dec (b = b)) as [|nb]; [reflexivity|].
by contradiction nb. by contradiction nb.
* destruct (dec (b = a)) as [pb|]; [|reflexivity]. * destruct (dec (b = a)) as [pb|]; [|reflexivity].
by contradiction npa. by contradiction npa.
+ cbn -[isIn]. intros Y1 Y2 IH1 IH2. + intros Y1 Y2 IH1 IH2.
rewrite IH1. rewrite IH1.
rewrite IH2. rewrite IH2.
symmetry. symmetry.
apply (comprehension_or (fun a => isIn a Y1) (fun a => isIn a Y2) (L a)). apply (comprehension_or (fun a => isIn a Y1) (fun a => isIn a Y2) (L a)).
- intros X1 X2 IH1 IH2. - intros X1 X2 IH1 IH2.
cbn.
unfold intersection in *.
rewrite <- IH1. rewrite <- IH1.
rewrite <- IH2. rewrite <- IH2.
unfold intersection. simpl.
apply comprehension_or. apply comprehension_or.
Defined. Defined.