Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Poly/Bifunctor/Basic.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,15 +35,16 @@ theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl

set_option backward.defeqAttrib.useBackward true in
@[simps!]
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}
(i : F₁ ≅ F₂) (j : P₁ ≅ P₂) : F₁ ⋙₂ P₁ ≅ F₂ ⋙₂ P₂ :=
NatIso.ofComponents₂ (fun C D => (j.app C).app (F₁.obj D) ≪≫ (P₂.obj C).mapIso (i.app D))
(fun _ _ => by simp [NatTrans.naturality_app_assoc])
(fun C f => by
have := congr_arg (P₂.obj C).map (i.hom.naturality f)
simp only [map_comp] at this
simp [this])
(fun {Γ Δ} X σ => by cat_disch)
(fun {X Y} C f => by
dsimp
simp only [Category.assoc, NatTrans.naturality_assoc, ← Functor.map_comp,
i.hom.naturality])

@[simps!]
def comp₂_isoWhiskerLeft {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ} (F : 𝒟' ⥤ 𝒟) (i : P₁ ≅ P₂) :
Expand All@@ -69,13 +70,13 @@ namespace coyoneda
theorem comp₂_naturality₂_left (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X Y : 𝒞) (Z : 𝒟) (f : X ⟶ Y) (g : Y ⟶ F.obj Z) :
-- The `op`s really are a pain. Why can't they be definitional like in Lean 3 :(
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) := by
simp [← FunctorToTypes.naturality₂_left]
(i.app <| .op X).app Z (f ≫ g) = (P.map f.op).app Z ((i.app <| .op Y).app Z g) :=
FunctorToTypes.naturality₂_left (F ⋙₂ coyoneda (C := 𝒞)) P i f.op g

theorem comp₂_naturality₂_right (F : 𝒟 ⥤ 𝒞) (P : 𝒞ᵒᵖ ⥤ 𝒟 ⥤ Type v)
(i : F ⋙₂ coyoneda (C := 𝒞) ⟶ P) (X : 𝒞) (Y Z : 𝒟) (f : X ⟶ F.obj Y) (g : Y ⟶ Z) :
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) := by
simp [← FunctorToTypes.naturality₂_right]
(i.app <| .op X).app Z (f ≫ F.map g) = (P.obj <| .op X).map g ((i.app <| .op X).app Y f) :=
FunctorToTypes.naturality₂_right (F ⋙₂ coyoneda (C := 𝒞)) P i g f

end coyoneda

Expand All@@ -87,8 +88,8 @@ variable {𝒟 : Type*} [Category 𝒟]
def coyoneda_iso {F : 𝒞 ⥤ 𝒟} {G : 𝒟 ⥤ 𝒞} (A : F ⊣ G) :
F.op ⋙ coyoneda (C := 𝒟) ≅ G ⋙₂ coyoneda (C := 𝒞) :=
NatIso.ofComponents₂ (fun C D => Equiv.toIso <| A.homEquiv C.unop D)
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_left])
(fun _ _ => by ext : 1; simp [A.homEquiv_naturality_right])
(fun _ _ => by ext g; exact A.homEquiv_naturality_left _ _)
(fun _ _ => by ext g; exact A.homEquiv_naturality_right _ _)

end Adjunction
end CategoryTheory
37 changes: 27 additions & 10 deletions Poly/Bifunctor/Sigma.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,19 +45,36 @@ a functor `F'` s.t. `F'.Elements ≅ F.Elements × 𝒟`; very awkward.
- known concrete instances are `𝒟 ∈ {Type, Cat, Grpd}` -/
def Sigma {F : 𝒞 ⥤ Type w} (G : F.Elements ⥤ 𝒟 ⥤ Type v) : 𝒞 ⥤ 𝒟 ⥤ Type (max w v) := by
refine curry.obj {
obj := fun (C, D) => (a : F.obj C) × (G.obj ⟨C, a⟩).obj D
map := fun (f, g) ⟨a, b⟩ =>
⟨F.map f a, (G.map ⟨f, rfl⟩).app _ ((G.obj ⟨_, a⟩).map g b)⟩
obj := fun CD => (a : F.obj CD.1) × (G.obj ⟨CD.1, a⟩).obj CD.2
map := fun fg => TypeCat.ofHom fun ab =>
⟨F.map fg.1 ab.1, (G.map ⟨fg.1, rfl⟩).app _ ((G.obj ⟨_, ab.1⟩).map fg.2 ab.2)⟩
map_id := ?_
map_comp := ?_
} <;> {
intros
ext ⟨a, b⟩ : 1
dsimp
congr! 1 with h
. simp
. rw! [h]; simp [FunctorToTypes.naturality]
}
· intro X
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_id_apply]
dsimp
refine Sigma.ext (by simp) ?_
have hobj : F.elementsMk X.1 a = F.elementsMk X.1 (F.map (𝟙 X.1) a) := by
simp [Functor.map_id_apply]
have key : (⟨𝟙 X.1, rfl⟩ :
F.elementsMk X.1 a ⟶ F.elementsMk X.1 (F.map (𝟙 X.1) a))
= eqToHom hobj := by
apply (CategoryOfElements.π F).map_injective
simp [CategoryOfElements.π, eqToHom_map]
rw [key]
simp [eqToHom_map, eqToHom_app]
· intro X Y Z f g
apply ConcreteCategory.ext_apply
rintro ⟨a, b⟩
simp only [TypeCat.ofHom_apply, types_comp_apply]
dsimp
refine Sigma.ext (by simp) ?_
rw! (castMode := .all)
[show F.map (f.1 ≫ g.1) a = F.map g.1 (F.map f.1 a) from by simp]
simp [NatTrans.naturality_apply]

def Sigma.isoCongrLeft {F₁ F₂ : 𝒞 ⥤ Type w}
/- Q: What kind of map `F₂.Elements ⥤ F₁.Elements`
Expand Down
16 changes: 6 additions & 10 deletions Poly/ForMathlib/CategoryTheory/NatTrans.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,8 @@ Authors: Sina Hazratpour

import Mathlib.CategoryTheory.NatTrans
import Mathlib.CategoryTheory.Functor.TwoSquare
import Mathlib.CategoryTheory.Discrete.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic

open CategoryTheory Limits IsPullback
Expand DownExpand Up@@ -69,16 +71,10 @@ theorem hcomp {K : Type*} [Category K] {F G : J ⥤ C} {M N : C ⥤ K} {α : F
(hα : IsCartesian α) (hβ : IsCartesian β)
[∀ (i j : J) (f : j ⟶ i), PreservesLimit (cospan (α.app i) (G.map f)) M] :
IsCartesian (NatTrans.hcomp α β) := by
have ha := hα.whiskerRight M
have hb := hβ.whiskerLeft G
have hc := ha.comp hb
unfold IsCartesian
intros i j f
specialize hc f
simp only [Functor.comp_obj, Functor.comp_map, comp_app,
whiskerRight_app, whiskerLeft_app,
naturality] at hc
exact hc
have : NatTrans.hcomp α β = Functor.whiskerRight α M ≫ Functor.whiskerLeft G β := by
ext x; exact (β.naturality (α.app x)).symm
rw [this]
exact (hα.whiskerRight M).comp (hβ.whiskerLeft G)

open TwoSquare

Expand Down
17 changes: 10 additions & 7 deletions Poly/ForMathlib/CategoryTheory/Types.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,19 +20,22 @@ variable {𝒞 𝒟 : Type*} [Category 𝒞] [Category 𝒟] (F G : 𝒞 ⥤
{C₁ C₂ : 𝒞} {D₁ D₂ : 𝒟}

theorem naturality₂_left (σ : F ⟶ G) (f : C₁ ⟶ C₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) :=
congr_fun (congr_fun (congr_arg NatTrans.app (σ.naturality f)) D₁) x
(σ.app C₂).app D₁ ((F.map f).app D₁ x) = (G.map f).app D₁ ((σ.app C₁).app D₁ x) := by
simpa only [NatTrans.comp_app, types_comp_apply]
using types_congr_hom (NatTrans.congr_app (σ.naturality f) D₁) x

theorem naturality₂_right (σ : F ⟶ G) (f : D₁ ⟶ D₂) (x : (F.obj C₁).obj D₁) :
(σ.app C₁).app D₂ ((F.obj C₁).map f x) = (G.obj C₁).map f ((σ.app C₁).app D₁ x) :=
naturality ..
NatTrans.naturality_apply ..

@[simp]
theorem hom_inv_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.inv.app C).app D ((α.hom.app C).app D x) = x :=
congr_fun (α.hom_inv_id_app_app C D) x
(α.inv.app C).app D ((α.hom.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.hom_inv_id_app_app C D) x

@[simp]
theorem inv_hom_id_app_app_apply (α : F ≅ G) (C D) (x) :
(α.hom.app C).app D ((α.inv.app C).app D x) = x :=
congr_fun (α.inv_hom_id_app_app C D) x
(α.hom.app C).app D ((α.inv.app C).app D x) = x := by
simpa only [types_comp_apply, types_id_apply]
using types_congr_hom (α.inv_hom_id_app_app C D) x
8 changes: 4 additions & 4 deletions Poly/Type/Univariate.lean
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,7 +149,7 @@ def sumEquiv : (P.sum Q) X ≃ P X ⊕ Q X where
| Sum.inl ⟨b, x⟩ => ⟨Sum.inl b, x⟩
| Sum.inr ⟨b, x⟩ => ⟨Sum.inr b, x⟩
left_inv := by
sorry
rintro ⟨(b | b), x⟩ <;> rfl
right_inv := by
aesop_cat

Expand DownExpand Up@@ -177,7 +177,7 @@ theorem map_map (f : X → Y) (g : Y → Z) :
/-- The associated functor of `P : Poly`. -/
def functor : Type u ⥤ Type u where
obj X := P X
map {X Y} f := P.map f
map {X Y} f := ↾(P.map f)

variable {P}

Expand DownExpand Up@@ -224,12 +224,12 @@ def comp.mk {X : Type u} (x : P (Q X)) : Q.comp P X :=
/-- Functor composition for polynomial functors in the diagrammatic order. -/
def comp.functor : Poly.functor (Q.comp P) ≅ Poly.functor Q ⋙ Poly.functor P where
hom := {
app := fun X => fun ⟨b,e⟩ =>
app := fun X => fun ⟨b,e⟩ =>
⟨ b.1, fun x' => ⟨ b.2 x', fun b' => e ⟨x',b'⟩ ⟩⟩
naturality := by aesop_cat
}
inv := {
app X := comp.mk P Q
app X := comp.mk P Q
naturality := by aesop_cat
}

Expand Down
33 changes: 17 additions & 16 deletions lake-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{"version": "1.1.0",
{"version": "1.2.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
Expand All@@ -15,7 +15,7 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "b8dad038b1b3a05b77d6884b15b8db03ec01dca1",
"rev": "5a6fc726c807c8625f1abfdfe710464adb658e69",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
Expand All@@ -25,7 +25,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "7311586e1a56af887b1081d05e80c11b6c41d212",
"rev": "9196a81145e1e291a1469288e77392b0e1b9a493",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -35,7 +35,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -45,7 +45,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "b5908dbac486279f1133cb937648c63c30b455af",
"rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand All@@ -55,51 +55,52 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "6d65c6e0a25b8a52c13c3adeb63ecde3bfbb6294",
"rev": "85bb7e7637e84a7d9803be7d954579fdae42c64b",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.86",
"inputRev": "v0.0.100",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f08e838d4f9aea519f3cde06260cfb686fd4bab0",
"rev": "fafca80479ff95e041d84373dda7122adf1295f2",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "23324752757bf28124a518ec284044c8db79fee5",
"rev": "8d33324ee877e9735d2829bc6f1f439e60cf98b1",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "100083c18750b6a9b7553c65f6b052c0a2f6bcb4",
"rev": "708b057842c4cd0845fba132bd94b08493f6fc42",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "28e0856d4424863a85b18f38868c5420c55f9bae",
"rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.28.0-rc1",
"inputRev": "v4.31.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "Poly",
"lakeDir": ".lake"}
"lakeDir": ".lake",
"fixedToolchain": false}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
leanprover/lean4:v4.28.0-rc1
leanprover/lean4:v4.31.0-rc1