l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
    Covariant N N (· * ·) r ↔ Contravariant N N (· * ·) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · 

Proof state:
case refine_1
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Covariant N N (fun x x_1 => x * x_1) r
a b c : N
bc : r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)
⊢ r b c

Next tactic:
rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c]
@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
    Covariant N N (· * ·) r ↔ Contravariant N N (· * ·) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c]
    

Proof state:
case refine_1
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Covariant N N (fun x x_1 => x * x_1) r
a b c : N
bc : r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)
⊢ r (a⁻¹ * (a * b)) (a⁻¹ * (a * c))

Next tactic:
exact h a⁻¹ bc
@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
    Covariant N N (· * ·) r ↔ Contravariant N N (· * ·) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c]
    exact h a⁻¹ bc
  · 

Proof state:
case refine_2
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Contravariant N N (fun x x_1 => x * x_1) r
a b c : N
bc : r b c
⊢ r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)

Next tactic:
rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c] at bc
@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
    Covariant N N (· * ·) r ↔ Contravariant N N (· * ·) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c]
    exact h a⁻¹ bc
  · rw [← inv_mul_cancel_left a b, ← inv_mul_cancel_left a c] at bc
    

Proof state:
case refine_2
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Contravariant N N (fun x x_1 => x * x_1) r
a b c : N
bc : r (a⁻¹ * (a * b)) (a⁻¹ * (a * c))
⊢ r ((fun x x_1 => x * x_1) a b) ((fun x x_1 => x * x_1) a c)

Next tactic:
exact h a⁻¹ bc
@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
    Covariant N N (swap (· * ·)) r ↔ Contravariant N N (swap (· * ·)) r := by
  

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
⊢ Covariant N N (swap fun x x_1 => x * x_1) r ↔ Contravariant N N (swap fun x x_1 => x * x_1) r

Next tactic:
refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
    Covariant N N (swap (· * ·)) r ↔ Contravariant N N (swap (· * ·)) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · 

Proof state:
case refine_1
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Covariant N N (swap fun x x_1 => x * x_1) r
a b c : N
bc : r (swap (fun x x_1 => x * x_1) a b) (swap (fun x x_1 => x * x_1) a c)
⊢ r b c

Next tactic:
rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a]
@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
    Covariant N N (swap (· * ·)) r ↔ Contravariant N N (swap (· * ·)) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a]
    

Proof state:
case refine_1
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Covariant N N (swap fun x x_1 => x * x_1) r
a b c : N
bc : r (swap (fun x x_1 => x * x_1) a b) (swap (fun x x_1 => x * x_1) a c)
⊢ r (b * a * a⁻¹) (c * a * a⁻¹)

Next tactic:
exact h a⁻¹ bc
@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
    Covariant N N (swap (· * ·)) r ↔ Contravariant N N (swap (· * ·)) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a]
    exact h a⁻¹ bc
  · 

Proof state:
case refine_2
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Contravariant N N (swap fun x x_1 => x * x_1) r
a b c : N
bc : r b c
⊢ r (swap (fun x x_1 => x * x_1) a b) (swap (fun x x_1 => x * x_1) a c)

Next tactic:
rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a] at bc
@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
    Covariant N N (swap (· * ·)) r ↔ Contravariant N N (swap (· * ·)) r := by
  refine ⟨fun h a b c bc ↦ ?_, fun h a b c bc ↦ ?_⟩
  · rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a]
    exact h a⁻¹ bc
  · rw [← mul_inv_cancel_right b a, ← mul_inv_cancel_right c a] at bc
    

Proof state:
case refine_2
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝¹ : CovariantClass M N μ r
inst✝ : Group N
h : Contravariant N N (swap fun x x_1 => x * x_1) r
a b c : N
bc : r (b * a * a⁻¹) (c * a * a⁻¹)
⊢ r (swap (fun x x_1 => x * x_1) a b) (swap (fun x x_1 => x * x_1) a c)

Next tactic:
exact h a⁻¹ bc
theorem covariant_le_of_covariant_lt [PartialOrder N] :
    Covariant M N μ (· < ·) → Covariant M N μ (· ≤ ·) := by
  

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
⊢ (Covariant M N μ fun x x_1 => x < x_1) → Covariant M N μ fun x x_1 => x ≤ x_1

Next tactic:
intro h a b c bc
theorem covariant_le_of_covariant_lt [PartialOrder N] :
    Covariant M N μ (· < ·) → Covariant M N μ (· ≤ ·) := by
  intro h a b c bc
  

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Covariant M N μ fun x x_1 => x < x_1
a : M
b c : N
bc : b ≤ c
⊢ μ a b ≤ μ a c

Next tactic:
rcases bc.eq_or_lt with (rfl | bc)
theorem covariant_le_of_covariant_lt [PartialOrder N] :
    Covariant M N μ (· < ·) → Covariant M N μ (· ≤ ·) := by
  intro h a b c bc
  rcases bc.eq_or_lt with (rfl | bc)
  · 

Proof state:
case inl
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Covariant M N μ fun x x_1 => x < x_1
a : M
b : N
bc : b ≤ b
⊢ μ a b ≤ μ a b

Next tactic:
exact le_rfl
theorem covariant_le_of_covariant_lt [PartialOrder N] :
    Covariant M N μ (· < ·) → Covariant M N μ (· ≤ ·) := by
  intro h a b c bc
  rcases bc.eq_or_lt with (rfl | bc)
  · exact le_rfl
  · 

Proof state:
case inr
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Covariant M N μ fun x x_1 => x < x_1
a : M
b c : N
bc✝ : b ≤ c
bc : b < c
⊢ μ a b ≤ μ a c

Next tactic:
exact (h _ bc).le
theorem contravariant_le_iff_contravariant_lt_and_eq [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) ↔ Contravariant M N μ (· < ·) ∧ Contravariant M N μ (· = ·) := by
  

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
⊢ (Contravariant M N μ fun x x_1 => x ≤ x_1) ↔
    (Contravariant M N μ fun x x_1 => x < x_1) ∧ Contravariant M N μ fun x x_1 => x = x_1

Next tactic:
refine ⟨fun h ↦ ⟨fun a b c bc ↦ ?_, fun a b c bc ↦ ?_⟩, fun h ↦ fun a b c bc ↦ ?_⟩
theorem contravariant_le_iff_contravariant_lt_and_eq [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) ↔ Contravariant M N μ (· < ·) ∧ Contravariant M N μ (· = ·) := by
  refine ⟨fun h ↦ ⟨fun a b c bc ↦ ?_, fun a b c bc ↦ ?_⟩, fun h ↦ fun a b c bc ↦ ?_⟩
  · 

Proof state:
case refine_1
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Contravariant M N μ fun x x_1 => x ≤ x_1
a : M
b c : N
bc : (fun x x_1 => x < x_1) (μ a b) (μ a c)
⊢ (fun x x_1 => x < x_1) b c

Next tactic:
exact (h a bc.le).lt_of_ne (by rintro rfl; exact lt_irrefl _ bc)
theorem contravariant_le_iff_contravariant_lt_and_eq [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) ↔ Contravariant M N μ (· < ·) ∧ Contravariant M N μ (· = ·) := by
  refine ⟨fun h ↦ ⟨fun a b c bc ↦ ?_, fun a b c bc ↦ ?_⟩, fun h ↦ fun a b c bc ↦ ?_⟩
  · exact (h a bc.le).lt_of_ne (by 

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Contravariant M N μ fun x x_1 => x ≤ x_1
a : M
b c : N
bc : (fun x x_1 => x < x_1) (μ a b) (μ a c)
⊢ b ≠ c

Next tactic:
rintro rfl
theorem contravariant_le_iff_contravariant_lt_and_eq [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) ↔ Contravariant M N μ (· < ·) ∧ Contravariant M N μ (· = ·) := by
  refine ⟨fun h ↦ ⟨fun a b c bc ↦ ?_, fun a b c bc ↦ ?_⟩, fun h ↦ fun a b c bc ↦ ?_⟩
  · exact (h a bc.le).lt_of_ne (by rintro rfl; 

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Contravariant M N μ fun x x_1 => x ≤ x_1
a : M
b : N
bc : μ a b < μ a b
⊢ False

Next tactic:
exact lt_irrefl _ bc
theorem contravariant_le_iff_contravariant_lt_and_eq [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) ↔ Contravariant M N μ (· < ·) ∧ Contravariant M N μ (· = ·) := by
  refine ⟨fun h ↦ ⟨fun a b c bc ↦ ?_, fun a b c bc ↦ ?_⟩, fun h ↦ fun a b c bc ↦ ?_⟩
  · exact (h a bc.le).lt_of_ne (by rintro rfl; exact lt_irrefl _ bc)
  · 

Proof state:
case refine_2
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : Contravariant M N μ fun x x_1 => x ≤ x_1
a : M
b c : N
bc : (fun x x_1 => x = x_1) (μ a b) (μ a c)
⊢ (fun x x_1 => x = x_1) b c

Next tactic:
exact (h a bc.le).antisymm (h a bc.ge)
theorem contravariant_le_iff_contravariant_lt_and_eq [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) ↔ Contravariant M N μ (· < ·) ∧ Contravariant M N μ (· = ·) := by
  refine ⟨fun h ↦ ⟨fun a b c bc ↦ ?_, fun a b c bc ↦ ?_⟩, fun h ↦ fun a b c bc ↦ ?_⟩
  · exact (h a bc.le).lt_of_ne (by rintro rfl; exact lt_irrefl _ bc)
  · exact (h a bc.le).antisymm (h a bc.ge)
  · 

Proof state:
case refine_3
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
inst✝ : PartialOrder N
h : (Contravariant M N μ fun x x_1 => x < x_1) ∧ Contravariant M N μ fun x x_1 => x = x_1
a : M
b c : N
bc : (fun x x_1 => x ≤ x_1) (μ a b) (μ a c)
⊢ (fun x x_1 => x ≤ x_1) b c

Next tactic:
exact bc.lt_or_eq.elim (fun bc ↦ (h.1 a bc).le) (fun bc ↦ (h.2 a bc).le)
theorem covariant_flip_iff [IsSymmOp N N mu] :
    Covariant N N (flip mu) r ↔ Covariant N N mu r := by 

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
mu : N → N → N
inst✝ : IsSymmOp N N mu
⊢ Covariant N N (flip mu) r ↔ Covariant N N mu r

Next tactic:
rw [IsSymmOp.flip_eq]
theorem contravariant_flip_iff [IsSymmOp N N mu] :
    Contravariant N N (flip mu) r ↔ Contravariant N N mu r := by 

Proof state:
M : Type u_1
N : Type u_2
μ : M → N → N
r : N → N → Prop
mu : N → N → N
inst✝ : IsSymmOp N N mu
⊢ Contravariant N N (flip mu) r ↔ Contravariant N N mu r

Next tactic:
rw [IsSymmOp.flip_eq]
/-- Given any distinguished triangle
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
the composition `f ≫ g = 0`.
See <https://stacks.math.columbia.edu/tag/0146>
-/
@[reassoc]
theorem comp_distTriang_mor_zero₁₂ (T) (H : T ∈ (distTriang C)) : T.mor₁ ≫ T.mor₂ = 0 := by
  

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
T : Triangle C
H : T ∈ distinguishedTriangles
⊢ T.mor₁ ≫ T.mor₂ = 0

Next tactic:
obtain ⟨c, hc⟩ :=
    complete_distinguished_triangle_morphism _ _ (contractible_distinguished T.obj₁) H (𝟙 T.obj₁)
      T.mor₁ rfl
/-- Given any distinguished triangle
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
the composition `f ≫ g = 0`.
See <https://stacks.math.columbia.edu/tag/0146>
-/
@[reassoc]
theorem comp_distTriang_mor_zero₁₂ (T) (H : T ∈ (distTriang C)) : T.mor₁ ≫ T.mor₂ = 0 := by
  obtain ⟨c, hc⟩ :=
    complete_distinguished_triangle_morphism _ _ (contractible_distinguished T.obj₁) H (𝟙 T.obj₁)
      T.mor₁ rfl
  

Proof state:
case intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
T : Triangle C
H : T ∈ distinguishedTriangles
c : (contractibleTriangle T.obj₁).obj₃ ⟶ T.obj₃
hc :
  (contractibleTriangle T.obj₁).mor₂ ≫ c = T.mor₁ ≫ T.mor₂ ∧
    (contractibleTriangle T.obj₁).mor₃ ≫ (shiftFunctor C 1).map (𝟙 T.obj₁) = c ≫ T.mor₃
⊢ T.mor₁ ≫ T.mor₂ = 0

Next tactic:
simpa only [contractibleTriangle_mor₂, zero_comp] using hc.left.symm
/-- Given any distinguished triangle
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
the composition `h ≫ f⟦1⟧ = 0`.
See <https://stacks.math.columbia.edu/tag/0146>
-/
@[reassoc]
theorem comp_distTriang_mor_zero₃₁ (T : Triangle C) (H : T ∈ distTriang C) :
    T.mor₃ ≫ T.mor₁⟦1⟧' = 0 := by
  

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
T : Triangle C
H : T ∈ distinguishedTriangles
⊢ T.mor₃ ≫ (shiftFunctor C 1).map T.mor₁ = 0

Next tactic:
have H₂ := rot_of_distTriang T.rotate (rot_of_distTriang T H)
/-- Given any distinguished triangle
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
the composition `h ≫ f⟦1⟧ = 0`.
See <https://stacks.math.columbia.edu/tag/0146>
-/
@[reassoc]
theorem comp_distTriang_mor_zero₃₁ (T : Triangle C) (H : T ∈ distTriang C) :
    T.mor₃ ≫ T.mor₁⟦1⟧' = 0 := by
  have H₂ := rot_of_distTriang T.rotate (rot_of_distTriang T H)
  

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
T : Triangle C
H : T ∈ distinguishedTriangles
H₂ : Triangle.rotate (Triangle.rotate T) ∈ distinguishedTriangles
⊢ T.mor₃ ≫ (shiftFunctor C 1).map T.mor₁ = 0

Next tactic:
simpa using comp_distTriang_mor_zero₁₂ T.rotate.rotate H₂
/-- Any morphism `Y ⟶ Z` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₁ {Y Z : C} (g : Y ⟶ Z) :
    ∃ (X : C) (f : X ⟶ Y) (h : Z ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distTriang C := by
  

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Y Z : C
g : Y ⟶ Z
⊢ ∃ X f h, Triangle.mk f g h ∈ distinguishedTriangles

Next tactic:
obtain ⟨X', f', g', mem⟩ := distinguished_cocone_triangle g
/-- Any morphism `Y ⟶ Z` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₁ {Y Z : C} (g : Y ⟶ Z) :
    ∃ (X : C) (f : X ⟶ Y) (h : Z ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨X', f', g', mem⟩ := distinguished_cocone_triangle g
  

Proof state:
case intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Y Z : C
g : Y ⟶ Z
X' : C
f' : Z ⟶ X'
g' : X' ⟶ (shiftFunctor C 1).obj Y
mem : Triangle.mk g f' g' ∈ distinguishedTriangles
⊢ ∃ X f h, Triangle.mk f g h ∈ distinguishedTriangles

Next tactic:
exact ⟨_, _, _, inv_rot_of_distTriang _ mem⟩
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
⊢ ∃ Y f g, Triangle.mk f g h ∈ distinguishedTriangles

Next tactic:
obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
  

Proof state:
case intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
Y' : C
f' : (shiftFunctor C 1).obj X ⟶ Y'
g' : Y' ⟶ (shiftFunctor C 1).obj Z
mem : Triangle.mk h f' g' ∈ distinguishedTriangles
⊢ ∃ Y f g, Triangle.mk f g h ∈ distinguishedTriangles

Next tactic:
let T' := (Triangle.mk h f' g').invRotate.invRotate
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
  let T' := (Triangle.mk h f' g').invRotate.invRotate
  

Proof state:
case intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
Y' : C
f' : (shiftFunctor C 1).obj X ⟶ Y'
g' : Y' ⟶ (shiftFunctor C 1).obj Z
mem : Triangle.mk h f' g' ∈ distinguishedTriangles
T' : Triangle C := Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))
⊢ ∃ Y f g, Triangle.mk f g h ∈ distinguishedTriangles

Next tactic:
refine' ⟨T'.obj₂, ((shiftEquiv C (1 : ℤ)).unitIso.app X).hom ≫ T'.mor₁, T'.mor₂,
    isomorphic_distinguished _ (inv_rot_of_distTriang _ (inv_rot_of_distTriang _ mem)) _ _⟩
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
  let T' := (Triangle.mk h f' g').invRotate.invRotate
  refine' ⟨T'.obj₂, ((shiftEquiv C (1 : ℤ)).unitIso.app X).hom ≫ T'.mor₁, T'.mor₂,
    isomorphic_distinguished _ (inv_rot_of_distTriang _ (inv_rot_of_distTriang _ mem)) _ _⟩
  

Proof state:
case intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
Y' : C
f' : (shiftFunctor C 1).obj X ⟶ Y'
g' : Y' ⟶ (shiftFunctor C 1).obj Z
mem : Triangle.mk h f' g' ∈ distinguishedTriangles
T' : Triangle C := Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))
⊢ Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h ≅
    Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))

Next tactic:
exact Triangle.isoMk _ _ ((shiftEquiv C (1 : ℤ)).unitIso.app X) (Iso.refl _) (Iso.refl _)
    (by aesop_cat) (by aesop_cat)
    (by dsimp; simp only [shift_shiftFunctorCompIsoId_inv_app, id_comp])
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
  let T' := (Triangle.mk h f' g').invRotate.invRotate
  refine' ⟨T'.obj₂, ((shiftEquiv C (1 : ℤ)).unitIso.app X).hom ≫ T'.mor₁, T'.mor₂,
    isomorphic_distinguished _ (inv_rot_of_distTriang _ (inv_rot_of_distTriang _ mem)) _ _⟩
  exact Triangle.isoMk _ _ ((shiftEquiv C (1 : ℤ)).unitIso.app X) (Iso.refl _) (Iso.refl _)
    (by 

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
Y' : C
f' : (shiftFunctor C 1).obj X ⟶ Y'
g' : Y' ⟶ (shiftFunctor C 1).obj Z
mem : Triangle.mk h f' g' ∈ distinguishedTriangles
T' : Triangle C := Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))
⊢ (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).mor₁ ≫
      (Iso.refl (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).obj₂).hom =
    ((shiftEquiv C 1).unitIso.app X).hom ≫ (Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))).mor₁

Next tactic:
aesop_cat
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
  let T' := (Triangle.mk h f' g').invRotate.invRotate
  refine' ⟨T'.obj₂, ((shiftEquiv C (1 : ℤ)).unitIso.app X).hom ≫ T'.mor₁, T'.mor₂,
    isomorphic_distinguished _ (inv_rot_of_distTriang _ (inv_rot_of_distTriang _ mem)) _ _⟩
  exact Triangle.isoMk _ _ ((shiftEquiv C (1 : ℤ)).unitIso.app X) (Iso.refl _) (Iso.refl _)
    (by aesop_cat) (by 

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
Y' : C
f' : (shiftFunctor C 1).obj X ⟶ Y'
g' : Y' ⟶ (shiftFunctor C 1).obj Z
mem : Triangle.mk h f' g' ∈ distinguishedTriangles
T' : Triangle C := Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))
⊢ (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).mor₂ ≫
      (Iso.refl (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).obj₃).hom =
    (Iso.refl (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).obj₂).hom ≫
      (Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))).mor₂

Next tactic:
aesop_cat
/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C := by
  obtain ⟨Y', f', g', mem⟩ := distinguished_cocone_triangle h
  let T' := (Triangle.mk h f' g').invRotate.invRotate
  refine' ⟨T'.obj₂, ((shiftEquiv C (1 : ℤ)).unitIso.app X).hom ≫ T'.mor₁, T'.mor₂,
    isomorphic_distinguished _ (inv_rot_of_distTriang _ (inv_rot_of_distTriang _ mem)) _ _⟩
  exact Triangle.isoMk _ _ ((shiftEquiv C (1 : ℤ)).unitIso.app X) (Iso.refl _) (Iso.refl _)
    (by aesop_cat) (by aesop_cat)
    (by 

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroObject C
inst✝² : HasShift C ℤ
inst✝¹ : Preadditive C
inst✝ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
Z X : C
h : Z ⟶ (shiftFunctor C 1).obj X
Y' : C
f' : (shiftFunctor C 1).obj X ⟶ Y'
g' : Y' ⟶ (shiftFunctor C 1).obj Z
mem : Triangle.mk h f' g' ∈ distinguishedTriangles
T' : Triangle C := Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))
⊢ (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).mor₃ ≫
      (shiftFunctor C 1).map ((shiftEquiv C 1).unitIso.app X).hom =
    (Iso.refl (Triangle.mk (((shiftEquiv C 1).unitIso.app X).hom ≫ T'.mor₁) T'.mor₂ h).obj₃).hom ≫
      (Triangle.invRotate (Triangle.invRotate (Triangle.mk h f' g'))).mor₃

Next tactic:
dsimp