Skip to content

Commit 195abfa

Browse files
authored
chore: bump Poly (#77)
* chore: bump Poly * chore: use new simp rules
1 parent c290b89 commit 195abfa

15 files changed

+62
-107
lines changed

GroupoidModel.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
-- This module serves as the root of the `GroupoidModelInLean4` library.
22
-- Import modules here that should be built as part of the library.
3-
import GroupoidModel.Tarski.NaturalModel
43
import GroupoidModel.Russell_PER_MS.UHom
54
import GroupoidModel.Russell_PER_MS.Interpretation
6-
import GroupoidModel.Groupoids.TarskiNaturalModel
75
import GroupoidModel.Groupoids.NaturalModelBase
86

97
/- There should be at least three separate files here for three separate developments:

GroupoidModel/ForMathlib.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ or redesigned.
2828

2929
namespace CategoryTheory
3030

31-
attribute [reassoc (attr := simp)] Limits.terminal.comp_from
32-
attribute [reassoc (attr := simp)] Limits.initial.to_comp
3331
attribute [reassoc (attr := simp)] Limits.IsTerminal.comp_from
3432
attribute [reassoc (attr := simp)] Limits.IsInitial.to_comp
3533

@@ -781,9 +779,9 @@ def Equiv.psigmaCongrProp {α₁ α₂} {β₁ : α₁ → Prop} {β₂ : α₂
781779

782780
namespace CategoryTheory.Limits
783781

784-
variable {𝒞 : Type u} [Category.{v} 𝒞] [HasPullbacks 𝒞]
782+
variable {𝒞 : Type u} [Category.{v} 𝒞]
785783

786-
noncomputable def pullbackHomEquiv {A B C: 𝒞} {Γ : 𝒞} {f : A ⟶ C} {g : B ⟶ C} :
784+
noncomputable def pullbackHomEquiv {A B C: 𝒞} {Γ : 𝒞} {f : A ⟶ C} {g : B ⟶ C} [HasPullback f g] :
787785
(Γ ⟶ pullback f g) ≃
788786
(fst : Γ ⟶ A) × (snd : Γ ⟶ B) ×' (fst ≫ f = snd ≫ g) where
789787
toFun h := ⟨h ≫ pullback.fst f g, h ≫ pullback.snd f g, by simp[pullback.condition]⟩

GroupoidModel/ForPoly.lean

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,42 @@
1-
import Poly.UvPoly
2-
import Poly.LCCC.Presheaf
3-
import Poly.LCCC.Basic
1+
import Poly.UvPoly.Basic
42
import GroupoidModel.ForMathlib
53

64
open CategoryTheory Limits
75

86
noncomputable section
97

10-
namespace UvPoly
8+
namespace CategoryTheory.UvPoly
119

1210
variable {𝒞} [Category 𝒞] [HasTerminal 𝒞] [HasPullbacks 𝒞]
1311

1412
variable {E B : 𝒞} (P : UvPoly E B) (A : 𝒞)
1513

16-
-- TODO (JH) make issue
17-
theorem pair_proj {Γ} (b : Γ ⟶ B) (e : pullback b P.p ⟶ A) :
18-
P.pairPoly b e ≫ P.proj _ = b := by
19-
sorry
20-
21-
def genPb.snd : P.genPb A ⟶ E :=
22-
pullback.snd (f := P.proj A) (g := P.p)
23-
24-
variable {A}
25-
theorem genPb.condition :
26-
genPb.snd P A ≫ P.p = genPb.fst P A ≫ P.proj A := by
27-
simp [genPb.fst,genPb.snd,pullback.condition]
28-
2914
def compDomEquiv {Γ E B D A : 𝒞} {P : UvPoly E B} {Q : UvPoly D A} :
30-
(Γ ⟶ compDom P Q)
31-
(AB : Γ ⟶ P.functor.obj A) × (α : Γ ⟶ E) × (β : Γ ⟶ D)
32-
×' (h : AB ≫ P.proj A = α ≫ P.p)
33-
×' (β ≫ Q.p = pullback.lift AB α hgenPb.u₂ P A) :=
15+
(Γ ⟶ compDom P Q)
16+
(AB : Γ ⟶ P.functor.obj A) × (α : Γ ⟶ E) × (β : Γ ⟶ D) ×'
17+
(w : AB ≫ P.fstProj A = α ≫ P.p) ×'
18+
(β ≫ Q.p = pullback.lift AB α w(PartialProduct.fan P A).snd) :=
3419
calc
35-
_ ≃ (β : Γ ⟶ D) × (αB : Γ ⟶ genPb P A)
36-
×' (β ≫ Q.p = αB ≫ genPb.u₂ P A) := pullbackHomEquiv
37-
_ ≃ (β : Γ ⟶ D) × (αB : (AB : Γ ⟶ P.functor.obj A) × (α : Γ ⟶ E) ×' AB ≫ P.proj A = α ≫ P.p) ×'
38-
β ≫ Q.p = pullback.lift αB.1 αB.2.1 αB.2.2 ≫ genPb.u₂ P A :=
39-
Equiv.sigmaCongrRight (fun β =>
40-
calc
41-
_ ≃
42-
(αB : (AB : Γ ⟶ P.functor.obj A)
43-
× (α : Γ ⟶ E)
44-
×' (AB ≫ P.proj A = α ≫ P.p))
45-
×' (β ≫ Q.p = pullback.lift αB.1 αB.2.1 αB.2.2 ≫ genPb.u₂ P A) :=
46-
Equiv.psigmaCongrProp pullbackHomEquiv (fun αB => by
47-
apply Eq.congr_right
48-
congr 1
49-
apply pullback.hom_ext
50-
· simp [pullbackHomEquiv]
51-
· simp [pullbackHomEquiv]))
20+
_ ≃ (β : Γ ⟶ D) × (αB : Γ ⟶ pullback (PartialProduct.fan P A).fst P.p) ×'
21+
β ≫ Q.p = αB ≫ (PartialProduct.fan P A).snd :=
22+
pullbackHomEquiv
23+
_ ≃ (β : Γ ⟶ D) × (αB : (AB : Γ ⟶ P.functor.obj A) × (α : Γ ⟶ E) ×'
24+
AB ≫ P.fstProj A = α ≫ P.p) ×'
25+
β ≫ Q.p = pullback.lift αB.1 αB.2.1 αB.2.2 ≫ (PartialProduct.fan P A).snd :=
26+
Equiv.sigmaCongrRight (fun β => calc
27+
_ ≃ (αB : (AB : Γ ⟶ P.functor.obj A) × (α : Γ ⟶ E) ×' (AB ≫ P.fstProj A = α ≫ P.p)) ×'
28+
(β ≫ Q.p = pullback.lift αB.1 αB.2.1 αB.2.2 ≫ (PartialProduct.fan P A).snd) :=
29+
Equiv.psigmaCongrProp pullbackHomEquiv (fun αB => by
30+
apply Eq.congr_right
31+
congr 1
32+
apply pullback.hom_ext
33+
· simp [pullbackHomEquiv]
34+
· simp [pullbackHomEquiv]))
5235
_ ≃ _ := {
5336
-- TODO should be general tactic for this?
5437
toFun x := ⟨ x.2.1.1, x.2.1.2.1 , x.1 , x.2.1.2.2, x.2.2
5538
invFun x := ⟨ x.2.2.1 , ⟨ x.1, x.2.1 , x.2.2.2.1 ⟩ , x.2.2.2.2
5639
left_inv _ := rfl
5740
right_inv _ := rfl }
5841

59-
end UvPoly
60-
61-
variable {𝒞 : Type*} [SmallCategory 𝒞] [HasTerminal 𝒞]
62-
63-
instance : LCC (Psh 𝒞) :=
64-
@LCCC.mkOfOverCC _ _ _ ⟨CategoryOfElements.presheafOverCCC⟩
65-
66-
instance {X Y : Psh 𝒞} (f : X ⟶ Y) : CartesianExponentiable f where
67-
functor := LCC.pushforward f
68-
adj := LCC.adj _
42+
end CategoryTheory.UvPoly

GroupoidModel/Grothendieck/Groupoidal.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ theorem var'_uLiftToPCat :
311311

312312
theorem var'_forget :
313313
var' A ≫ (uLiftGrothendieckForget (Grpd.forgetToCat.{u,u}))
314-
= uLiftGrothendieckForget (Groupoid.compForgetToCat.{u} A) ≫ uLiftA A :=
314+
= uLiftGrothendieckForget (Groupoid.compForgetToCat.{u} A) ≫ uLiftA A :=
315315
(Grothendieck.isPullback (Grpd.forgetToCat.{u,u})).lift_snd
316316
(IsPullback.uLiftToPCat (Groupoid.compForgetToCat.{u} A)) ((IsPullback.uLiftGrothendieckForget (Groupoid.compForgetToCat.{u} A)) ≫ uLiftA A)
317317
(Grothendieck.isPullback (Groupoid.compForgetToCat.{u} A)).cone.condition_one
@@ -338,7 +338,7 @@ by pullback pasting
338338
↑Γ----------------------> ↑Grpd.{u,u} ----------------> ↑Cat.{u,u}
339339
-/
340340
theorem
341-
isPullback_uLiftGrothendieckForget_Groupoid.compForgetToCat_uLiftGrothendieckForget_grpdForgetToCat :
341+
isPullback_uLiftGrothendieckForget_Groupoid.compForgetToCat_uLiftGrothendieckForget_grpdForgetToCat :
342342
IsPullback
343343
(Cat.homOf (var' A))
344344
(IsPullback.uLiftGrothendieckForget (Groupoid.compForgetToCat.{u} A))

GroupoidModel/Russell_PER_MS/NaturalModelBase.lean

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import Poly.ForMathlib.CategoryTheory.LocallyCartesianClosed.Presheaf
2+
import Poly.UvPoly.UPFan
13
import GroupoidModel.ForPoly
24

35
universe v u
@@ -191,17 +193,7 @@ theorem inst_wk {Γ : Ctx} {X : Psh Ctx}
191193

192194
variable (M : NaturalModelBase Ctx)
193195

194-
-- TODO(WN): move to ForMathlib or somewhere
195-
instance : HasFiniteWidePullbacks (Psh Ctx) := hasFiniteWidePullbacks_of_hasFiniteLimits _
196-
197-
instance : LCC (Psh Ctx) := @LCCC.mkOfOverCC _ _ _ ⟨CategoryOfElements.presheafOverCCC⟩
198-
199-
instance {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : CartesianExponentiable tp where
200-
functor := LCC.pushforward tp
201-
adj := LCC.adj _
202-
203196
@[simps] def uvPolyTp : UvPoly M.Tm M.Ty := ⟨M.tp, inferInstance⟩
204-
def uvPolyTpT : UvPoly.Total (Psh Ctx) := ⟨_, _, M.uvPolyTp⟩
205197
def Ptp : Psh Ctx ⥤ Psh Ctx := M.uvPolyTp.functor
206198

207199
-- TODO: establish a profunctor iso to replace `P_equiv` here.

GroupoidModel/Russell_PER_MS/NaturalModelSigma.lean

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def uvPolyTpEquiv {Γ : Ctx} {X : Psh Ctx} :
3838

3939
@[simp] theorem uvPolyTpEquiv_fst {Γ : Ctx} {X : Psh Ctx}
4040
(AB : y(Γ) ⟶ M.uvPolyTp.functor.obj X) :
41-
(M.uvPolyTpEquiv AB).1 = AB ≫ M.uvPolyTp.proj _ :=
41+
(M.uvPolyTpEquiv AB).1 = AB ≫ M.uvPolyTp.fstProj _ :=
4242
rfl
4343

4444
@[simp] theorem uvPolyTpEquiv_symm_snd {Γ : Ctx} {X : Psh Ctx}
@@ -52,14 +52,13 @@ def uvPolyTpEquiv {Γ : Ctx} {X : Psh Ctx} :
5252
theorem uvPolyTpEquiv_symm {Γ : Ctx} {X : Psh Ctx}
5353
(A : y(Γ) ⟶ M.Ty) (B : y(M.ext A) ⟶ X) :
5454
M.uvPolyTpEquiv.symm ⟨ A, B ⟩ =
55-
M.uvPolyTp.pairPoly A ((pullbackIsoExt _ _).hom ≫ B) :=
55+
M.uvPolyTp.lift A ((pullbackIsoExt _ _).hom ≫ B) :=
5656
rfl
5757

5858
@[simp] theorem uvPolyTpEquiv_symm_proj
5959
{Γ : Ctx} {X : Psh Ctx} (A : y(Γ) ⟶ M.Ty) (B : y(M.ext A) ⟶ X):
60-
M.uvPolyTpEquiv.symm ⟨A, B⟩ ≫ M.uvPolyTp.proj _ = A := by
61-
simp only [uvPolyTpEquiv_symm]
62-
apply M.uvPolyTp.pair_proj
60+
M.uvPolyTpEquiv.symm ⟨A, B⟩ ≫ M.uvPolyTp.fstProj _ = A := by
61+
simp [uvPolyTpEquiv_symm]
6362

6463
/-- `sec` is the universal lift in the following diagram,
6564
which is a section of `Groupoidal.forget`
@@ -88,8 +87,8 @@ def sec {Γ : Ctx} (α : y(Γ) ⟶ M.Tm) :
8887
(M.disp_pullback (α ≫ M.tp)).lift_snd _ _ _
8988

9089
theorem lift_ev {Γ : Ctx} {AB : y(Γ) ⟶ M.uvPolyTp.functor.obj M.Ty}
91-
{α : y(Γ) ⟶ M.Tm} (hA : AB ≫ M.uvPolyTp.proj M.Ty = α ≫ M.tp)
92-
: pullback.lift AB α hA ≫ UvPoly.genPb.u₂ M.uvPolyTp M.Ty
90+
{α : y(Γ) ⟶ M.Tm} (hA : AB ≫ M.uvPolyTp.fstProj M.Ty = α ≫ M.tp)
91+
: pullback.lift AB α hA ≫ (UvPoly.PartialProduct.fan M.uvPolyTp M.Ty).snd
9392
= M.sec α ≫ eqToHom (by rw [← hA]; rfl) ≫ (M.uvPolyTpEquiv AB).2 :=
9493
sorry
9594

GroupoidModel/Russell_PER_MS/UHom.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import GroupoidModel.Russell_PER_MS.NaturalModelSigma
22
import GroupoidModel.ForMathlib
33
import Mathlib.CategoryTheory.Limits.Shapes.StrictInitial
4-
import Poly.UvPoly
54

65
/-! Morphisms of natural models, and Russell-universe embeddings. -/
76

File renamed without changes.

GroupoidModel/Tarski/NaturalModel.lean renamed to GroupoidModel/attic/Tarski/NaturalModel.lean

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@ import Mathlib.CategoryTheory.Yoneda
1313
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
1414
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq
1515
import Mathlib.CategoryTheory.Limits.Presheaf
16-
import Mathlib.CategoryTheory.Adjunction.Over
1716

18-
--import Poly
19-
import Poly.LCCC.Basic
20-
import Poly.LCCC.Presheaf
21-
import Poly.Exponentiable
22-
import Poly.UvPoly
17+
import Poly.ForMathlib.CategoryTheory.LocallyCartesianClosed.Presheaf
2318

2419
import GroupoidModel.ForPoly
2520

@@ -79,23 +74,17 @@ variable [M : NaturalModelBase Ctx]
7974

8075
instance : HasFiniteWidePullbacks (Psh Ctx) := hasFiniteWidePullbacks_of_hasFiniteLimits _
8176

82-
instance : LCC (Psh Ctx) := @LCCC.mkOfOverCC _ _ _ ⟨CategoryOfElements.presheafOverCCC⟩
83-
84-
instance {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : CartesianExponentiable tp where
85-
functor := LCC.pushforward tp
86-
adj := LCC.adj _
87-
8877
@[reducible]
8978
def uvPoly {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : UvPoly Tm Ty := ⟨tp, inferInstance⟩
90-
def uvPolyT {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : UvPoly.Total (Psh Ctx) := ⟨_, _, uvPoly tp⟩
79+
def uvPolyT {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : UvPoly.Total (Psh Ctx) := ⟨uvPoly tp⟩
9180

9281
def P {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : Psh Ctx ⥤ Psh Ctx := (uvPoly tp).functor
9382

9483
def P_naturality {E B E' B' : Psh Ctx}
9584
{f : E ⟶ B} {f' : E' ⟶ B'} (α : uvPolyT f ⟶ uvPolyT f') : P f ⟶ P f' :=
9685
UvPoly.naturality (P := uvPolyT f) (Q := uvPolyT f') α
9786

98-
def proj {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : (P tp).obj Ty ⟶ Ty := (uvPoly tp).proj _
87+
def proj {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) : (P tp).obj Ty ⟶ Ty := (uvPoly tp).fstProj _
9988

10089
-- def PolyTwoCellBack {Tm Ty : Psh Ctx} (tp : Tm ⟶ Ty) := sorry
10190

0 commit comments

Comments
 (0)