Skip to content

Commit 2acb297

Browse files
authored
Merge pull request #158 from arnoudvanderleer/reflections
Change universal arrows to (co)reflections
2 parents 0877eb7 + b45d01f commit 2acb297

File tree

4 files changed

+66
-68
lines changed

4 files changed

+66
-68
lines changed

Modules/Prelims/lib.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Require Import UniMath.CategoryTheory.Limits.Initial.
2828
Require Import UniMath.CategoryTheory.catiso.
2929

3030
Require Import UniMath.CategoryTheory.Adjunctions.Core.
31+
Require Import UniMath.CategoryTheory.Adjunctions.Reflections.
3132

3233

3334
Local Notation "'SET'" := hset_category.
@@ -57,21 +58,20 @@ Proof.
5758
+ apply (pr2 ini).
5859
Defined.
5960

60-
Lemma initial_universal_to_lift_initial {D C : precategory}
61+
Lemma initial_universal_to_lift_initial {D C : category}
6162
(S : D ⟶ C)
6263
(c : Initial C)
6364
{r : D} {f : C ⟦ c, S r ⟧}
64-
(unif : is_universal_arrow_to S c r f) :
65+
(unif : is_reflection (make_reflection_data r f)) :
6566
isInitial _ r.
6667
Proof.
6768
intro d.
68-
specialize (unif d (InitialArrow _ _)).
69+
specialize (unif (make_reflection_data d (InitialArrow _ _))).
6970
use make_iscontr.
7071
- apply (iscontrpr1 unif).
7172
- intro g.
72-
cbn.
7373
apply path_to_ctr.
74-
apply InitialArrowUnique.
74+
refine (!InitialArrowUnique _ _ _).
7575
Qed.
7676

7777
(**

Modules/Signatures/EpiSigRepresentability.v

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Require Import UniMath.CategoryTheory.Core.Prelude.
3131
Require Import UniMath.CategoryTheory.FunctorCategory.
3232
Require Import UniMath.CategoryTheory.whiskering.
3333
Require Import UniMath.CategoryTheory.Adjunctions.Core.
34+
Require Import UniMath.CategoryTheory.Adjunctions.Reflections.
3435
Require Import UniMath.CategoryTheory.Epis.
3536
Require Import UniMath.CategoryTheory.EpiFacts.
3637
Require Import Modules.Prelims.EpiComplements.
@@ -597,25 +598,21 @@ Lemma u_rep_universal (R : model _)
597598
(cond_R :
598599
(isEpi (C := [_, _]) (pr1 (F (R' _ Repi) )) × sig_preservesNatEpiMonad a)
599600
⨿ (isEpi (C := [_, _]) (pr1 (F (pr1 R))) × sig_preservesNatEpiMonad b))
600-
:
601-
602-
is_universal_arrow_to FF R (rep_of_b_in_R' R Repi epiab cond_R)
603-
(projR_rep R Repi epiab cond_R).
601+
: is_reflection (make_reflection_data (F := FF) (rep_of_b_in_R' R Repi epiab cond_R)
602+
(projR_rep R Repi epiab cond_R)).
604603
Proof.
605-
intros S m. cbn in S, m.
606-
use unique_exists.
607-
+ unshelve use (u_rep _ _ _ m).
604+
intro m.
605+
use make_reflection_arrow.
606+
+ unshelve use (u_rep _ _ _ (m : Rep_a⟦_, _⟧)).
608607
+ (* Ici ca devrait être apply quotientmonad.u_def *)
609-
apply pathsinv0.
610608
apply model_mor_mor_equiv.
611609
intro x.
612-
etrans. { apply u_def. }
613-
use (helper _ Repi epiab _ _ (u_rep R _ _ m cond_R)).
614-
+ intro y; apply homset_property.
610+
refine (u_def _ _ _ _ @ _).
611+
exact (helper _ Repi epiab _ _ (u_rep R _ _ (m : Rep_a⟦_, _⟧) cond_R) _).
615612
+ intros u' hu'.
616613
hnf in hu'.
617614
apply u_rep_unique.
618-
rewrite <- hu'.
615+
rewrite hu'.
619616
intro x.
620617
apply helper.
621618
Qed.
@@ -632,7 +629,7 @@ Proof.
632629
intro iniR.
633630
eapply tpair.
634631
eapply (initial_universal_to_lift_initial _ (_ ,, iniR)).
635-
use ( u_rep_universal R R_epi epiab cond_R ).
632+
exact (u_rep_universal R R_epi epiab cond_R).
636633
Qed.
637634

638635
Theorem push_initiality
@@ -681,15 +678,15 @@ Definition is_right_adjoint_functor_of_reps
681678
: is_right_adjoint FF.
682679
Proof.
683680
set (cond_F := fun R R_epi => inl ((Fepi R R_epi),, aepi) : cond_isEpi_hab R R_epi).
684-
use right_adjoint_left_from_partial.
685-
- intro R.
686-
use (rep_of_b_in_R' R _ _ (cond_F R _ )).
681+
apply left_adjoint_weq_reflections.
682+
intro R.
683+
use make_reflection'.
684+
- use (rep_of_b_in_R' R _ _ (cond_F R _ )).
687685
+ apply epiall.
688686
+ apply ii1.
689687
apply epiall.
690-
- intro R. apply projR_rep.
691-
- intro R.
692-
apply u_rep_universal.
688+
- apply projR_rep.
689+
- apply u_rep_universal.
693690
Qed.
694691

695692
Corollary is_right_adjoint_functor_of_reps_from_pw_epi

Modules/SoftEquations/AdjunctionEquationRep.v

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Require Import Modules.Signatures.BindingSig.
5757
Require Import Modules.SoftEquations.BindingSig.
5858

5959
Require Import UniMath.CategoryTheory.Adjunctions.Core.
60+
Require Import UniMath.CategoryTheory.Adjunctions.Reflections.
6061
Require Import UniMath.CategoryTheory.Limits.Initial.
6162

6263

@@ -115,33 +116,33 @@ Section QuotientRep.
115116
:= projR_rep Sig epiSig R_epi SigR_epi d ff.
116117

117118
Lemma u_rep_universal (R : model _) (R_epi: preserves_Epi R) (SigR_epi : preserves_Epi (Sig R))
118-
: is_universal_arrow_to (ModEq_Mod_functor eq) R (R' R_epi SigR_epi) (projR_rep R R_epi SigR_epi).
119+
: is_reflection (make_reflection_data (F := ModEq_Mod_functor eq) (R' R_epi SigR_epi) (projR_rep R R_epi SigR_epi)).
119120
Proof.
120-
intros S f.
121-
set (j := tpair (fun (x : model_equations _) => R →→ x) (S : model_equations _) f).
122-
eassert (def_u :=(u_rep_def _ _ _ _ (@d R) (@ff R) j)).
123-
unshelve eapply unique_exists.
124-
- exact (u_rep_arrow R_epi SigR_epi f ,, tt).
125-
- exact (! def_u).
126-
- intro.
127-
apply homset_property.
121+
intros f.
122+
set (j := tpair (λ (x : model_equations _), R →→ x) (reflection_data_object f) (f : REP_CAT⟦_, _⟧)).
123+
eassert (def_u := u_rep_def _ _ _ _ (@d R) (@ff R) j).
124+
use make_reflection_arrow.
125+
- exact (u_rep_arrow R_epi SigR_epi (f : REP_CAT⟦_, _⟧) ,, tt).
126+
- exact def_u.
128127
- intros g eq'.
129-
use eq_in_sub_precategory.
130-
cbn.
131-
use (_ : isEpi (C := REP_CAT) (projR_rep R _ _)); [apply isEpi_projR_rep|].
132-
etrans;[exact eq'|exact def_u].
128+
apply eq_in_sub_precategory.
129+
use (isEpi_projR_rep _ _ _ _ _ _ : isEpi (C := REP_CAT) (projR_rep R _ _)).
130+
refine (!eq' @ _).
131+
exact def_u.
133132
Qed.
134133

135134
(** If all models preserve epis, and their image by the signature
136135
preserve epis, then we have an adjunctions *)
137136
Definition ModEq_Mod_is_right_adjoint
138137
(modepis : ∏ (R : model Sig), preserves_Epi R)
139138
(SigR_epis : ∏ (R : model Sig) , preserves_Epi (Sig R))
140-
: is_right_adjoint (ModEq_Mod_functor eq) :=
141-
right_adjoint_left_from_partial (ModEq_Mod_functor (λ x : O, eq x))
142-
(fun R => R' (modepis R) (SigR_epis R ))
143-
(fun R => projR_rep R (modepis R)(SigR_epis R ))
144-
(fun R => u_rep_universal R (modepis R)(SigR_epis R )).
139+
: is_right_adjoint (ModEq_Mod_functor eq)
140+
:= invmap (left_adjoint_weq_reflections _)
141+
(λ (R : REP_CAT), make_reflection'
142+
(F := ModEq_Mod_functor eq)
143+
(R' (modepis R) (SigR_epis R))
144+
(projR_rep R (modepis R)(SigR_epis R ))
145+
(u_rep_universal R (modepis R) (SigR_epis R))).
145146

146147

147148
(** If the initial model and its image by the signature preserve epis,

Modules/SoftEquations/CatOfTwoSignatures.v

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Require Import UniMath.CategoryTheory.Limits.Coproducts.
5454
Require Import UniMath.CategoryTheory.Limits.BinCoproducts.
5555
Require Import UniMath.CategoryTheory.Limits.Pushouts.
5656
Require Import UniMath.CategoryTheory.Adjunctions.Core.
57+
Require Import UniMath.CategoryTheory.Adjunctions.Reflections.
5758

5859
Section TwoSig.
5960

@@ -294,25 +295,26 @@ Definition OneSig_to_TwoSig (S : signature C) : TwoSignature := (S ,, ∅ ,, emp
294295

295296
(** This induces a left adjoint to the forgetful functor *)
296297
Lemma universal_OneSig_to_TwoSig (S : signature C) :
297-
is_universal_arrow_to (pr1_category two_signature_disp) S (OneSig_to_TwoSig S) (identity _).
298+
is_reflection (F := pr1_category two_signature_disp)
299+
(make_reflection_data (OneSig_to_TwoSig S) (identity _)).
298300
Proof.
299-
intros TT f.
300-
unshelve eapply unique_exists.
301-
- refine (f ,, _) .
302-
intro.
303-
use empty_rect.
304-
- apply id_left.
305-
- intro.
306-
apply homset_property.
301+
intro f.
302+
use make_reflection_arrow.
303+
- exists (f : signature_category⟦_, _⟧).
304+
intro x.
305+
exact (empty_rect _).
306+
- exact (!id_left _).
307307
- intros y eqy.
308308
apply subtypePath_prop.
309-
etrans;[|exact eqy].
310-
apply pathsinv0, id_left.
309+
refine (_ @ !eqy).
310+
symmetry.
311+
apply id_left.
311312
Defined.
312313

313314
Definition TwoSig_OneSig_is_right_adjoint
314315
: is_right_adjoint (pr1_category two_signature_disp)
315-
:= right_adjoint_left_from_partial (X := signature_category ) _ _ _ universal_OneSig_to_TwoSig.
316+
:= invmap (left_adjoint_weq_reflections _)
317+
(λ (S : signature_category), make_reflection _ (universal_OneSig_to_TwoSig S)).
316318

317319
Lemma OneSig_TwoSig_fully_faithful
318320
: fully_faithful (left_adjoint TwoSig_OneSig_is_right_adjoint : _ ⟶ TwoSig_category).
@@ -462,20 +464,17 @@ Definition OneMod_TwoMod (M : MOD1) : MOD2 :=
462464

463465
(** This induces a left adjoint to the forgetful functor *)
464466
Lemma universal_OneMod_TwoMod (M : MOD1) :
465-
is_universal_arrow_to TwoMod_OneMod_functor M (OneMod_TwoMod M ) (identity _).
467+
is_reflection (F := TwoMod_OneMod_functor)
468+
(make_reflection_data (OneMod_TwoMod M ) (identity _)).
466469
Proof.
467-
intros TT f.
468-
unshelve eapply unique_exists.
469-
- exact ((pr1 f ,, fun x => empty_rect _) ,, pr2 f) .
470-
- apply id_left.
471-
- intro.
472-
apply homset_property.
473-
-
474-
intros y eqy.
470+
intro f.
471+
use make_reflection_arrow.
472+
- exact ((pr1 (f : MOD1⟦_, _⟧) ,, fun x => empty_rect _) ,, pr2 (f : MOD1⟦_, _⟧)).
473+
- exact (!id_left _).
474+
- intros y eqy.
475475
rewrite id_left in eqy.
476-
cbn in eqy.
477-
rewrite <- eqy.
478-
cbn.
476+
cbn in *.
477+
rewrite eqy.
479478
set (y2' := fun (x : model_equations _) => _).
480479
assert (e : y2' = (pr2 (pr1 y))).
481480
{
@@ -491,8 +490,9 @@ Proof.
491490
Defined.
492491

493492

494-
Definition TwoMod_OneMod_is_right_adjoint : is_right_adjoint TwoMod_OneMod_functor :=
495-
right_adjoint_left_from_partial (X := MOD1) _ _ _ universal_OneMod_TwoMod.
493+
Definition TwoMod_OneMod_is_right_adjoint : is_right_adjoint TwoMod_OneMod_functor
494+
:= invmap (left_adjoint_weq_reflections _)
495+
(λ M, make_reflection _ (universal_OneMod_TwoMod M)).
496496

497497
Lemma OneMod_TwoMod_fully_faithful : fully_faithful (left_adjoint TwoMod_OneMod_is_right_adjoint).
498498
Proof.

0 commit comments

Comments
 (0)