l3lab/ntp-mathlib huggingface dataset:
/-- Flip a complex of complexes over the diagonal,
exchanging the horizontal and vertical directions.
-/
@[simps]
def flipObj (C : HomologicalComplex (HomologicalComplex V c) c') :
    HomologicalComplex (HomologicalComplex V c') c where
  X i :=
    { X := fun j => (C.X j).X i
      d := fun j j' => (C.d j j').f i
      shape := fun j j' w => by
        simp_all only [not_false_eq_true, shape, zero_f]
      d_comp_d' := fun j₁ j₂ j₃ _ _ => congr_hom (C.d_comp_d j₁ j₂ j₃) i }
  d i i' :=
    { f := fun j => (C.X j).d i i'
      comm' := fun j j' _ => ((C.d j j').comm i i').symm }
  shape i i' w := by
    

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i i' : ι
w : ¬ComplexShape.Rel c i i'
⊢ (fun i i' => Hom.mk fun j => d (X C j) i i') i i' = 0

Next tactic:
ext j
/-- Flip a complex of complexes over the diagonal,
exchanging the horizontal and vertical directions.
-/
@[simps]
def flipObj (C : HomologicalComplex (HomologicalComplex V c) c') :
    HomologicalComplex (HomologicalComplex V c') c where
  X i :=
    { X := fun j => (C.X j).X i
      d := fun j j' => (C.d j j').f i
      shape := fun j j' w => by
        simp_all only [not_false_eq_true, shape, zero_f]
      d_comp_d' := fun j₁ j₂ j₃ _ _ => congr_hom (C.d_comp_d j₁ j₂ j₃) i }
  d i i' :=
    { f := fun j => (C.X j).d i i'
      comm' := fun j j' _ => ((C.d j j').comm i i').symm }
  shape i i' w := by
    ext j
    

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i i' : ι
w : ¬ComplexShape.Rel c i i'
j : ι'
⊢ Hom.f ((fun i i' => Hom.mk fun j => d (X C j) i i') i i') j = Hom.f 0 j

Next tactic:
exact (C.X j).shape i i' w
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i j : ι'
x✝ : ComplexShape.Rel c' i j
⊢ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫ d ((flip V c c' ⋙ flip V c' c).obj C) i j =
    d ((𝟭 (HomologicalComplex (HomologicalComplex V c) c')).obj C) i j ≫ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j

Next tactic:
ext
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i j : ι'
x✝ : ComplexShape.Rel c' i j
i✝ : ι
⊢ Hom.f ((fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫ d ((flip V c c' ⋙ flip V c' c).obj C) i j) i✝ =
    Hom.f
      (d ((𝟭 (HomologicalComplex (HomologicalComplex V c) c')).obj C) i j ≫
        (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j)
      i✝

Next tactic:
dsimp
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i j : ι'
x✝ : ComplexShape.Rel c' i j
i✝ : ι
⊢ 𝟙 (X (X C i) i✝) ≫ Hom.f (d C i j) i✝ = Hom.f (d C i j) i✝ ≫ 𝟙 (X (X C j) i✝)

Next tactic:
simp only [Category.id_comp, Category.comp_id]
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i j : ι'
x✝ : ComplexShape.Rel c' i j
⊢ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫ d ((𝟭 (HomologicalComplex (HomologicalComplex V c) c')).obj C) i j =
    d ((flip V c c' ⋙ flip V c' c).obj C) i j ≫ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j

Next tactic:
ext
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i j : ι'
x✝ : ComplexShape.Rel c' i j
i✝ : ι
⊢ Hom.f
      ((fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫
        d ((𝟭 (HomologicalComplex (HomologicalComplex V c) c')).obj C) i j)
      i✝ =
    Hom.f (d ((flip V c c' ⋙ flip V c' c).obj C) i j ≫ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j) i✝

Next tactic:
dsimp
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c) c'
i j : ι'
x✝ : ComplexShape.Rel c' i j
i✝ : ι
⊢ 𝟙 (X (X C i) i✝) ≫ Hom.f (d C i j) i✝ = Hom.f (d C i j) i✝ ≫ 𝟙 (X (X C j) i✝)

Next tactic:
simp only [Category.id_comp, Category.comp_id]
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] } })
    fun {X Y} f => by
      

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
X Y : HomologicalComplex (HomologicalComplex V c) c'
f : X ⟶ Y
⊢ (𝟭 (HomologicalComplex (HomologicalComplex V c) c')).map f ≫
      ((fun C =>
            Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
              (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
          Y).hom =
    ((fun C =>
            Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
              (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
          X).hom ≫
      (flip V c c' ⋙ flip V c' c).map f

Next tactic:
ext
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] } })
    fun {X Y} f => by
      ext
      

Proof state:
case h.h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
X Y : HomologicalComplex (HomologicalComplex V c) c'
f : X ⟶ Y
i✝¹ : ι'
i✝ : ι
⊢ Hom.f
      (Hom.f
        ((𝟭 (HomologicalComplex (HomologicalComplex V c) c')).map f ≫
          ((fun C =>
                Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
                  (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
              Y).hom)
        i✝¹)
      i✝ =
    Hom.f
      (Hom.f
        (((fun C =>
                Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
                  (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
              X).hom ≫
          (flip V c c' ⋙ flip V c' c).map f)
        i✝¹)
      i✝

Next tactic:
dsimp
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceUnitIso :
    𝟭 (HomologicalComplex (HomologicalComplex V c) c') ≅ flip V c c' ⋙ flip V c' c :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] } })
    fun {X Y} f => by
      ext
      dsimp
      

Proof state:
case h.h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
X Y : HomologicalComplex (HomologicalComplex V c) c'
f : X ⟶ Y
i✝¹ : ι'
i✝ : ι
⊢ Hom.f (Hom.f f i✝¹) i✝ ≫ 𝟙 (HomologicalComplex.X (HomologicalComplex.X Y i✝¹) i✝) =
    𝟙 (HomologicalComplex.X (HomologicalComplex.X X i✝¹) i✝) ≫ Hom.f (Hom.f f i✝¹) i✝

Next tactic:
simp only [Category.id_comp, Category.comp_id]
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c') c
i j : ι
x✝ : ComplexShape.Rel c i j
⊢ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫ d ((𝟭 (HomologicalComplex (HomologicalComplex V c') c)).obj C) i j =
    d ((flip V c' c ⋙ flip V c c').obj C) i j ≫ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j

Next tactic:
ext
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c') c
i j : ι
x✝ : ComplexShape.Rel c i j
i✝ : ι'
⊢ Hom.f
      ((fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫
        d ((𝟭 (HomologicalComplex (HomologicalComplex V c') c)).obj C) i j)
      i✝ =
    Hom.f (d ((flip V c' c ⋙ flip V c c').obj C) i j ≫ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j) i✝

Next tactic:
dsimp
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c') c
i j : ι
x✝ : ComplexShape.Rel c i j
i✝ : ι'
⊢ 𝟙 (X (X C i) i✝) ≫ Hom.f (d C i j) i✝ = Hom.f (d C i j) i✝ ≫ 𝟙 (X (X C j) i✝)

Next tactic:
simp only [Category.id_comp, Category.comp_id]
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c') c
i j : ι
x✝ : ComplexShape.Rel c i j
⊢ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫ d ((flip V c' c ⋙ flip V c c').obj C) i j =
    d ((𝟭 (HomologicalComplex (HomologicalComplex V c') c)).obj C) i j ≫ (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j

Next tactic:
ext
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c') c
i j : ι
x✝ : ComplexShape.Rel c i j
i✝ : ι'
⊢ Hom.f ((fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) i ≫ d ((flip V c' c ⋙ flip V c c').obj C) i j) i✝ =
    Hom.f
      (d ((𝟭 (HomologicalComplex (HomologicalComplex V c') c)).obj C) i j ≫
        (fun i => Hom.mk fun j => 𝟙 (X (X C i) j)) j)
      i✝

Next tactic:
dsimp
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
C : HomologicalComplex (HomologicalComplex V c') c
i j : ι
x✝ : ComplexShape.Rel c i j
i✝ : ι'
⊢ 𝟙 (X (X C i) i✝) ≫ Hom.f (d C i j) i✝ = Hom.f (d C i j) i✝ ≫ 𝟙 (X (X C j) i✝)

Next tactic:
simp only [Category.id_comp, Category.comp_id]
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] } })
    fun {X Y} f => by
      

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
X Y : HomologicalComplex (HomologicalComplex V c') c
f : X ⟶ Y
⊢ (flip V c' c ⋙ flip V c c').map f ≫
      ((fun C =>
            Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
              (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
          Y).hom =
    ((fun C =>
            Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
              (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
          X).hom ≫
      (𝟭 (HomologicalComplex (HomologicalComplex V c') c)).map f

Next tactic:
ext
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] } })
    fun {X Y} f => by
      ext
      

Proof state:
case h.h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
X Y : HomologicalComplex (HomologicalComplex V c') c
f : X ⟶ Y
i✝¹ : ι
i✝ : ι'
⊢ Hom.f
      (Hom.f
        ((flip V c' c ⋙ flip V c c').map f ≫
          ((fun C =>
                Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
                  (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
              Y).hom)
        i✝¹)
      i✝ =
    Hom.f
      (Hom.f
        (((fun C =>
                Iso.mk (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j))
                  (Hom.mk fun i => Hom.mk fun j => 𝟙 (HomologicalComplex.X (HomologicalComplex.X C i) j)))
              X).hom ≫
          (𝟭 (HomologicalComplex (HomologicalComplex V c') c)).map f)
        i✝¹)
      i✝

Next tactic:
dsimp
/-- Auxiliary definition for `HomologicalComplex.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flip V c' c ⋙ flip V c c' ≅ 𝟭 (HomologicalComplex (HomologicalComplex V c') c) :=
  NatIso.ofComponents
    (fun C =>
      { hom :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] }
        inv :=
          { f := fun i => { f := fun j => 𝟙 ((C.X i).X j) }
            comm' := fun i j _ => by
              ext
              dsimp
              simp only [Category.id_comp, Category.comp_id] } })
    fun {X Y} f => by
      ext
      dsimp
      

Proof state:
case h.h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
ι : Type u_1
c : ComplexShape ι
ι' : Type u_2
c' : ComplexShape ι'
X Y : HomologicalComplex (HomologicalComplex V c') c
f : X ⟶ Y
i✝¹ : ι
i✝ : ι'
⊢ Hom.f (Hom.f f i✝¹) i✝ ≫ 𝟙 (HomologicalComplex.X (HomologicalComplex.X Y i✝¹) i✝) =
    𝟙 (HomologicalComplex.X (HomologicalComplex.X X i✝¹) i✝) ≫ Hom.f (Hom.f f i✝¹) i✝

Next tactic:
simp only [Category.id_comp, Category.comp_id]
noncomputable def quotientSpanXSubCAlgEquivAux2 (x : R) :
    (R[X] ⧸ (RingHom.ker (aeval x).toRingHom : Ideal R[X])) ≃ₐ[R] R :=
  let e := RingHom.quotientKerEquivOfRightInverse (fun x => by
    

Proof state:
R : Type u_1
inst✝ : CommRing R
x✝ x : R
⊢ (aeval x✝) ((fun a => C a) x) = x

Next tactic:
exact eval_C
/-- For a commutative ring $R$, evaluating a polynomial at an element $y \in R$ induces an
isomorphism of $R$-algebras $R[X] / \langle x, X - y \rangle \cong R / \langle x \rangle$. -/
noncomputable def quotientSpanCXSubCAlgEquiv (x y : R) :
    (R[X] ⧸ (Ideal.span {C x, X - C y} : Ideal R[X])) ≃ₐ[R] R ⧸ (Ideal.span {x} : Ideal R) :=
  (Ideal.quotientEquivAlgOfEq R <| by 

Proof state:
R : Type u_1
inst✝ : CommRing R
x y : R
⊢ Ideal.span {C x, X - C y} = Ideal.span {X - C y} ⊔ ?m.227729 x y

Next tactic:
rw [Ideal.span_insert, sup_comm]
/-- For a commutative ring $R$, evaluating a polynomial at an element $y \in R$ induces an
isomorphism of $R$-algebras $R[X] / \langle x, X - y \rangle \cong R / \langle x \rangle$. -/
noncomputable def quotientSpanCXSubCAlgEquiv (x y : R) :
    (R[X] ⧸ (Ideal.span {C x, X - C y} : Ideal R[X])) ≃ₐ[R] R ⧸ (Ideal.span {x} : Ideal R) :=
  (Ideal.quotientEquivAlgOfEq R <| by rw [Ideal.span_insert, sup_comm]).trans <|
    (DoubleQuot.quotQuotEquivQuotSupₐ R _ _).symm.trans <|
      (Ideal.quotientEquivAlg _ _ (quotientSpanXSubCAlgEquiv y) rfl).trans <|
        Ideal.quotientEquivAlgOfEq R <| by
          

Proof state:
R : Type u_1
inst✝ : CommRing R
x y : R
⊢ Ideal.map (↑(quotientSpanXSubCAlgEquiv y))
      (Ideal.map (Ideal.Quotient.mkₐ R (Ideal.span {X - C y})) (Ideal.span {C x})) =
    Ideal.span {x}

Next tactic:
simp only [Ideal.map_span, Set.image_singleton]