Minor improvements

This commit is contained in:
Niels 2017-09-13 14:22:54 +02:00
parent 7994032d81
commit 28a9e95fea
1 changed files with 9 additions and 19 deletions

View File

@ -5,15 +5,11 @@ Require Import FSets.
Section membership. Section membership.
Context {A : Type} `{Univalence}. Context {A : Type} `{Univalence}.
Theorem dec_membership Definition dec_membership
(H1 : forall (a : A) (X : FSet A), Decidable(a X)) (H1 : forall (a : A) (X : FSet A), Decidable(a X))
(a b : A) (a b : A)
: Decidable(merely(a = b)). : Decidable(merely(a = b))
Proof. := H1 a {|b|}.
destruct (H1 a {|b|}) as [t | t].
- apply (inl t).
- apply (inr(fun p => t p)).
Defined.
End membership. End membership.
Section intersection. Section intersection.
@ -44,26 +40,20 @@ End intersection.
Section subset. Section subset.
Context {A : Type} `{Univalence}. Context {A : Type} `{Univalence}.
Theorem dec_subset Definition dec_subset
(H1 : forall (X Y : FSet A), Decidable(X Y)) (H1 : forall (X Y : FSet A), Decidable(X Y))
(a b : A) (a b : A)
: Decidable(merely(a = b)). : Decidable(merely(a = b))
Proof. := H1 {|a|} {|b|}.
destruct (dec ({|a|} {|b|})) as [t | t].
- apply (inl t).
- apply (inr(fun p => t p)).
Defined.
End subset. End subset.
Section decidable_equality. Section decidable_equality.
Context {A : Type} `{Univalence}. Context {A : Type} `{Univalence}.
Theorem dec_decidable_equality : DecidablePaths(FSet A) Definition dec_decidable_equality (H1 : DecidablePaths(FSet A)) (a b : A)
-> forall (a b : A), Decidable(merely(a = b)). : Decidable(merely(a = b)).
Proof. Proof.
intros H1 a b. destruct (H1 {|a|} {|b|}) as [p | p].
specialize (H1 {|a|} {|b|}).
destruct H1 as [p | p].
- pose (transport (fun z => a z) p) as t. - pose (transport (fun z => a z) p) as t.
apply (inl (t (tr idpath))). apply (inl (t (tr idpath))).
- refine (inr (fun n => _)). - refine (inr (fun n => _)).