Skip to content

Commit 0752837

Browse files
committed
Got rid of almost all remaining TODOs.
1 parent eca2a1e commit 0752837

File tree

10 files changed

+34
-127
lines changed

10 files changed

+34
-127
lines changed

Base.v

+1-6
Original file line numberDiff line numberDiff line change
@@ -545,19 +545,14 @@ Definition bijective {A B : Type} (f : A -> B) : Prop :=
545545
injective f /\ surjective f.
546546

547547
Definition injectiveS {A B : Type} {SA : Setoid A} {SB : Setoid B} (f : A -> B) : Prop :=
548-
forall a a' : A, f a == f a' -> a == a'.
548+
forall a a' : A, f a == f a' -> a == a'.
549549

550550
Definition surjectiveS {A B : Type} {S : Setoid B} (f : A -> B) : Prop :=
551551
forall b : B, exists a : A, f a == b.
552552

553553
Definition bijectiveS {A B : Type} {SA : Setoid A} {SB : Setoid B} (f : A -> B) : Prop :=
554554
injectiveS f /\ surjectiveS f.
555555

556-
Definition surjectiveS'
557-
{A B : Type} {SA : Setoid A} {SB : Setoid B} (f : A -> B) : Prop :=
558-
exists g : B -> A,
559-
Proper (equiv ==> equiv) g /\ forall b : B, f (g b) == b.
560-
561556
#[global] Hint Unfold injective surjective bijective injectiveS surjectiveS bijectiveS : core.
562557

563558
(** Useful automation tactics. *)

Category/Enriched.v

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Class Enriched (V : Monoidal) : Type :=
2121
forall A B : EOb, bimap (id (EHom A B)) (EId B) .> EComp A B B == right_unitor (EHom A B);
2222
}.
2323

24-
(* TODO: Commented out because it takes too much time.
2524
#[refine]
2625
#[export]
2726
Instance Enriched_CoqSetoid
@@ -43,5 +42,4 @@ Proof.
4342
- now cbn.
4443
- now cbn.
4544
- now cbn.
46-
Defined.
47-
*)
45+
Defined.

Instances/CoqSet.v

+2-13
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Proof.
2323
- easy.
2424
Defined.
2525

26-
Lemma CoqSet_isMono_inj :
26+
Lemma CoqSet_isMono :
2727
forall (A B : Ob CoqSet) (f : A -> B),
2828
isMono f <-> injective f.
2929
Proof.
@@ -33,7 +33,7 @@ Proof.
3333
- now apply H, H0.
3434
Defined.
3535

36-
Lemma CoqSet_isEpi_sur :
36+
Lemma CoqSet_isEpi :
3737
forall (X Y : Type) (f : Hom X Y),
3838
isEpi f <-> surjective f.
3939
Proof.
@@ -52,17 +52,6 @@ Proof.
5252
now apply propositional_extensionality; intuition eauto.
5353
Qed.
5454

55-
(* TODO : characterize and sections and isomorphisms of sets *)
56-
57-
Lemma CoqSet_isIso_bij :
58-
forall (A B : Type) (f : Hom A B),
59-
isIso f <-> bijective f.
60-
Proof.
61-
intros A B f.
62-
unfold bijective.
63-
rewrite isIso_iff_isMono_isRet, <- CoqSet_isMono_inj, <- CoqSet_isEpi_sur.
64-
Admitted.
65-
6655
#[refine]
6756
#[export]
6857
Instance HasInit_CoqSet : HasInit CoqSet :=

Instances/Lin.v

+14-72
Original file line numberDiff line numberDiff line change
@@ -132,46 +132,9 @@ Proof.
132132
now cbn; intuition.
133133
Defined.
134134

135-
(* TODO : products of linear orders suck because of constructivity *)
136-
137-
(*
138-
#[refine]
139-
#[export]
140-
Instance Lin_product (X Y : Lin) : Lin :=
141-
{
142-
pos := Lin_product_Pos X Y
143-
}.
144-
Proof.
145-
intros [x1 y1] [x2 y2]; cbn in *.
146-
destruct (leq_total x1 x2), (leq_total x2 x1), (leq_total y1 y2), (leq_total y2 y1).
147-
all: firstorder.
148-
Abort.
149-
150-
Definition Lin_outl (X Y : Lin) : ProsHom (Lin_product X Y) X.
151-
Proof.
152-
red. exists fst. destruct 1, H; try rewrite H; lin.
153-
Defined.
154-
155-
Definition Lin_outr (X Y : Lin) : ProsHom (Lin_product X Y) Y.
156-
Proof.
157-
red. exists snd. lin'. destruct a, a', H, H; cbn in *.
158-
Abort.
159-
*)
160-
161-
(*
162-
#[refine]
163-
#[export]
164-
TODO: Instance HasProducts_Lin : HasProducts LinCat :=
165-
{
166-
product := Lin_product;
167-
outl := Pros_outl;
168-
outr := Pros_outr;
169-
fpair := @Pros_fpair
170-
}.
171-
Proof.
172-
all: pos'; cat; try rewrite H; try rewrite H0; try destruct (y x); easy.
173-
Defined.
174-
*)
135+
(** Defining product of linear orders is not possible without LEM and coproducts
136+
of linear orders don't exist because they are kidn of "connected" and
137+
coproducts are all about creating objects which are "disconnected". *)
175138

176139
#[refine]
177140
#[export]
@@ -194,37 +157,16 @@ Proof.
194157
- now intros [x1 | y1] [x2 | y2] [x3 | y3] H12 H23; cbn in *; eauto.
195158
Defined.
196159

197-
#[refine]
198-
#[export]
199-
Instance Lin_coproduct (X Y : Lin) : Lin :=
200-
{
201-
pos :=
202-
{|
203-
pros := Lin_Pros_coproduct X Y;
204-
|}
205-
}.
206-
Proof.
207-
all: now intros; repeat (try
208-
match goal with
209-
| p : _ + _ |- _ => destruct p
210-
end;
211-
my_simpl; try f_equal; lin').
212-
Defined.
213-
214-
Definition Lin_finl (X Y : Lin) : ProsHom X (Lin_coproduct X Y).
215-
Proof.
216-
now exists (CoqSetoid_finl X Y).
217-
Defined.
218-
219-
Definition Lin_finr (X Y : Lin) : ProsHom Y (Lin_coproduct X Y).
160+
Lemma no_coproducts_Lin :
161+
HasCoproducts LinCat -> False.
220162
Proof.
221-
now exists (CoqSetoid_finr X Y).
222-
Defined.
223-
224-
Definition Lin_copair
225-
(A B X : Lin) (f : ProsHom A X) (g : ProsHom B X) : ProsHom (Lin_coproduct A B) X.
226-
Proof.
227-
exists (CoqSetoid_copair f g).
228-
intros [a1 | b1] [a2 | b2] H; cbn in *.
229-
- now lin.
163+
intros [? ? ? ? _]; cbn in *.
164+
specialize (copair _ _ _ (finr Lin_term Lin_term) (finl Lin_term Lin_term)).
165+
destruct copair as [[copair Heq] Hleq]; cbn in *.
166+
destruct (finl Lin_term Lin_term) as [[f Hf1] Hf2]; cbn in *.
167+
destruct (finr Lin_term Lin_term) as [[g Hg1] Hg2]; cbn in *.
168+
pose (Hleq1 := Hleq (f tt) (g tt)).
169+
pose (Hleq2 := Hleq (g tt) (f tt)).
170+
destruct (leq_total (f tt) (g tt)).
171+
- specialize (Hleq1 H).
230172
Abort.

Instances/Pros.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ Proof.
218218
now repeat split; cbn in *.
219219
Defined.
220220

221-
Definition thin (C : Cat) : Prop :=
222-
forall (X Y : Ob C) (f g : Hom X Y), f == g.
221+
(* Definition thin (C : Cat) : Prop :=
222+
forall (X Y : Ob C) (f g : Hom X Y), f == g. *)
223223

224224
#[refine]
225225
#[export]

Instances/Setoids.v

+7-20
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Proof.
5555
- now cbn; intros x; apply H, H0.
5656
Defined.
5757

58-
Lemma CoqSetoid_isEpi :
58+
Lemma CoqSetoid_isEpi_surjectiveS :
5959
forall (X Y : Ob CoqSetoid) (f : Hom X Y),
6060
surjectiveS f -> isEpi f.
6161
Proof.
@@ -65,7 +65,7 @@ Proof.
6565
now apply Heq.
6666
Defined.
6767

68-
Lemma CoqSetoid_surjectiveS :
68+
Lemma CoqSetoid_surjectiveS_isEpi :
6969
forall (X Y : Ob CoqSetoid) (f : Hom X Y),
7070
isEpi f -> surjectiveS f.
7171
Proof.
@@ -85,26 +85,13 @@ Proof.
8585
now intuition eexists.
8686
Defined.
8787

88-
Lemma CoqSetoid_isSec :
89-
forall (X Y : Ob CoqSetoid) (f : Hom X Y),
90-
isSec f -> injectiveS f.
91-
Proof.
92-
intros.
93-
apply isMono_isSec in H.
94-
now apply CoqSetoid_isMono.
95-
Defined.
96-
97-
Lemma CoqSetoid_isRet :
88+
Lemma CoqSetoid_isEpi :
9889
forall (X Y : Ob CoqSetoid) (f : Hom X Y),
99-
isRet f <-> surjectiveS' f.
90+
isEpi f <-> surjectiveS f.
10091
Proof.
101-
unfold isRet, surjectiveS.
102-
split; cbn.
103-
- intros [g H]. red.
104-
exists g.
105-
now setoid'.
106-
- intros (g & H1 & H2).
107-
now exists {| func := g; Proper_func := H1 |}.
92+
split.
93+
- now apply CoqSetoid_surjectiveS_isEpi.
94+
- now apply CoqSetoid_isEpi_surjectiveS.
10895
Qed.
10996

11097
#[export]

ReynoldsProgramme/ReflexiveGraphCategory.v

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Require Import JMeq ProofIrrelevance.
22

3-
(** TODO: work it out.
4-
Remember: in a reflexive graph category, morphisms need NOT preserve
3+
(** Remember: in a reflexive graph category, morphisms need NOT preserve
54
all relations. We just have to specify which morphisms preserve
65
which relations.
76

ReynoldsProgramme/ReflexiveGraphCategory_v2.v

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ Proof.
101101
now setoid.
102102
Defined.
103103

104-
(* TODO *)
105104
#[refine]
106105
#[export]
107106
Instance SetoidFunRel : ReflexiveGraphCategory :=

Universal/Colimit.v

-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ Class HasColimits (C : Cat) : Type :=
100100
Arguments colimit [C _ J] _.
101101
Arguments colimitMor [C _ J F] _.
102102

103-
(* TODO : natural conditions for (co)limits *)
104-
105103
#[refine]
106104
#[export]
107105
Instance CoconeImage

Universal/Limit.v

+6-6
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ Class HasLimits (C : Cat) : Type :=
9595
ok : allLimits (@limit) (@limitMor);
9696
}.
9797

98-
Arguments limit [C _ J] _.
98+
Arguments limit [C _ J] _.
9999
Arguments limitMor [C _ J F] _.
100100

101-
(* TODO : natural conditions for (co)limits *)
102-
103101
#[refine]
104102
#[export]
105103
Instance ConeImage
@@ -118,14 +116,16 @@ Definition isContinuous {C D : Cat} {F : Functor C D} : Prop :=
118116
forall (J : Cat) (Diagram : Functor J C) (K : Cone Diagram),
119117
isLimit' K -> isLimit' (ConeImage F K).
120118

121-
(* Coercion wut {C D : Cat} (F : Functor C D) : Ob (FunCat C D) := F. *)
119+
(*
120+
Coercion wut {C D : Cat} (F : Functor C D) : Ob (FunCat C D) := F.
122121
123-
(* Lemma isLimit_char
122+
Lemma isLimit_char
124123
(J C : Cat) (F : Functor J C)
125124
(K : Cone F) (del : forall K' : Cone F, ConeHom K' K) :
126125
@isLimit J C F K del
127126
<->
128127
forall c : Ob C,
129128
@isomorphic CoqSetoid (HomSetoid C c (apex K)) (HomSetoid (FunCat J C) (ConstFunctor c J) F).
130129
Proof.
131-
Abort. *)
130+
Abort.
131+
*)

0 commit comments

Comments
 (0)