Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
File size: 9,011 Bytes
4365a98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import for_mathlib.bicartesian3

noncomputable theory

universe u

open category_theory category_theory.limits


section part1

-- jmc: feel free to generalize to arbitrary abelian cats
variables {A B C D : Ab.{u}} {f : A ⟢ B} {g : B ⟢ C} {h : C ⟢ D}
variables {α : A ⟢ A} {β : B ⟢ B} {γ : C ⟢ C} {δ : D ⟢ D}
open_locale zero_object

lemma bicartesian_of_id_of_end_of_end_of_id
  (H : exact_seq Ab.{u} [f, g, h])
  (sq1 : commsq f Ξ± Ξ² f) (sq2 : commsq g Ξ² Ξ³ g) (sq3 : commsq h Ξ³ Ξ΄ h)
  (hΞ± : Ξ± = -πŸ™ _) (hΞ΄ : Ξ΄ = -πŸ™ _) :
  sq2.bicartesian :=
begin
  have aux : _ := _,
  rw commsq.bicartesian_iff_isos _ _ aux aux sq2.kernel sq2 sq2.cokernel,
  swap,
  { apply exact.cons, { exact exact_kernel_ΞΉ },
    apply exact.exact_seq, { apply abelian.exact_cokernel } },
  split,
  { let t : A ⟢ kernel g := kernel.lift g f ((exact_iff_exact_seq _ _).2 (H.extract 0 2)).w,
    haveI : is_iso Ξ±,
    { rw hΞ±,
      apply_instance },
    refine @abelian.is_iso_of_is_iso_of_is_iso_of_is_iso_of_is_iso _ _ _
      (kernel t) A (kernel g) 0
      (kernel t) A (kernel g) 0
      (kernel.ΞΉ t) t 0
      (kernel.ΞΉ t) t 0
      (-πŸ™ _) Ξ± _ 0
      _ _ _ 0 0 0 0 0 _ _ _ _ _ _ _ _ _ _ _,
    { simp only [preadditive.neg_comp, category.id_comp, preadditive.comp_neg, category.comp_id,
        hΞ±] },
    { simp only [← cancel_mono (kernel.ΞΉ g), sq1.w, category.assoc, kernel.lift_ΞΉ,
        kernel.lift_ΞΉ_assoc] },
    { exact subsingleton.elim _ _ },
    { exact subsingleton.elim _ _ },
    { exact exact_kernel_ΞΉ },
    { exact exact_epi_zero t },
    { exact exact_of_zero 0 0 },
    { exact exact_kernel_ΞΉ },
    { exact exact_epi_zero t },
    { exact exact_of_zero 0 0 } },
  { let t : cokernel g ⟢ D := cokernel.desc g h ((exact_iff_exact_seq _ _).2 (H.extract 1 2)).w,
    haveI : is_iso Ξ΄,
    { rw hΞ΄,
      apply_instance },
    refine @abelian.is_iso_of_is_iso_of_is_iso_of_is_iso_of_is_iso _ _ _
      0 0 (cokernel g) D 0 0 (cokernel g) D
      0 0 t 0 0 t
      0 0 _ Ξ΄
      _ _ _ (cokernel t) (cokernel t) (cokernel.Ο€ t) (cokernel.Ο€ t) (-πŸ™ _) _ _ _ _ _ _ _ _ _ _ _,
    { exact subsingleton.elim _ _ },
    { exact subsingleton.elim _ _ },
    { simp only [← cancel_epi (cokernel.Ο€ g), sq3.w, cokernel.Ο€_desc_assoc, category.assoc,
        cokernel.Ο€_desc] },
    { simp only [hΞ΄, preadditive.neg_comp, category.id_comp, preadditive.comp_neg,
        category.comp_id] },
    { exact exact_of_zero 0 0 },
    { exact exact_zero_mono t },
    { exact abelian.exact_cokernel t },
    { exact exact_of_zero 0 0 },
    { exact exact_zero_mono t },
    { exact abelian.exact_cokernel t } }
end

end part1

section part2
open_locale zero_object

-- jmc: this part does not depend on the first section,
-- it's the same file because two lemmas have the same theme

-- jmc: feel free to generalize to arbitrary abelian cats
variables {A₁₁ A₁₂ A₁₃ A₁₄ A₁₅ : Ab.{u}}
variables {A₂₁ Aβ‚‚β‚‚ A₂₃ Aβ‚‚β‚„ Aβ‚‚β‚… : Ab.{u}}
-- horizontal maps are `f`s and vertical maps are `g`s
variables {f₁₁ : A₁₁ ⟢ A₁₂} {f₁₂ : A₁₂ ⟢ A₁₃} {f₁₃ : A₁₃ ⟢ A₁₄} {f₁₄ : A₁₄ ⟢ A₁₅}
variables {g₁₁ : A₁₁ ⟢ A₂₁} {g₁₂ : A₁₂ ⟢ Aβ‚‚β‚‚} {g₁₃ : A₁₃ ⟢ A₂₃} {g₁₄ : A₁₄ ⟢ Aβ‚‚β‚„} {g₁₅ : A₁₅ ⟢ Aβ‚‚β‚…}
variables {f₂₁ : A₂₁ ⟢ Aβ‚‚β‚‚} {fβ‚‚β‚‚ : Aβ‚‚β‚‚ ⟢ A₂₃} {f₂₃ : A₂₃ ⟢ Aβ‚‚β‚„} {fβ‚‚β‚„ : Aβ‚‚β‚„ ⟢ Aβ‚‚β‚…}

lemma exact_kernel_cokernel : exact_seq Ab.{u} [kernel.ΞΉ f₁₁, f₁₁, cokernel.Ο€ f₁₁] :=
begin
  apply exact.cons, { exact exact_kernel_ΞΉ },
  apply exact.exact_seq, { apply abelian.exact_cokernel }
end

lemma is_iso_kernel_map_of_bicartesian {sq : commsq f₁₁ g₁₁ g₁₂ f₂₁} (H : sq.bicartesian) :
  is_iso (kernel.map f₁₁ f₂₁ _ _ sq.w) :=
begin
  rw commsq.bicartesian_iff_isos _ _ _ _ sq.kernel sq sq.cokernel at H,
  { exact H.1 },
  { exact exact_kernel_cokernel },
  { exact exact_kernel_cokernel }
end

lemma is_iso_cokernel_map_of_bicartesian {sq : commsq f₁₁ g₁₁ g₁₂ f₂₁} (H : sq.bicartesian) :
  is_iso (cokernel.map f₁₁ f₂₁ _ _ sq.w) :=
begin
  rw commsq.bicartesian_iff_isos _ _ _ _ sq.kernel sq sq.cokernel at H,
  { exact H.2 },
  { exact exact_kernel_cokernel },
  { exact exact_kernel_cokernel }
end

section
variables (f₁₁)

lemma exact_epi_comp_iff [epi f₁₁] : exact (f₁₁ ≫ f₁₂) f₁₃ ↔ exact f₁₂ f₁₃ :=
begin
  refine ⟨λ h, _, λ h, exact_epi_comp h⟩,
  rw abelian.exact_iff at h,
  let hc := is_colimit_of_is_colimit_comp (colimit.is_colimit (parallel_pair (f₁₁ ≫ f₁₂) 0))
    (by rw [← cancel_epi f₁₁, ← category.assoc, cokernel_cofork.condition, comp_zero]),
  refine (abelian.exact_iff' _ _ (limit.is_limit _) hc).2 ⟨_, h.2⟩,
  exact zero_of_epi_comp f₁₁ (by rw [← h.1, category.assoc])
end

end

section
variables (f₁₃)

lemma exact_comp_mono_iff [mono f₁₃] : exact f₁₁ (f₁₂ ≫ f₁₃) ↔ exact f₁₁ f₁₂ :=
begin
  refine ⟨λ h, _, λ h, exact_comp_mono h⟩,
  rw abelian.exact_iff at h,
  let hc := is_limit_of_is_limit_comp (limit.is_limit (parallel_pair (f₁₂ ≫ f₁₃) 0))
    (by rw [← cancel_mono f₁₃, category.assoc, kernel_fork.condition, zero_comp]),
  refine (abelian.exact_iff' _ _ hc (colimit.is_colimit _)).2 ⟨_, h.2⟩,
  exact zero_of_comp_mono f₁₃ (by rw [← h.1, category.assoc])
end

end

lemma iso_of_bicartesian_of_bicartesian
  (h_ex₁ : exact_seq Ab.{u} [f₁₁, f₁₂, f₁₃, f₁₄])
  (h_exβ‚‚ : exact_seq Ab.{u} [f₂₁, fβ‚‚β‚‚, f₂₃, fβ‚‚β‚„])
  (sq1 : commsq f₁₁ g₁₁ g₁₂ f₂₁) (sq2 : commsq f₁₂ g₁₂ g₁₃ fβ‚‚β‚‚)
  (sq3 : commsq f₁₃ g₁₃ g₁₄ f₂₃) (sq4 : commsq f₁₄ g₁₄ g₁₅ fβ‚‚β‚„)
  (H1 : sq1.bicartesian) (H4 : sq4.bicartesian) :
  is_iso g₁₃ :=
begin
  haveI := is_iso_cokernel_map_of_bicartesian H1,
  haveI := is_iso_kernel_map_of_bicartesian H4,
  let f₁₂' := cokernel.desc f₁₁ f₁₂ ((exact_iff_exact_seq _ _).2 (h_ex₁.extract 0 2)).w,
  let f₁₃' := kernel.lift f₁₄ f₁₃ ((exact_iff_exact_seq _ _).2 (h_ex₁.extract 2 2)).w,
  let fβ‚‚β‚‚' := cokernel.desc f₂₁ fβ‚‚β‚‚ ((exact_iff_exact_seq _ _).2 (h_exβ‚‚.extract 0 2)).w,
  let f₂₃' := kernel.lift fβ‚‚β‚„ f₂₃ ((exact_iff_exact_seq _ _).2 (h_exβ‚‚.extract 2 2)).w,
  refine @abelian.is_iso_of_is_iso_of_is_iso_of_is_iso_of_is_iso _ _ _
    0 (cokernel f₁₁) A₁₃ (kernel f₁₄) 0 (cokernel f₂₁) A₂₃ (kernel fβ‚‚β‚„)
    0 f₁₂' f₁₃' 0 fβ‚‚β‚‚' f₂₃'
    0 (cokernel.map f₁₁ f₂₁ _ _ sq1.w) g₁₃ (kernel.map f₁₄ fβ‚‚β‚„ _ _ sq4.w)
    _ _ _ 0 0 0 0 0 _ _ _ _ _ _ _ _ _ _ _,
  { exact subsingleton.elim _ _ },
  { simp only [← cancel_epi (cokernel.Ο€ f₁₁), sq2.w, cokernel.Ο€_desc_assoc, category.assoc,
      cokernel.Ο€_desc] },
  { simp only [← cancel_mono (kernel.ΞΉ fβ‚‚β‚„), sq3.w, category.assoc, kernel.lift_ΞΉ,
      kernel.lift_ΞΉ_assoc] },
  { exact subsingleton.elim _ _ },
  { exact exact_zero_mono f₁₂' },
  { rw [← exact_epi_comp_iff (cokernel.Ο€ f₁₁), cokernel.Ο€_desc,
      ← exact_comp_mono_iff (kernel.ΞΉ f₁₄), kernel.lift_ΞΉ],
    exact (exact_iff_exact_seq _ _).2 (h_ex₁.extract 1 2) },
  { exact exact_epi_zero f₁₃' },
  { exact exact_zero_mono fβ‚‚β‚‚' },
  { rw [← exact_epi_comp_iff (cokernel.Ο€ f₂₁), cokernel.Ο€_desc,
      ← exact_comp_mono_iff (kernel.ΞΉ fβ‚‚β‚„), kernel.lift_ΞΉ],
    exact (exact_iff_exact_seq _ _).2 (h_exβ‚‚.extract 1 2) },
  { exact exact_epi_zero f₂₃' }
end

lemma iso_of_zero_of_bicartesian
  (h_ex₁ : exact_seq Ab.{u} [f₁₂, f₁₃, f₁₄])
  (h_exβ‚‚ : exact_seq Ab.{u} [fβ‚‚β‚‚, f₂₃, fβ‚‚β‚„])
  (hz₁ : is_zero A₁₂) (hzβ‚‚ : is_zero Aβ‚‚β‚‚)
  (sq2 : commsq f₁₂ g₁₂ g₁₃ fβ‚‚β‚‚) (sq3 : commsq f₁₃ g₁₃ g₁₄ f₂₃)
  (sq4 : commsq f₁₄ g₁₄ g₁₅ fβ‚‚β‚„) (H4 : sq4.bicartesian) :
  is_iso g₁₃ :=
begin
  have aux₁ : exact (0 : A₁₂ ⟢ A₁₂) f₁₂,
  { have : mono f₁₂ := ⟨λ _ x y h, hz₁.eq_of_tgt _ _⟩, rwa (abelian.tfae_mono A₁₂ f₁₂).out 2 0 },
  have auxβ‚‚ : exact (0 : Aβ‚‚β‚‚ ⟢ Aβ‚‚β‚‚) fβ‚‚β‚‚,
  { have : mono fβ‚‚β‚‚ := ⟨λ _ x y h, hzβ‚‚.eq_of_tgt _ _⟩, rwa (abelian.tfae_mono Aβ‚‚β‚‚ fβ‚‚β‚‚).out 2 0 },
  refine iso_of_bicartesian_of_bicartesian (aux₁.cons h_ex₁) (auxβ‚‚.cons h_exβ‚‚) _ sq2 sq3 sq4 _ H4,
  { exact g₁₂ },
  { exact commsq.of_eq (zero_comp.trans comp_zero.symm) },
  { apply commsq.bicartesian.of_is_limit_of_is_colimt,
    { refine pullback_cone.is_limit.mk _ (Ξ» s, 0)
        (Ξ» s, hz₁.eq_of_tgt _ _) (Ξ» s, hzβ‚‚.eq_of_tgt _ _) _,
      intros, apply hz₁.eq_of_tgt, },
    { refine pushout_cocone.is_colimit.mk _ (Ξ» s, 0)
        (Ξ» s, hz₁.eq_of_src _ _) (Ξ» s, hzβ‚‚.eq_of_src _ _) _,
      intros, apply hzβ‚‚.eq_of_src, } },
end

end part2