Skip to content

Commit 3f1b769

Browse files
committed
[B] Redefine eq_cardinal, invertible, FiniteT
Use `inverse_map` throughout, instead of `bijective`. This makes it easier to re-use lemmas. Use `invertible` instead of `bijective` because it is a slightly stronger property. In particular `FiniteT` behaves a bit better with `invertible` than with `bijective`. Move the definition of `eq_cardinal` from Cardinals to FiniteTypes, because to do it the the other way around, a some lemmas need to be moved.
1 parent 61a601c commit 3f1b769

File tree

13 files changed

+653
-520
lines changed

13 files changed

+653
-520
lines changed

theories/Topology/Compactness.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ Lemma compact_hausdorff_homeo {X Y : TopologicalSpace} (f : X -> Y) :
685685
Proof.
686686
intros.
687687
apply bijective_impl_invertible in H1.
688-
destruct H1 as [g Hgf Hfg].
688+
destruct H1 as [g [Hgf Hfg]].
689689
split; auto.
690690
exists g. repeat split; auto.
691691
apply continuous_closed.

theories/Topology/Homeomorphisms.v

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Lemma homeomorphism_is_invertible: forall {X Y:TopologicalSpace}
1818
homeomorphism f -> invertible f.
1919
Proof.
2020
intros.
21-
destruct H as [_ [g]].
22-
unfold inverse_map in *.
23-
exists g; tauto.
21+
destruct H as [_ [g []]].
22+
exists g; assumption.
2423
Qed.
2524

2625
Definition open_map {X Y:TopologicalSpace} (f:X -> Y) : Prop :=
@@ -37,16 +36,31 @@ erewrite inverse_map_image_inverse_image;
3736
eauto.
3837
Qed.
3938

39+
Lemma inverse_open_map_continuous
40+
{X Y : TopologicalSpace} (f : X -> Y) (g : Y -> X) :
41+
inverse_map f g ->
42+
open_map f <-> continuous g.
43+
Proof.
44+
intros Hfg.
45+
split.
46+
- (* -> *)
47+
intros Hf U HU.
48+
erewrite <- inverse_map_image_inverse_image;
49+
eauto.
50+
- (* <- *)
51+
intros Hg U HU.
52+
erewrite inverse_map_image_inverse_image;
53+
eauto.
54+
Qed.
55+
4056
Lemma invertible_open_map_is_homeomorphism: forall {X Y:TopologicalSpace}
4157
(f:X -> Y),
4258
invertible f -> continuous f -> open_map f -> homeomorphism f.
4359
Proof.
44-
intros. split; auto.
45-
destruct H as [g].
46-
exists g; split; [|split]; try tauto.
47-
intros U HU.
48-
erewrite <- inverse_map_image_inverse_image;
49-
eauto. split; auto.
60+
intros X Y f [g Hfg] Hfcont Hfopen.
61+
split; auto.
62+
exists g; split; auto.
63+
eapply inverse_open_map_continuous; eassumption.
5064
Qed.
5165

5266
(** every continuous self-inverse map is a homeomorphism *)

theories/Topology/SeparatednessAxioms.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Proof.
6060
rewrite <- (proj1 (injective_inverse_image_Singleton g)).
6161
2: {
6262
apply invertible_impl_bijective.
63-
exists f; apply Hfg.
63+
exists f. apply inverse_map_sym, Hfg.
6464
}
6565
apply continuous_closed.
6666
{ apply Hcont_g. }

theories/ZornsLemma/CSB.v

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,21 @@ unfold CSB_bijection2; case (classic_dec (Y_even y)).
203203
+ trivial.
204204
Qed.
205205

206+
Theorem CSB_inverse_map :
207+
exists (h0 : X -> Y) (h1 : Y -> X),
208+
inverse_map h0 h1.
209+
Proof.
210+
exists CSB_bijection, CSB_bijection2.
211+
split.
212+
- exact CSB_comp1.
213+
- exact CSB_comp2.
214+
Qed.
215+
206216
Theorem CSB: exists h:X->Y, bijective h.
207217
Proof.
208218
exists CSB_bijection.
209219
apply invertible_impl_bijective.
210-
exists CSB_bijection2.
220+
exists CSB_bijection2. split.
211221
- exact CSB_comp1.
212222
- exact CSB_comp2.
213223
Qed.

theories/ZornsLemma/Cardinals.v

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ From ZornsLemma Require Import FiniteTypes.
1515
From ZornsLemma Require Import InfiniteTypes.
1616
From Coq Require Import RelationClasses.
1717

18-
Definition eq_cardinal (A B : Type) : Prop :=
19-
exists f : A -> B, bijective f.
2018
Definition le_cardinal (A B : Type) : Prop :=
2119
exists f : A -> B, injective f.
2220

@@ -27,21 +25,6 @@ Definition ge_cardinal (kappa lambda:Type) : Prop :=
2725
Definition gt_cardinal (kappa lambda:Type) : Prop :=
2826
lt_cardinal lambda kappa.
2927

30-
Global Instance eq_cardinal_equiv : Equivalence eq_cardinal.
31-
Proof.
32-
split.
33-
- red; intro. exists id. apply id_bijective.
34-
- red; intros ? ? [f Hf].
35-
apply bijective_impl_invertible in Hf.
36-
destruct Hf as [g Hfg Hgf].
37-
exists g.
38-
apply invertible_impl_bijective.
39-
exists f; auto.
40-
- intros ? ? ? [f Hf] [g Hg].
41-
exists (compose g f).
42-
apply bijective_compose; auto.
43-
Qed.
44-
4528
Instance le_cardinal_preorder : PreOrder le_cardinal.
4629
Proof.
4730
split.
@@ -56,20 +39,20 @@ Instance le_cardinal_PartialOrder :
5639
Proof.
5740
split.
5841
- intros [f Hf]; split.
59-
+ exists f; apply Hf.
60-
+ apply bijective_impl_invertible in Hf.
61-
destruct Hf as [g Hgf Hfg].
42+
+ exists f. apply invertible_impl_bijective; assumption.
43+
+ destruct Hf as [g Hfg].
6244
exists g. apply invertible_impl_bijective.
63-
exists f; auto.
45+
exists f. apply inverse_map_sym.
46+
assumption.
6447
- intros [[f Hf] [g Hg]].
65-
apply CSB with (f := f) (g := g); auto.
48+
apply CSB_inverse_map with (f := f) (g := g); auto.
6649
Qed.
6750

6851
Lemma eq_cardinal_impl_le_cardinal: forall kappa lambda: Type,
6952
eq_cardinal kappa lambda -> le_cardinal kappa lambda.
7053
Proof.
7154
intros ? ? [f Hf].
72-
exists f. apply Hf.
55+
exists f. apply invertible_impl_bijective; auto.
7356
Qed.
7457

7558
(** This lemma is helpful, if one wants
@@ -171,6 +154,7 @@ split.
171154
assumption.
172155
- intros [f Hf].
173156
apply (cantor_diag2 _ f).
157+
apply invertible_impl_bijective.
174158
apply Hf.
175159
Qed.
176160

@@ -561,18 +545,17 @@ Lemma FiniteT_cardinality {X : Type} :
561545
FiniteT X <-> lt_cardinal X nat.
562546
Proof.
563547
split; intros.
564-
- constructor.
548+
- split.
565549
+ destruct (FiniteT_nat_embeds H) as [f].
566550
exists f. assumption.
567-
+ intros [f []].
551+
+ intros H0.
568552
apply nat_infinite.
569-
apply surj_finite with (f := f); auto.
570-
intros; apply classic.
553+
apply bij_finite with X; assumption.
571554
- destruct H as [[f Hf] H].
572555
apply NNPP. intro.
573556
destruct (infinite_nat_inj _ H0) as [g].
574557
contradict H.
575-
apply CSB with (f := f) (g := g);
558+
apply CSB_inverse_map with (f := f) (g := g);
576559
auto.
577560
Qed.
578561

@@ -591,15 +574,13 @@ split.
591574
contradiction.
592575
+ (* |B| ≠ |A| *)
593576
intro.
594-
destruct H0 as [f Hf].
595-
apply bijective_impl_invertible in Hf.
596-
destruct Hf as [g Hgf Hfg].
577+
destruct H0 as [f [g [Hgf Hfg]]].
597578
pose proof (invertible_impl_bijective g).
598579
destruct H0 as [Hg0 Hg1].
599-
{ exists f; assumption. }
580+
{ exists f; split; assumption. }
600581
apply (H g Hg0).
601582
- intros [[f Hf]] g Hg.
602583
contradict H.
603-
apply CSB with (f := f) (g := g);
584+
apply CSB_inverse_map with (f := f) (g := g);
604585
assumption.
605586
Qed.

theories/ZornsLemma/CardinalsEns.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,10 @@ Proof.
791791
exists n. subst. unfold f0.
792792
apply subset_eq. reflexivity.
793793
}
794-
destruct H as [g Hg0 Hg1].
795-
eapply bij_finite with (f := g); eauto.
796-
eexists; eauto.
794+
destruct H as [g Hg0].
795+
eapply bij_finite with _.
796+
2: exists g, f0; split; apply Hg0.
797+
assumption.
797798
- (* <- *)
798799
intros [[[H0 H1]|[f [Hf0 Hf1]]] H2].
799800
{ specialize (H0 0). contradiction. }

theories/ZornsLemma/CountableTypes.v

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ apply exclusive_dec.
3939
- intro.
4040
destruct H0 as [? [f ?]].
4141
contradiction nat_infinite.
42-
apply bij_finite with _ f; trivial.
43-
apply bijective_impl_invertible; trivial.
42+
apply bijective_impl_invertible in H1.
43+
apply bij_finite with X; auto.
44+
exists f; auto.
4445
- destruct (classic (FiniteT X)).
4546
+ left; trivial.
4647
+ right.
@@ -140,15 +141,16 @@ induction H.
140141
intros.
141142
pose proof (equal_f H4).
142143
apply H5.
143-
- destruct H1 as [f1], IHFiniteT as [f0].
144+
- destruct H1 as [f [f1 Hf]].
145+
destruct IHFiniteT as [f0 Hf0].
144146
exists (fun h => f0 (fun x => h (f x))).
145147
intros h1 h2 ?.
146-
apply H3 in H4.
147-
pose proof (equal_f H4).
148-
simpl in H5.
148+
apply Hf0 in H1.
149+
pose proof (equal_f H1).
150+
simpl in H2.
149151
extensionality y.
150-
rewrite <- (H2 y).
151-
apply H5.
152+
rewrite <- (proj2 Hf y).
153+
apply H2.
152154
Qed.
153155

154156
Lemma inj_countable {X Y : Type} (f : X -> Y) :
@@ -186,10 +188,11 @@ induction H.
186188
injection H1 as H1 + discriminate H1 + trivial.
187189
now destruct (H0 _ _ H1).
188190
- destruct IHFiniteT as [g],
189-
H0 as [finv].
191+
H0 as [f [finv]].
190192
exists (fun y:Y => g (finv y)).
191193
intros y1 y2 ?.
192-
apply H1 in H3.
194+
apply H1 in H2.
195+
destruct H0.
193196
congruence.
194197
Qed.
195198

theories/ZornsLemma/Filters.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ induction H.
4040
apply filter_intersection.
4141
+ apply IHFiniteT; auto.
4242
+ apply H0.
43-
- rewrite IndexedIntersection_surj_fn with S f.
43+
- destruct H1 as [f Hf].
44+
rewrite IndexedIntersection_surj_fn with S f.
4445
2: {
45-
apply invertible_impl_bijective in H1.
46-
apply H1.
46+
apply invertible_impl_bijective.
47+
assumption.
4748
}
4849
apply IHFiniteT; auto.
4950
Qed.

theories/ZornsLemma/FiniteIntersections.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ induction H.
8888
- rewrite IndexedIntersection_option_Intersection.
8989
constructor 3; auto.
9090
constructor 2; trivial.
91-
- rewrite IndexedIntersection_surj_fn with V f.
91+
- destruct H1 as [f Hf].
92+
rewrite IndexedIntersection_surj_fn with V f.
9293
2: {
93-
apply invertible_impl_bijective in H1.
94-
destruct H1. assumption.
94+
apply invertible_impl_bijective; auto.
9595
}
9696
apply IHFiniteT.
9797
auto.

0 commit comments

Comments
 (0)