Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 46344b4

Browse files
committed
feat(category_theory/limits): bilimit from kernel (#14452)
1 parent 024a423 commit 46344b4

File tree

2 files changed

+79
-9
lines changed

2 files changed

+79
-9
lines changed

src/category_theory/limits/shapes/binary_products.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ abbreviation binary_fan.snd {X Y : C} (s : binary_fan X Y) := s.π.app ⟨walkin
139139
@[simp] lemma binary_fan.π_app_right {X Y : C} (s : binary_fan X Y) :
140140
s.π.app ⟨walking_pair.right⟩ = s.snd := rfl
141141

142+
/-- A convenient way to show that a binary fan is a limit. -/
143+
def binary_fan.is_limit.mk {X Y : C} (s : binary_fan X Y)
144+
(lift : Π {T : C} (f : T ⟶ X) (g : T ⟶ Y), T ⟶ s.X)
145+
(hl₁ : ∀ {T : C} (f : T ⟶ X) (g : T ⟶ Y), lift f g ≫ s.fst = f)
146+
(hl₂ : ∀ {T : C} (f : T ⟶ X) (g : T ⟶ Y), lift f g ≫ s.snd = g)
147+
(uniq : ∀ {T : C} (f : T ⟶ X) (g : T ⟶ Y) (m : T ⟶ s.X) (h₁ : m ≫ s.fst = f)
148+
(h₂ : m ≫ s.snd = g), m = lift f g) : is_limit s := is_limit.mk
149+
(λ t, lift (binary_fan.fst t) (binary_fan.snd t))
150+
(by { rintros t (rfl|rfl), { exact hl₁ _ _ }, { exact hl₂ _ _ } })
151+
(λ t m h, uniq _ _ _ (h ⟨walking_pair.left⟩) (h ⟨walking_pair.right⟩))
152+
142153
lemma binary_fan.is_limit.hom_ext {W X Y : C} {s : binary_fan X Y} (h : is_limit s)
143154
{f g : W ⟶ s.X} (h₁ : f ≫ s.fst = g ≫ s.fst) (h₂ : f ≫ s.snd = g ≫ s.snd) : f = g :=
144155
h.hom_ext $ λ j, discrete.rec_on j (λ j, walking_pair.cases_on j h₁ h₂)
@@ -157,6 +168,17 @@ abbreviation binary_cofan.inr {X Y : C} (s : binary_cofan X Y) := s.ι.app ⟨wa
157168
@[simp] lemma binary_cofan.ι_app_right {X Y : C} (s : binary_cofan X Y) :
158169
s.ι.app ⟨walking_pair.right⟩ = s.inr := rfl
159170

171+
/-- A convenient way to show that a binary cofan is a colimit. -/
172+
def binary_cofan.is_colimit.mk {X Y : C} (s : binary_cofan X Y)
173+
(desc : Π {T : C} (f : X ⟶ T) (g : Y ⟶ T), s.X ⟶ T)
174+
(hd₁ : ∀ {T : C} (f : X ⟶ T) (g : Y ⟶ T), s.inl ≫ desc f g = f)
175+
(hd₂ : ∀ {T : C} (f : X ⟶ T) (g : Y ⟶ T), s.inr ≫ desc f g = g)
176+
(uniq : ∀ {T : C} (f : X ⟶ T) (g : Y ⟶ T) (m : s.X ⟶ T) (h₁ : s.inl ≫ m = f)
177+
(h₂ : s.inr ≫ m = g), m = desc f g) : is_colimit s := is_colimit.mk
178+
(λ t, desc (binary_cofan.inl t) (binary_cofan.inr t))
179+
(by { rintros t (rfl|rfl), { exact hd₁ _ _ }, { exact hd₂ _ _ }})
180+
(λ t m h, uniq _ _ _ (h ⟨walking_pair.left⟩) (h ⟨walking_pair.right⟩))
181+
160182
lemma binary_cofan.is_colimit.hom_ext {W X Y : C} {s : binary_cofan X Y} (h : is_colimit s)
161183
{f g : s.X ⟶ W} (h₁ : s.inl ≫ f = s.inl ≫ g) (h₂ : s.inr ≫ f = s.inr ≫ g) : f = g :=
162184
h.hom_ext $ λ j, discrete.rec_on j (λ j, walking_pair.cases_on j h₁ h₂)

src/category_theory/limits/shapes/biproducts.lean

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,62 @@ begin
17531753
cokernel_cofork_of_cofork_π, cofork.π_of_π, add_sub_cancel'_right]
17541754
end
17551755

1756+
/-- If `b` is a binary bicone such that `b.inl` is a kernel of `b.snd`, then `b` is a bilimit
1757+
bicone. -/
1758+
def binary_bicone.is_bilimit_of_kernel_inl {X Y : C} (b : binary_bicone X Y)
1759+
(hb : is_limit (kernel_fork.of_ι _ b.inl_snd)) : b.is_bilimit :=
1760+
is_binary_bilimit_of_is_limit _ $ binary_fan.is_limit.mk _
1761+
(λ T f g, f ≫ b.inl + g ≫ b.inr) (λ T f g, by simp) (λ T f g, by simp) $ λ T f g m h₁ h₂,
1762+
begin
1763+
have h₁' : (m - (f ≫ b.inl + g ≫ b.inr)) ≫ b.fst = 0 := by simpa using sub_eq_zero.2 h₁,
1764+
have h₂' : (m - (f ≫ b.inl + g ≫ b.inr)) ≫ b.snd = 0 := by simpa using sub_eq_zero.2 h₂,
1765+
obtain ⟨q : T ⟶ X, hq : q ≫ b.inl = m - (f ≫ b.inl + g ≫ b.inr)⟩ :=
1766+
kernel_fork.is_limit.lift' hb _ h₂',
1767+
rw [←sub_eq_zero, ←hq, ←category.comp_id q, ←b.inl_fst, ←category.assoc, hq, h₁', zero_comp]
1768+
end
1769+
1770+
/-- If `b` is a binary bicone such that `b.inr` is a kernel of `b.fst`, then `b` is a bilimit
1771+
bicone. -/
1772+
def binary_bicone.is_bilimit_of_kernel_inr {X Y : C} (b : binary_bicone X Y)
1773+
(hb : is_limit (kernel_fork.of_ι _ b.inr_fst)) : b.is_bilimit :=
1774+
is_binary_bilimit_of_is_limit _ $ binary_fan.is_limit.mk _
1775+
(λ T f g, f ≫ b.inl + g ≫ b.inr) (λ t f g, by simp) (λ t f g, by simp) $ λ T f g m h₁ h₂,
1776+
begin
1777+
have h₁' : (m - (f ≫ b.inl + g ≫ b.inr)) ≫ b.fst = 0 := by simpa using sub_eq_zero.2 h₁,
1778+
have h₂' : (m - (f ≫ b.inl + g ≫ b.inr)) ≫ b.snd = 0 := by simpa using sub_eq_zero.2 h₂,
1779+
obtain ⟨q : T ⟶ Y, hq : q ≫ b.inr = m - (f ≫ b.inl + g ≫ b.inr)⟩ :=
1780+
kernel_fork.is_limit.lift' hb _ h₁',
1781+
rw [←sub_eq_zero, ←hq, ←category.comp_id q, ←b.inr_snd, ←category.assoc, hq, h₂', zero_comp]
1782+
end
1783+
1784+
/-- If `b` is a binary bicone such that `b.fst` is a cokernel of `b.inr`, then `b` is a bilimit
1785+
bicone. -/
1786+
def binary_bicone.is_bilimit_of_cokernel_fst {X Y : C} (b : binary_bicone X Y)
1787+
(hb : is_colimit (cokernel_cofork.of_π _ b.inr_fst)) : b.is_bilimit :=
1788+
is_binary_bilimit_of_is_colimit _ $ binary_cofan.is_colimit.mk _
1789+
(λ T f g, b.fst ≫ f + b.snd ≫ g) (λ T f g, by simp) (λ T f g, by simp) $ λ T f g m h₁ h₂,
1790+
begin
1791+
have h₁' : b.inl ≫ (m - (b.fst ≫ f + b.snd ≫ g)) = 0 := by simpa using sub_eq_zero.2 h₁,
1792+
have h₂' : b.inr ≫ (m - (b.fst ≫ f + b.snd ≫ g)) = 0 := by simpa using sub_eq_zero.2 h₂,
1793+
obtain ⟨q : X ⟶ T, hq : b.fst ≫ q = m - (b.fst ≫ f + b.snd ≫ g)⟩ :=
1794+
cokernel_cofork.is_colimit.desc' hb _ h₂',
1795+
rw [←sub_eq_zero, ←hq, ←category.id_comp q, ←b.inl_fst, category.assoc, hq, h₁', comp_zero]
1796+
end
1797+
1798+
/-- If `b` is a binary bicone such that `b.snd` is a cokernel of `b.inl`, then `b` is a bilimit
1799+
bicone. -/
1800+
def binary_bicone.is_bilimit_of_cokernel_snd {X Y : C} (b : binary_bicone X Y)
1801+
(hb : is_colimit (cokernel_cofork.of_π _ b.inl_snd)) : b.is_bilimit :=
1802+
is_binary_bilimit_of_is_colimit _ $ binary_cofan.is_colimit.mk _
1803+
(λ T f g, b.fst ≫ f + b.snd ≫ g) (λ T f g, by simp) (λ T f g, by simp) $ λ T f g m h₁ h₂,
1804+
begin
1805+
have h₁' : b.inl ≫ (m - (b.fst ≫ f + b.snd ≫ g)) = 0 := by simpa using sub_eq_zero.2 h₁,
1806+
have h₂' : b.inr ≫ (m - (b.fst ≫ f + b.snd ≫ g)) = 0 := by simpa using sub_eq_zero.2 h₂,
1807+
obtain ⟨q : Y ⟶ T, hq : b.snd ≫ q = m - (b.fst ≫ f + b.snd ≫ g)⟩ :=
1808+
cokernel_cofork.is_colimit.desc' hb _ h₁',
1809+
rw [←sub_eq_zero, ←hq, ←category.id_comp q, ←b.inr_snd, category.assoc, hq, h₂', comp_zero]
1810+
end
1811+
17561812
/--
17571813
Every split epi `f` with a kernel induces a binary bicone with `f` as its `snd` and
17581814
the kernel map as its `inl`.
@@ -1791,15 +1847,7 @@ This is a version of the splitting lemma that holds in all preadditive categorie
17911847
def is_bilimit_binary_bicone_of_split_epi_of_kernel {X Y : C} {f : X ⟶ Y} [split_epi f]
17921848
{c : kernel_fork f} (i : is_limit c) :
17931849
(binary_bicone_of_split_epi_of_kernel i).is_bilimit :=
1794-
is_binary_bilimit_of_total _
1795-
begin
1796-
simp only [binary_bicone_of_split_epi_of_kernel_fst, binary_bicone_of_split_epi_of_kernel_inl,
1797-
binary_bicone_of_split_epi_of_kernel_inr, binary_bicone_of_split_epi_of_kernel_snd,
1798-
split_mono_of_idempotent_of_is_limit_fork_retraction],
1799-
dsimp only [binary_bicone_of_split_epi_of_kernel_X],
1800-
rw [is_limit_fork_of_kernel_fork_lift, is_kernel_comp_mono_lift],
1801-
simp only [fork.is_limit.lift_ι, fork.ι_of_ι, kernel_fork_of_fork_ι, sub_add_cancel]
1802-
end
1850+
binary_bicone.is_bilimit_of_kernel_inl _ $ i.of_iso_limit $ fork.ext (iso.refl _) (by simp)
18031851

18041852
end
18051853

0 commit comments

Comments
 (0)