Skip to content
Closed
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
4 changes: 2 additions & 2 deletions Mathlib/CategoryTheory/Galois/Decomposition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ non-trivial subobjects which have strictly smaller fiber and conclude by the ind
private lemma has_decomp_connected_components_aux_conn (X : C) [IsConnected X] :
∃ (ι : Type) (f : ι → C) (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
(∀ i, IsConnected (f i)) ∧ Finite ι := by
refine ⟨Unit, fun _ ↦ X, fun _ ↦ 𝟙 X, mkCofanColimit _ (fun s ↦ s.inj ()), ?_⟩
refine ⟨Unit, fun _ ↦ X, fun _ ↦ 𝟙 X, Cofan.IsColimit.mk _ (fun s ↦ s.inj ()), ?_⟩
exact ⟨fun _ ↦ inferInstance, inferInstance⟩

/-- The trivial case if `X` is initial. -/
private lemma has_decomp_connected_components_aux_initial (X : C) (h : IsInitial X) :
∃ (ι : Type) (f : ι → C) (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
(∀ i, IsConnected (f i)) ∧ Finite ι := by
refine ⟨Empty, fun _ ↦ X, fun _ ↦ 𝟙 X, ?_⟩
use mkCofanColimit _ (fun s ↦ IsInitial.to h s.pt) (fun s ↦ by simp)
use Cofan.IsColimit.mk _ (fun s ↦ IsInitial.to h s.pt) (fun s ↦ by simp)
(fun s m _ ↦ IsInitial.hom_ext h m _)
exact ⟨by simp only [IsEmpty.forall_iff], inferInstance⟩

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/GradedObject.lean
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ the point of this latter cofan computes the coproduct of the `X i` such that `r
@[simp]
def isColimitCofanMapObjComp :
IsColimit (cofanMapObjComp X p q r hpqr k c c') :=
mkCofanColimit _
Cofan.IsColimit.mk _
(fun s => Cofan.IsColimit.desc hc'
(fun ⟨j, (hj : q j = k)⟩ => Cofan.IsColimit.desc (hc j hj)
(fun ⟨i, (hi : p i = j)⟩ => s.inj ⟨i, by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/CategoryTheory/GradedObject/Unitor.lean
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ set_option backward.isDefEq.respectTransparency false in
/-- The cofan `mapBifunctorLeftUnitorCofan F X e p hp Y j` is a colimit. -/
noncomputable def mapBifunctorLeftUnitorCofanIsColimit (j : J) :
IsColimit (mapBifunctorLeftUnitorCofan F X e p hp Y j) :=
mkCofanColimit _
Cofan.IsColimit.mk _
(fun s => e.inv.app (Y j) ≫
(F.map (singleObjApplyIso (0 : I) X).inv).app (Y j) ≫ s.inj ⟨⟨0, j⟩, hp j⟩)
(fun s => by
Expand Down Expand Up @@ -190,7 +190,7 @@ set_option backward.isDefEq.respectTransparency false in
/-- The cofan `mapBifunctorRightUnitorCofan F Y e p hp X j` is a colimit. -/
noncomputable def mapBifunctorRightUnitorCofanIsColimit (j : J) :
IsColimit (mapBifunctorRightUnitorCofan F Y e p hp X j) :=
mkCofanColimit _
Cofan.IsColimit.mk _
(fun s => e.inv.app (X j) ≫
(F.obj (X j)).map (singleObjApplyIso (0 : I) Y).inv ≫ s.inj ⟨⟨j, 0⟩, hp j⟩)
(fun s => by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Groupoid/Grpd/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def piLimitFan ⦃J : Type u⦄ (F : J → Grpd.{u, u}) : Limits.Fan F :=
set_option backward.isDefEq.respectTransparency false in
/-- The product fan over an indexed family of groupoids, is a limit cone. -/
def piLimitFanIsLimit ⦃J : Type u⦄ (F : J → Grpd.{u, u}) : Limits.IsLimit (piLimitFan F) :=
Limits.mkFanLimit (piLimitFan F) (fun s => Functor.pi' fun j => s.proj j)
Limits.Fan.IsLimit.mk (piLimitFan F) (fun s => Functor.pi' fun j => s.proj j)
(by
intros
dsimp only [piLimitFan]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Limits/FormalCoproducts/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ maps from each component, which is the universal property of coproducts. -/

/-- `cofan 𝒜 f` is a coproduct of `f`. -/
@[simps!] def isColimitCofan : IsColimit (cofan 𝒜 f) :=
mkCofanColimit (cofan 𝒜 f) (fun t ↦ (cofanHomEquiv _ _ _).symm t.inj)
Cofan.IsColimit.mk (cofan 𝒜 f) (fun t ↦ (cofanHomEquiv _ _ _).symm t.inj)
(fun t i ↦ congrFun ((cofanHomEquiv _ _ _).right_inv t.inj) i)
(fun _ _ h ↦ (Equiv.eq_symm_apply _).2 (funext h))

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Limits/FormalCoproducts/Cech.lean
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ noncomputable abbrev powerFan :
set_option backward.isDefEq.respectTransparency false in
/-- `U.power α` identifies to the product of copies of `U` indexed by `α`. -/
noncomputable def isLimitPowerFan : IsLimit (U.powerFan α) :=
mkFanLimit _
Fan.IsLimit.mk _
(fun s ↦
{ f i a := (s.proj a).f i
φ i := Pi.lift (fun a ↦ (s.proj a).φ i) })
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Limits/MonoCoprod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ lemma mono_inj (c : Cofan X) (h : IsColimit c) (i : I)
let ι : Unit → I := fun _ ↦ i
have hι : Function.Injective ι := fun _ _ _ ↦ rfl
exact mono_of_injective X ι hι c (Cofan.mk (X i) (fun _ ↦ 𝟙 _)) h
(mkCofanColimit _ (fun s => s.inj ()))
(Cofan.IsColimit.mk _ (fun s => s.inj ()))

instance mono_ι [HasCoproduct X] (i : I)
[HasCoproduct (fun (k : ((Set.range (fun _ : Unit ↦ i))ᶜ : Set I)) => X k.1)] :
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,9 @@ instance {ι} (f : ι → Type*) (g : (i : ι) → (f i) → C)
simp [biproduct.ι_π_ne _ h]
· simp [biproduct.ι_π_ne_assoc _ w] }
isBilimit :=
{ isLimit := mkFanLimit _
{ isLimit := Fan.IsLimit.mk _
(fun s => biproduct.lift fun b => biproduct.lift fun c => s.proj ⟨b, c⟩)
isColimit := mkCofanColimit _
isColimit := Cofan.IsColimit.mk _
(fun s => biproduct.desc fun b => biproduct.desc fun c => s.inj ⟨b, c⟩) } }

/-- An iterated biproduct is a biproduct over a sigma type. -/
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/CategoryTheory/Limits/Shapes/CombinedProducts.lean
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ set_option backward.isDefEq.respectTransparency false in
/-- If `c₁` and `c₂` are limit fans and `bc` is a limit binary fan on their cone
points, then the fan constructed from `combPairHoms` is a limit cone. -/
def combPairIsLimit : IsLimit (Fan.mk bc.pt (combPairHoms c₁ c₂ bc)) :=
mkFanLimit _
Fan.IsLimit.mk _
(fun s ↦ Fan.IsLimit.lift h <| fun i ↦ by
cases i
· exact Fan.IsLimit.lift h₁ (fun a ↦ s.proj (.inl a))
Expand Down Expand Up @@ -84,7 +84,7 @@ set_option backward.isDefEq.respectTransparency false in
/-- If `c₁` and `c₂` are colimit cofans and `bc` is a colimit binary cofan on their cocone
points, then the cofan constructed from `combPairHoms` is a colimit cocone. -/
def combPairIsColimit : IsColimit (Cofan.mk bc.pt (combPairHoms c₁ c₂ bc)) :=
mkCofanColimit _
Cofan.IsColimit.mk _
(fun s ↦ Cofan.IsColimit.desc h <| fun i ↦ by
cases i
· exact Cofan.IsColimit.desc h₁ (fun a ↦ s.inj (.inl a))
Expand Down
24 changes: 15 additions & 9 deletions Mathlib/CategoryTheory/Limits/Shapes/Products.lean
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,16 @@ lemma hasProduct_of_equiv_of_iso (f : α → C) (g : β → C)
/-- Make a fan `f` into a limit fan by providing `lift`, `fac`, and `uniq` --
just a convenience lemma to avoid having to go through `Discrete` -/
@[simps]
def mkFanLimit {f : β → C} (t : Fan f) (lift : ∀ s : Fan f, s.pt ⟶ t.pt)
def Fan.IsLimit.mk {f : β → C} (t : Fan f) (lift : ∀ s : Fan f, s.pt ⟶ t.pt)
(fac : ∀ (s : Fan f) (j : β), lift s ≫ t.proj j = s.proj j := by cat_disch)
(uniq : ∀ (s : Fan f) (m : s.pt ⟶ t.pt) (_ : ∀ j : β, m ≫ t.proj j = s.proj j),
m = lift s := by cat_disch) :
IsLimit t :=
{ lift }

@[deprecated (since := "2026-05-19")]
alias mkFanLimit := Fan.IsLimit.mk

/-- Constructor for morphisms to the point of a limit fan. -/
def Fan.IsLimit.lift {F : β → C} {c : Fan F} (hc : IsLimit c) {A : C}
(f : ∀ i, A ⟶ F i) : A ⟶ c.pt :=
Expand All @@ -142,13 +145,16 @@ lemma Fan.IsLimit.hom_ext {I : Type*} {F : I → C} {c : Fan F} (hc : IsLimit c)
/-- Make a cofan `f` into a colimit cofan by providing `desc`, `fac`, and `uniq` --
just a convenience lemma to avoid having to go through `Discrete` -/
@[simps]
def mkCofanColimit {f : β → C} (s : Cofan f) (desc : ∀ t : Cofan f, s.pt ⟶ t.pt)
def Cofan.IsColimit.mk {f : β → C} (s : Cofan f) (desc : ∀ t : Cofan f, s.pt ⟶ t.pt)
(fac : ∀ (t : Cofan f) (j : β), s.inj j ≫ desc t = t.inj j := by cat_disch)
(uniq : ∀ (t : Cofan f) (m : s.pt ⟶ t.pt) (_ : ∀ j : β, s.inj j ≫ m = t.inj j),
m = desc t := by cat_disch) :
IsColimit s :=
{ desc }

@[deprecated (since := "2026-05-19")]
alias mkCofanColimit := Cofan.IsColimit.mk

/-- Constructor for morphisms from the point of a colimit cofan. -/
def Cofan.IsColimit.desc {F : β → C} {c : Cofan F} (hc : IsColimit c) {A : C}
(f : ∀ i, F i ⟶ A) : c.pt ⟶ A :=
Expand Down Expand Up @@ -311,7 +317,7 @@ def Cofan.isColimitTrans {X : α → C} (c : Cofan X) (hc : IsColimit c)
(hs : ∀ a, IsColimit (Cofan.mk (X a) (π a))) :
IsColimit (Cofan.mk (f := fun ⟨a,b⟩ => Y a b) c.pt
(fun (⟨a, b⟩ : Σ a, _) ↦ π a b ≫ c.inj a)) := by
refine mkCofanColimit _ ?_ ?_ ?_
refine Cofan.IsColimit.mk _ ?_ ?_ ?_
· exact fun t ↦ hc.desc (Cofan.mk _ fun a ↦ (hs a).desc (Cofan.mk t.pt (fun b ↦ t.inj ⟨a, b⟩)))
· intro t ⟨a, b⟩
simp only [mk_pt, cofan_mk_inj, Category.assoc]
Expand Down Expand Up @@ -610,7 +616,7 @@ instance {ι : Type*} (f : ι → Type*) (g : (i : ι) → (f i) → C)
HasProduct fun p : Σ i, f i => g p.1 p.2 where
exists_limit := Nonempty.intro
{ cone := Fan.mk (∏ᶜ fun i => ∏ᶜ g i) (fun X => Pi.π (fun i => ∏ᶜ g i) X.1 ≫ Pi.π (g X.1) X.2)
isLimit := mkFanLimit _ (fun s => Pi.lift fun b => Pi.lift fun c => s.proj ⟨b, c⟩)
isLimit := Fan.IsLimit.mk _ (fun s => Pi.lift fun b => Pi.lift fun c => s.proj ⟨b, c⟩)
(by simp)
(by intro s (m : _ ⟶ (∏ᶜ fun i ↦ ∏ᶜ g i)) w; aesop (add norm simp Sigma.forall)) }

Expand All @@ -630,7 +636,7 @@ instance {ι : Type*} (f : ι → Type*) (g : (i : ι) → (f i) → C)
exists_colimit := Nonempty.intro
{ cocone := Cofan.mk (∐ fun i => ∐ g i)
(fun X => Sigma.ι (g X.1) X.2 ≫ Sigma.ι (fun i => ∐ g i) X.1)
isColimit := mkCofanColimit _
isColimit := Cofan.IsColimit.mk _
(fun s => Sigma.desc fun b => Sigma.desc fun c => s.inj ⟨b, c⟩)
(by simp)
(by intro s (m : (∐ fun i ↦ ∐ g i) ⟶ _) w; aesop_cat (add norm simp Sigma.forall)) }
Expand Down Expand Up @@ -815,7 +821,7 @@ def productUniqueIso [Unique β] (f : β → C) : ∏ᶜ f ≅ f default :=
/-- Any isomorphism is the projection from a single object product. -/
def Fan.isLimitMkOfUnique {X Y : C} (e : X ≅ Y) (J : Type*) [Unique J] :
IsLimit (Fan.mk X fun _ : J ↦ e.hom) := by
refine mkFanLimit _ (fun s ↦ s.proj default ≫ e.inv) (fun s j ↦ ?_) fun s m hm ↦ ?_
refine Fan.IsLimit.mk _ (fun s ↦ s.proj default ≫ e.inv) (fun s j ↦ ?_) fun s m hm ↦ ?_
· obtain rfl : j = default := Subsingleton.elim _ _
simp
· simpa [← cancel_mono e.hom] using hm default
Expand Down Expand Up @@ -850,7 +856,7 @@ def coproductUniqueIso [Unique β] (f : β → C) : ∐ f ≅ f default :=
/-- Any isomorphism is the projection from a single object product. -/
def Cofan.isColimitMkOfUnique {X Y : C} (e : X ≅ Y) (J : Type*) [Unique J] :
IsColimit (Cofan.mk Y fun _ : J ↦ e.hom) := by
refine mkCofanColimit _ (fun s ↦ e.inv ≫ s.inj default) (fun s j ↦ ?_) fun s m hm ↦ ?_
refine Cofan.IsColimit.mk _ (fun s ↦ e.inv ≫ s.inj default) (fun s j ↦ ?_) fun s m hm ↦ ?_
· obtain rfl : j = default := Subsingleton.elim _ _
simp
· simpa [← cancel_epi e.hom] using hm default
Expand Down Expand Up @@ -952,7 +958,7 @@ variable {ι ι' : Type*} {X : ι → ι' → C}
def Fan.IsLimit.prod (c : ∀ i : ι, Fan (fun j : ι' ↦ X i j)) (hc : ∀ i : ι, IsLimit (c i))
(c' : Fan (fun i : ι ↦ (c i).pt)) (hc' : IsLimit c') :
(IsLimit <| Fan.mk c'.pt fun p : ι × ι' ↦ c'.proj _ ≫ (c p.1).proj p.2) := by
refine mkFanLimit _ (fun t ↦ ?_) ?_ fun t m hm ↦ ?_
refine Fan.IsLimit.mk _ (fun t ↦ ?_) ?_ fun t m hm ↦ ?_
· exact Fan.IsLimit.lift hc' fun i ↦ Fan.IsLimit.lift (hc i) fun j ↦ t.proj (i, j)
· simp
· refine Fan.IsLimit.hom_ext hc' _ _ fun i ↦ ?_
Expand All @@ -962,7 +968,7 @@ def Fan.IsLimit.prod (c : ∀ i : ι, Fan (fun j : ι' ↦ X i j)) (hc : ∀ i :
def Cofan.IsColimit.prod (c : ∀ i : ι, Cofan (fun j : ι' ↦ X i j)) (hc : ∀ i : ι, IsColimit (c i))
(c' : Cofan (fun i : ι ↦ (c i).pt)) (hc' : IsColimit c') :
(IsColimit <| Cofan.mk c'.pt fun p : ι × ι' ↦ (c p.1).inj p.2 ≫ c'.inj _) := by
refine mkCofanColimit _ (fun t ↦ ?_) ?_ fun t m hm ↦ ?_
refine Cofan.IsColimit.mk _ (fun t ↦ ?_) ?_ fun t m hm ↦ ?_
· exact Cofan.IsColimit.desc hc' fun i ↦ Cofan.IsColimit.desc (hc i) fun j ↦ t.inj (i, j)
· simp
· refine Cofan.IsColimit.hom_ext hc' _ _ fun i ↦ ?_
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Limits/VanKampen.lean
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ theorem isPullback_of_cofan_isVanKampen [HasInitial C] {ι : Type*} {X : ι →
split
· subst ‹k = i›; rfl
· simp
· refine mkCofanColimit _ (fun t ↦ (eqToHom (if_pos rfl).symm) ≫ t.inj i) ?_ ?_
· refine Cofan.IsColimit.mk _ (fun t ↦ (eqToHom (if_pos rfl).symm) ≫ t.inj i) ?_ ?_
· intro t j
simp only [Cofan.mk_pt, cofan_mk_inj]
split
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Sites/Subcanonical.lean
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ noncomputable def isColimitCofanMkYoneda {ι : Type*} (X : ι → C) {c : Cofan
· obtain ⟨h⟩ := hdisj h a b hab
have := Types.isTerminalEquivUnique _ (Sheaf.isTerminalOfBotCover s.pt _ (hempty Y h))
exact Subsingleton.elim _ _
refine mkCofanColimit _ (fun s ↦ ⟨?_⟩) (fun s j ↦ ?_) fun s m hm ↦ ?_
refine Cofan.IsColimit.mk _ (fun s ↦ ⟨?_⟩) (fun s j ↦ ?_) fun s m hm ↦ ?_
· refine (s.pt.2.isSheafFor _ H).extend ?_
refine ⟨fun Y ↦ ↾fun g ↦ ((s.inj (Sieve.ofArrows.i g.2)).hom.app Y)
(Sieve.ofArrows.h g.2), ?_⟩
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Triangulated/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ set_option backward.isDefEq.respectTransparency false in
/-- The triangle `productTriangle T` satisfies the universal property of the categorical
product of the triangles `T`. -/
def productTriangle.isLimitFan : IsLimit (productTriangle.fan T) :=
mkFanLimit _ (fun s => productTriangle.lift T s.proj) (fun s j => by cat_disch) (by
Fan.IsLimit.mk _ (fun s => productTriangle.lift T s.proj) (fun s j => by cat_disch) (by
intro s m hm
ext1
all_goals
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Condensed/Discrete/Colimit.lean
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def fintypeCatAsCofan (X : Profinite) :
/-- A finite set is the coproduct of its points in `Profinite`. -/
def fintypeCatAsCofanIsColimit (X : Profinite) [Finite X] :
IsColimit (fintypeCatAsCofan X) :=
mkCofanColimit _ (fun t ↦ ConcreteCategory.ofHom ⟨fun x ↦ t.inj x PUnit.unit,
Cofan.IsColimit.mk _ (fun t ↦ ConcreteCategory.ofHom ⟨fun x ↦ t.inj x PUnit.unit,
continuous_of_discreteTopology (α := X)⟩) (by aesop)
(fun _ _ h ↦ by ext x; exact CategoryTheory.congr_fun (h x) _)

Expand Down Expand Up @@ -491,7 +491,7 @@ def fintypeCatAsCofan (X : LightProfinite) :
/-- A finite set is the coproduct of its points in `LightProfinite`. -/
def fintypeCatAsCofanIsColimit (X : LightProfinite) [Finite X] :
IsColimit (fintypeCatAsCofan X) :=
mkCofanColimit _ (fun t ↦ ConcreteCategory.ofHom ⟨fun x ↦ t.inj x PUnit.unit,
Cofan.IsColimit.mk _ (fun t ↦ ConcreteCategory.ofHom ⟨fun x ↦ t.inj x PUnit.unit,
continuous_of_discreteTopology (α := X)⟩) (by aesop)
(fun _ _ h ↦ by ext x; exact CategoryTheory.congr_fun (h x) _)

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Topology/Category/CompHausLike/Limits.lean
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ abbrev finiteCoproduct.cofan : Limits.Cofan X :=

/-- The explicit finite coproduct cocone is a colimit cocone. -/
def finiteCoproduct.isColimit : Limits.IsColimit (finiteCoproduct.cofan X) :=
mkCofanColimit _
Cofan.IsColimit.mk _
(fun s ↦ desc _ fun a ↦ s.inj a)
(fun _ _ ↦ ι_desc _ _ _)
fun _ _ hm ↦ finiteCoproduct.hom_ext _ _ _ fun a ↦
Expand Down
Loading