l3lab/ntp-mathlib huggingface dataset:
theorem disjSups_comm : s ○ t = t ○ s := by
  ext
  rw [mem_disjSups, mem_disjSups]
  -- Porting note: `exists₂_comm` no longer works with `∃ _ ∈ _, ∃ _ ∈ _, _`
  constructor <;>
  · 

Proof state:
case a.mpr
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : SemilatticeSup α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s s₁ s₂ t t₁ t₂ u : Finset α
a b c a✝ : α
⊢ (∃ a ∈ t, ∃ b ∈ s, Disjoint a b ∧ a ⊔ b = a✝) → ∃ a ∈ s, ∃ b ∈ t, Disjoint a b ∧ a ⊔ b = a✝

Next tactic:
rintro ⟨a, ha, b, hb, hd, hs⟩
theorem disjSups_comm : s ○ t = t ○ s := by
  ext
  rw [mem_disjSups, mem_disjSups]
  -- Porting note: `exists₂_comm` no longer works with `∃ _ ∈ _, ∃ _ ∈ _, _`
  constructor <;>
  · rintro ⟨a, ha, b, hb, hd, hs⟩
    

Proof state:
case a.mpr.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : SemilatticeSup α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s s₁ s₂ t t₁ t₂ u : Finset α
a✝¹ b✝ c a✝ a : α
ha : a ∈ t
b : α
hb : b ∈ s
hd : Disjoint a b
hs : a ⊔ b = a✝
⊢ ∃ a ∈ s, ∃ b ∈ t, Disjoint a b ∧ a ⊔ b = a✝

Next tactic:
rw [disjoint_comm] at hd
theorem disjSups_comm : s ○ t = t ○ s := by
  ext
  rw [mem_disjSups, mem_disjSups]
  -- Porting note: `exists₂_comm` no longer works with `∃ _ ∈ _, ∃ _ ∈ _, _`
  constructor <;>
  · rintro ⟨a, ha, b, hb, hd, hs⟩
    rw [disjoint_comm] at hd
    

Proof state:
case a.mpr.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : SemilatticeSup α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s s₁ s₂ t t₁ t₂ u : Finset α
a✝¹ b✝ c a✝ a : α
ha : a ∈ t
b : α
hb : b ∈ s
hd : Disjoint b a
hs : a ⊔ b = a✝
⊢ ∃ a ∈ s, ∃ b ∈ t, Disjoint a b ∧ a ⊔ b = a✝

Next tactic:
rw [sup_comm] at hs
theorem disjSups_comm : s ○ t = t ○ s := by
  ext
  rw [mem_disjSups, mem_disjSups]
  -- Porting note: `exists₂_comm` no longer works with `∃ _ ∈ _, ∃ _ ∈ _, _`
  constructor <;>
  · rintro ⟨a, ha, b, hb, hd, hs⟩
    rw [disjoint_comm] at hd
    rw [sup_comm] at hs
    

Proof state:
case a.mpr.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : SemilatticeSup α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s s₁ s₂ t t₁ t₂ u : Finset α
a✝¹ b✝ c a✝ a : α
ha : a ∈ t
b : α
hb : b ∈ s
hd : Disjoint b a
hs : b ⊔ a = a✝
⊢ ∃ a ∈ s, ∃ b ∈ t, Disjoint a b ∧ a ⊔ b = a✝

Next tactic:
exact ⟨b, hb, a, ha, hd, hs⟩
theorem disjSups_assoc : ∀ s t u : Finset α, s ○ t ○ u = s ○ (t ○ u) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s t u v : Finset α
⊢ ∀ (s t u : Finset α), s ○ t ○ u = s ○ (t ○ u)

Next tactic:
refine' associative_of_commutative_of_le disjSups_comm _
theorem disjSups_assoc : ∀ s t u : Finset α, s ○ t ○ u = s ○ (t ○ u) := by
  refine' associative_of_commutative_of_le disjSups_comm _
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s t u v : Finset α
⊢ ∀ (a b c : Finset α), a ○ b ○ c ≤ a ○ (b ○ c)

Next tactic:
simp only [le_eq_subset, disjSups_subset_iff, mem_disjSups]
theorem disjSups_assoc : ∀ s t u : Finset α, s ○ t ○ u = s ○ (t ○ u) := by
  refine' associative_of_commutative_of_le disjSups_comm _
  simp only [le_eq_subset, disjSups_subset_iff, mem_disjSups]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s t u v : Finset α
⊢ ∀ (a b c : Finset α) (a_1 : α),
    (∃ a_2 ∈ a, ∃ b_1 ∈ b, Disjoint a_2 b_1 ∧ a_2 ⊔ b_1 = a_1) →
      ∀ b_1 ∈ c,
        Disjoint a_1 b_1 →
          ∃ a_5 ∈ a, ∃ b_2, (∃ a ∈ b, ∃ b ∈ c, Disjoint a b ∧ a ⊔ b = b_2) ∧ Disjoint a_5 b_2 ∧ a_5 ⊔ b_2 = a_1 ⊔ b_1

Next tactic:
rintro s t u _ ⟨a, ha, b, hb, hab, rfl⟩ c hc habc
theorem disjSups_assoc : ∀ s t u : Finset α, s ○ t ○ u = s ○ (t ○ u) := by
  refine' associative_of_commutative_of_le disjSups_comm _
  simp only [le_eq_subset, disjSups_subset_iff, mem_disjSups]
  rintro s t u _ ⟨a, ha, b, hb, hab, rfl⟩ c hc habc
  

Proof state:
case intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s✝ t✝ u✝ v s t u : Finset α
a : α
ha : a ∈ s
b : α
hb : b ∈ t
hab : Disjoint a b
c : α
hc : c ∈ u
habc : Disjoint (a ⊔ b) c
⊢ ∃ a_1 ∈ s, ∃ b_1, (∃ a ∈ t, ∃ b ∈ u, Disjoint a b ∧ a ⊔ b = b_1) ∧ Disjoint a_1 b_1 ∧ a_1 ⊔ b_1 = a ⊔ b ⊔ c

Next tactic:
rw [disjoint_sup_left] at habc
theorem disjSups_assoc : ∀ s t u : Finset α, s ○ t ○ u = s ○ (t ○ u) := by
  refine' associative_of_commutative_of_le disjSups_comm _
  simp only [le_eq_subset, disjSups_subset_iff, mem_disjSups]
  rintro s t u _ ⟨a, ha, b, hb, hab, rfl⟩ c hc habc
  rw [disjoint_sup_left] at habc
  

Proof state:
case intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s✝ t✝ u✝ v s t u : Finset α
a : α
ha : a ∈ s
b : α
hb : b ∈ t
hab : Disjoint a b
c : α
hc : c ∈ u
habc : Disjoint a c ∧ Disjoint b c
⊢ ∃ a_1 ∈ s, ∃ b_1, (∃ a ∈ t, ∃ b ∈ u, Disjoint a b ∧ a ⊔ b = b_1) ∧ Disjoint a_1 b_1 ∧ a_1 ⊔ b_1 = a ⊔ b ⊔ c

Next tactic:
exact ⟨a, ha, _, ⟨b, hb, c, hc, habc.2, rfl⟩, hab.sup_right habc.1, sup_assoc.symm⟩
theorem disjSups_left_comm : s ○ (t ○ u) = t ○ (s ○ u) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s t u v : Finset α
⊢ s ○ (t ○ u) = t ○ (s ○ u)

Next tactic:
simp_rw [← disjSups_assoc, disjSups_comm s]
theorem disjSups_right_comm : s ○ t ○ u = s ○ u ○ t := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s t u v : Finset α
⊢ s ○ t ○ u = s ○ u ○ t

Next tactic:
simp_rw [disjSups_assoc, disjSups_comm]
theorem disjSups_disjSups_disjSups_comm : s ○ t ○ (u ○ v) = s ○ u ○ (t ○ v) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : DecidableEq α
inst✝³ : DecidableEq β
inst✝² : DistribLattice α
inst✝¹ : OrderBot α
inst✝ : DecidableRel Disjoint
s t u v : Finset α
⊢ s ○ t ○ (u ○ v) = s ○ u ○ (t ○ v)

Next tactic:
simp_rw [← disjSups_assoc, disjSups_right_comm]
@[simp] lemma mem_diffs : c ∈ s \\ t ↔ ∃ a ∈ s, ∃ b ∈ t, a \ b = c := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : GeneralizedBooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
⊢ c ∈ s \\ t ↔ ∃ a ∈ s, ∃ b ∈ t, a \ b = c

Next tactic:
simp [(· \\ ·)]
@[simp] lemma mem_compls : a ∈ sᶜˢ ↔ aᶜ ∈ s := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
⊢ a ∈ sᶜˢ ↔ aᶜ ∈ s

Next tactic:
rw [Iff.comm, ← mem_map' ⟨compl, compl_injective⟩, Embedding.coeFn_mk, compl_compl, compls]
@[simp] lemma image_compl : s.image compl = sᶜˢ := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
⊢ image compl s = sᶜˢ

Next tactic:
simp [compls, map_eq_image]
lemma exists_compls_iff {p : α → Prop} : (∃ a ∈ sᶜˢ, p a) ↔ ∃ a ∈ s, p aᶜ := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
p : α → Prop
⊢ (∃ a ∈ sᶜˢ, p a) ↔ ∃ a ∈ s, p aᶜ

Next tactic:
aesop
@[simp] lemma compls_compls (s : Finset α) : sᶜˢᶜˢ = s := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
s : Finset α
⊢ sᶜˢᶜˢ = s

Next tactic:
ext
@[simp] lemma compls_compls (s : Finset α) : sᶜˢᶜˢ = s := by ext; 

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
s : Finset α
a✝ : α
⊢ a✝ ∈ sᶜˢᶜˢ ↔ a✝ ∈ s

Next tactic:
simp
lemma compls_subset_iff : sᶜˢ ⊆ t ↔ s ⊆ tᶜˢ := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
⊢ sᶜˢ ⊆ t ↔ s ⊆ tᶜˢ

Next tactic:
rw [← compls_subset_compls, compls_compls]
@[simp] lemma compls_univ [Fintype α] : (univ : Finset α)ᶜˢ = univ := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
inst✝ : Fintype α
⊢ univᶜˢ = univ

Next tactic:
ext
@[simp] lemma compls_univ [Fintype α] : (univ : Finset α)ᶜˢ = univ := by ext; 

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
inst✝ : Fintype α
a✝ : α
⊢ a✝ ∈ univᶜˢ ↔ a✝ ∈ univ

Next tactic:
simp
@[simp] lemma compls_infs (s t : Finset α) : (s ⊼ t)ᶜˢ = sᶜˢ ⊻ tᶜˢ := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ (s ⊼ t)ᶜˢ = sᶜˢ ⊻ tᶜˢ

Next tactic:
simp_rw [← image_compl]
@[simp] lemma compls_infs (s t : Finset α) : (s ⊼ t)ᶜˢ = sᶜˢ ⊻ tᶜˢ := by
  simp_rw [← image_compl]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ image compl (s ⊼ t) = image compl s ⊻ image compl t

Next tactic:
exact image_image₂_distrib λ _ _ ↦ compl_inf
@[simp] lemma compls_sups (s t : Finset α) : (s ⊻ t)ᶜˢ = sᶜˢ ⊼ tᶜˢ := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ (s ⊻ t)ᶜˢ = sᶜˢ ⊼ tᶜˢ

Next tactic:
simp_rw [← image_compl]
@[simp] lemma compls_sups (s t : Finset α) : (s ⊻ t)ᶜˢ = sᶜˢ ⊼ tᶜˢ := by
  simp_rw [← image_compl]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ image compl (s ⊻ t) = image compl s ⊼ image compl t

Next tactic:
exact image_image₂_distrib λ _ _ ↦ compl_sup
@[simp] lemma infs_compls_eq_diffs (s t : Finset α) : s ⊼ tᶜˢ = s \\ t := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ s ⊼ tᶜˢ = s \\ t

Next tactic:
ext
@[simp] lemma infs_compls_eq_diffs (s t : Finset α) : s ⊼ tᶜˢ = s \\ t := by
  ext; 

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
a✝ : α
⊢ a✝ ∈ s ⊼ tᶜˢ ↔ a✝ ∈ s \\ t

Next tactic:
simp [sdiff_eq]
@[simp] lemma infs_compls_eq_diffs (s t : Finset α) : s ⊼ tᶜˢ = s \\ t := by
  ext; simp [sdiff_eq]; 

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
a✝ : α
⊢ (∃ a ∈ s, ∃ b, bᶜ ∈ t ∧ a ⊓ b = a✝) ↔ ∃ a ∈ s, ∃ b ∈ t, a ⊓ bᶜ = a✝

Next tactic:
aesop
@[simp] lemma compls_infs_eq_diffs (s t : Finset α) : sᶜˢ ⊼ t = t \\ s := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ sᶜˢ ⊼ t = t \\ s

Next tactic:
rw [infs_comm, infs_compls_eq_diffs]
@[simp] lemma diffs_compls_eq_infs (s t : Finset α) : s \\ tᶜˢ = s ⊼ t := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : DecidableEq α
inst✝¹ : DecidableEq β
inst✝ : BooleanAlgebra α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b c : α
s t : Finset α
⊢ s \\ tᶜˢ = s ⊼ t

Next tactic:
rw [← infs_compls_eq_diffs, compls_compls]
protected lemma _root_.Set.Sized.compls (h𝒜 : (𝒜 : Set (Finset α)).Sized n) :
    (𝒜ᶜˢ : Set (Finset α)).Sized (Fintype.card α - n) :=
  Finset.forall_mem_compls.2 $ λ s hs ↦ by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : BooleanAlgebra α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
inst✝ : Fintype α
𝒜 : Finset (Finset α)
n : ℕ
h𝒜 : Set.Sized n ↑𝒜
s : Finset α
hs : s ∈ 𝒜
⊢ card sᶜ = Fintype.card α - n

Next tactic:
rw [Finset.card_compl, h𝒜 hs]
lemma sized_compls (hn : n ≤ Fintype.card α) :
    (𝒜ᶜˢ : Set (Finset α)).Sized n ↔ (𝒜 : Set (Finset α)).Sized (Fintype.card α - n) where
  mp h𝒜 := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
inst✝ : Fintype α
𝒜 : Finset (Finset α)
n : ℕ
hn : n ≤ Fintype.card α
h𝒜 : Set.Sized n ↑𝒜ᶜˢ
⊢ Set.Sized (Fintype.card α - n) ↑𝒜

Next tactic:
simpa using h𝒜.compls
lemma sized_compls (hn : n ≤ Fintype.card α) :
    (𝒜ᶜˢ : Set (Finset α)).Sized n ↔ (𝒜 : Set (Finset α)).Sized (Fintype.card α - n) where
  mp h𝒜 := by simpa using h𝒜.compls
  mpr h𝒜 := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq β
inst✝¹ : BooleanAlgebra α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b c : α
inst✝ : Fintype α
𝒜 : Finset (Finset α)
n : ℕ
hn : n ≤ Fintype.card α
h𝒜 : Set.Sized (Fintype.card α - n) ↑𝒜
⊢ Set.Sized n ↑𝒜ᶜˢ

Next tactic:
simpa only [tsub_tsub_cancel_of_le hn] using h𝒜.compls
/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D where
  obj T := Triangle.mk (F.map T.mor₁) (F.map T.mor₂)
    (F.map T.mor₃ ≫ (F.commShiftIso (1 : ℤ)).hom.app T.obj₁)
  map f :=
    { hom₁ := F.map f.hom₁
      hom₂ := F.map f.hom₂
      hom₃ := F.map f.hom₃
      comm₁ := by 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.165, u_1} C
inst✝³ : Category.{?u.169, u_2} D
inst✝² : HasShift C ℤ
inst✝¹ : HasShift D ℤ
F : C ⥤ D
inst✝ : CommShift F ℤ
X✝ Y✝ : Triangle C
f : X✝ ⟶ Y✝
⊢ ((fun T => Triangle.mk (F.map T.mor₁) (F.map T.mor₂) (F.map T.mor₃ ≫ (commShiftIso F 1).hom.app T.obj₁)) X✝).mor₁ ≫
      F.map f.hom₂ =
    F.map f.hom₁ ≫
      ((fun T => Triangle.mk (F.map T.mor₁) (F.map T.mor₂) (F.map T.mor₃ ≫ (commShiftIso F 1).hom.app T.obj₁)) Y✝).mor₁

Next tactic:
dsimp
/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D where
  obj T := Triangle.mk (F.map T.mor₁) (F.map T.mor₂)
    (F.map T.mor₃ ≫ (F.commShiftIso (1 : ℤ)).hom.app T.obj₁)
  map f :=
    { hom₁ := F.map f.hom₁
      hom₂ := F.map f.hom₂
      hom₃ := F.map f.hom₃
      comm₁ := by dsimp; 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.165, u_1} C
inst✝³ : Category.{?u.169, u_2} D
inst✝² : HasShift C ℤ
inst✝¹ : HasShift D ℤ
F : C ⥤ D
inst✝ : CommShift F ℤ
X✝ Y✝ : Triangle C
f : X✝ ⟶ Y✝
⊢ F.map X✝.mor₁ ≫ F.map f.hom₂ = F.map f.hom₁ ≫ F.map Y✝.mor₁

Next tactic:
simp only [← F.map_comp, f.comm₁]
/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D where
  obj T := Triangle.mk (F.map T.mor₁) (F.map T.mor₂)
    (F.map T.mor₃ ≫ (F.commShiftIso (1 : ℤ)).hom.app T.obj₁)
  map f :=
    { hom₁ := F.map f.hom₁
      hom₂ := F.map f.hom₂
      hom₃ := F.map f.hom₃
      comm₁ := by dsimp; simp only [← F.map_comp, f.comm₁]
      comm₂ := by 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.165, u_1} C
inst✝³ : Category.{?u.169, u_2} D
inst✝² : HasShift C ℤ
inst✝¹ : HasShift D ℤ
F : C ⥤ D
inst✝ : CommShift F ℤ
X✝ Y✝ : Triangle C
f : X✝ ⟶ Y✝
⊢ ((fun T => Triangle.mk (F.map T.mor₁) (F.map T.mor₂) (F.map T.mor₃ ≫ (commShiftIso F 1).hom.app T.obj₁)) X✝).mor₂ ≫
      F.map f.hom₃ =
    F.map f.hom₂ ≫
      ((fun T => Triangle.mk (F.map T.mor₁) (F.map T.mor₂) (F.map T.mor₃ ≫ (commShiftIso F 1).hom.app T.obj₁)) Y✝).mor₂

Next tactic:
dsimp
/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D where
  obj T := Triangle.mk (F.map T.mor₁) (F.map T.mor₂)
    (F.map T.mor₃ ≫ (F.commShiftIso (1 : ℤ)).hom.app T.obj₁)
  map f :=
    { hom₁ := F.map f.hom₁
      hom₂ := F.map f.hom₂
      hom₃ := F.map f.hom₃
      comm₁ := by dsimp; simp only [← F.map_comp, f.comm₁]
      comm₂ := by dsimp; 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.165, u_1} C
inst✝³ : Category.{?u.169, u_2} D
inst✝² : HasShift C ℤ
inst✝¹ : HasShift D ℤ
F : C ⥤ D
inst✝ : CommShift F ℤ
X✝ Y✝ : Triangle C
f : X✝ ⟶ Y✝
⊢ F.map X✝.mor₂ ≫ F.map f.hom₃ = F.map f.hom₂ ≫ F.map Y✝.mor₂

Next tactic:
simp only [← F.map_comp, f.comm₂]
/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D where
  obj T := Triangle.mk (F.map T.mor₁) (F.map T.mor₂)
    (F.map T.mor₃ ≫ (F.commShiftIso (1 : ℤ)).hom.app T.obj₁)
  map f :=
    { hom₁ := F.map f.hom₁
      hom₂ := F.map f.hom₂
      hom₃ := F.map f.hom₃
      comm₁ := by dsimp; simp only [← F.map_comp, f.comm₁]
      comm₂ := by dsimp; simp only [← F.map_comp, f.comm₂]
      comm₃ := by
        

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.165, u_1} C
inst✝³ : Category.{?u.169, u_2} D
inst✝² : HasShift C ℤ
inst✝¹ : HasShift D ℤ
F : C ⥤ D
inst✝ : CommShift F ℤ
X✝ Y✝ : Triangle C
f : X✝ ⟶ Y✝
⊢ ((fun T => Triangle.mk (F.map T.mor₁) (F.map T.mor₂) (F.map T.mor₃ ≫ (commShiftIso F 1).hom.app T.obj₁)) X✝).mor₃ ≫
      (shiftFunctor D 1).map (F.map f.hom₁) =
    F.map f.hom₃ ≫
      ((fun T => Triangle.mk (F.map T.mor₁) (F.map T.mor₂) (F.map T.mor₃ ≫ (commShiftIso F 1).hom.app T.obj₁)) Y✝).mor₃

Next tactic:
dsimp [Functor.comp]
/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D where
  obj T := Triangle.mk (F.map T.mor₁) (F.map T.mor₂)
    (F.map T.mor₃ ≫ (F.commShiftIso (1 : ℤ)).hom.app T.obj₁)
  map f :=
    { hom₁ := F.map f.hom₁
      hom₂ := F.map f.hom₂
      hom₃ := F.map f.hom₃
      comm₁ := by dsimp; simp only [← F.map_comp, f.comm₁]
      comm₂ := by dsimp; simp only [← F.map_comp, f.comm₂]
      comm₃ := by
        dsimp [Functor.comp]
        

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.165, u_1} C
inst✝³ : Category.{?u.169, u_2} D
inst✝² : HasShift C ℤ
inst✝¹ : HasShift D ℤ
F : C ⥤ D
inst✝ : CommShift F ℤ
X✝ Y✝ : Triangle C
f : X✝ ⟶ Y✝
⊢ (F.map X✝.mor₃ ≫ (commShiftIso F 1).hom.app X✝.obj₁) ≫ (shiftFunctor D 1).map (F.map f.hom₁) =
    F.map f.hom₃ ≫ F.map Y✝.mor₃ ≫ (commShiftIso F 1).hom.app Y✝.obj₁

Next tactic:
simp only [Category.assoc, ← NatTrans.naturality,
          ← F.map_comp_assoc, f.comm₃]
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    

Proof state:
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ f = g

Next tactic:
ext
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    ext <;> 

Proof state:
case h₁
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ f.hom₁ = g.hom₁

Next tactic:
apply F.map_injective
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    ext <;> 

Proof state:
case h₂
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ f.hom₂ = g.hom₂

Next tactic:
apply F.map_injective
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    ext <;> 

Proof state:
case h₃
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ f.hom₃ = g.hom₃

Next tactic:
apply F.map_injective
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    ext <;> apply F.map_injective
    · 

Proof state:
case h₁.a
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ F.map f.hom₁ = F.map g.hom₁

Next tactic:
exact congr_arg TriangleMorphism.hom₁ h
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    ext <;> apply F.map_injective
    · exact congr_arg TriangleMorphism.hom₁ h
    · 

Proof state:
case h₂.a
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ F.map f.hom₂ = F.map g.hom₂

Next tactic:
exact congr_arg TriangleMorphism.hom₂ h
instance [Faithful F] : Faithful F.mapTriangle where
  map_injective {X Y} f g h := by
    ext <;> apply F.map_injective
    · exact congr_arg TriangleMorphism.hom₁ h
    · exact congr_arg TriangleMorphism.hom₂ h
    · 

Proof state:
case h₃.a
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.9029, u_1} C
inst✝⁴ : Category.{?u.9033, u_2} D
inst✝³ : HasShift C ℤ
inst✝² : HasShift D ℤ
F : C ⥤ D
inst✝¹ : CommShift F ℤ
inst✝ : Faithful F
X Y : Triangle C
f g : X ⟶ Y
h : (mapTriangle F).map f = (mapTriangle F).map g
⊢ F.map f.hom₃ = F.map g.hom₃

Next tactic:
exact congr_arg TriangleMorphism.hom₃ h
instance [Full F] [Faithful F] : Full F.mapTriangle where
  preimage {X Y} f :=
    { hom₁ := F.preimage f.hom₁
      hom₂ := F.preimage f.hom₂
      hom₃ := F.preimage f.hom₃
      comm₁ := F.map_injective
        (by 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{?u.11156, u_1} C
inst✝⁵ : Category.{?u.11160, u_2} D
inst✝⁴ : HasShift C ℤ
inst✝³ : HasShift D ℤ
F : C ⥤ D
inst✝² : CommShift F ℤ
inst✝¹ : Full F
inst✝ : Faithful F
X Y : Triangle C
f : (mapTriangle F).obj X ⟶ (mapTriangle F).obj Y
⊢ F.map (X.mor₁ ≫ F.preimage f.hom₂) = F.map (F.preimage f.hom₁ ≫ Y.mor₁)

Next tactic:
simpa only [mapTriangle_obj, map_comp, image_preimage] using f.comm₁