l3lab/ntp-mathlib huggingface dataset:
lemma quasiIsoAt_of_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] [hφφ' : QuasiIsoAt (φ ≫ φ') i] :
    QuasiIsoAt φ i := by
  rw [quasiIsoAt_iff_isIso_homologyMap] at hφ' hφφ' ⊢
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : IsIso (homologyMap φ' i)
hφφ' : IsIso (homologyMap (φ ≫ φ') i)
⊢ IsIso (homologyMap φ i)

Next tactic:
rw [homologyMap_comp] at hφφ'
lemma quasiIsoAt_of_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] [hφφ' : QuasiIsoAt (φ ≫ φ') i] :
    QuasiIsoAt φ i := by
  rw [quasiIsoAt_iff_isIso_homologyMap] at hφ' hφφ' ⊢
  rw [homologyMap_comp] at hφφ'
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : IsIso (homologyMap φ' i)
hφφ' : IsIso (homologyMap φ i ≫ homologyMap φ' i)
⊢ IsIso (homologyMap φ i)

Next tactic:
exact IsIso.of_isIso_comp_right (homologyMap φ i) (homologyMap φ' i)
lemma quasiIsoAt_iff_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] :
    QuasiIsoAt (φ ≫ φ') i ↔ QuasiIsoAt φ i := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : QuasiIsoAt φ' i
⊢ QuasiIsoAt (φ ≫ φ') i ↔ QuasiIsoAt φ i

Next tactic:
constructor
lemma quasiIsoAt_iff_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] :
    QuasiIsoAt (φ ≫ φ') i ↔ QuasiIsoAt φ i := by
  constructor
  · 

Proof state:
case mp
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : QuasiIsoAt φ' i
⊢ QuasiIsoAt (φ ≫ φ') i → QuasiIsoAt φ i

Next tactic:
intro
lemma quasiIsoAt_iff_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] :
    QuasiIsoAt (φ ≫ φ') i ↔ QuasiIsoAt φ i := by
  constructor
  · intro
    

Proof state:
case mp
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : QuasiIsoAt φ' i
a✝ : QuasiIsoAt (φ ≫ φ') i
⊢ QuasiIsoAt φ i

Next tactic:
exact quasiIsoAt_of_comp_right φ φ' i
lemma quasiIsoAt_iff_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] :
    QuasiIsoAt (φ ≫ φ') i ↔ QuasiIsoAt φ i := by
  constructor
  · intro
    exact quasiIsoAt_of_comp_right φ φ' i
  · 

Proof state:
case mpr
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : QuasiIsoAt φ' i
⊢ QuasiIsoAt φ i → QuasiIsoAt (φ ≫ φ') i

Next tactic:
intro
lemma quasiIsoAt_iff_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) (i : ι) [K.HasHomology i]
    [L.HasHomology i] [M.HasHomology i]
    [hφ' : QuasiIsoAt φ' i] :
    QuasiIsoAt (φ ≫ φ') i ↔ QuasiIsoAt φ i := by
  constructor
  · intro
    exact quasiIsoAt_of_comp_right φ φ' i
  · intro
    

Proof state:
case mpr
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
i : ι
inst✝² : HasHomology K i
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
hφ' : QuasiIsoAt φ' i
a✝ : QuasiIsoAt φ i
⊢ QuasiIsoAt (φ ≫ φ') i

Next tactic:
infer_instance
lemma quasiIso_iff_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) [∀ i, K.HasHomology i]
    [∀ i, L.HasHomology i] [∀ i, M.HasHomology i]
    [hφ' : QuasiIso φ'] :
    QuasiIso (φ ≫ φ') ↔ QuasiIso φ := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
inst✝² : ∀ (i : ι), HasHomology K i
inst✝¹ : ∀ (i : ι), HasHomology L i
inst✝ : ∀ (i : ι), HasHomology M i
hφ' : QuasiIso φ'
⊢ QuasiIso (φ ≫ φ') ↔ QuasiIso φ

Next tactic:
simp only [quasiIso_iff, quasiIsoAt_iff_comp_right φ φ']
lemma quasiIso_of_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) [∀ i, K.HasHomology i]
    [∀ i, L.HasHomology i] [∀ i, M.HasHomology i]
    [hφ : QuasiIso φ'] [hφφ' : QuasiIso (φ ≫ φ')] :
    QuasiIso φ := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
inst✝² : ∀ (i : ι), HasHomology K i
inst✝¹ : ∀ (i : ι), HasHomology L i
inst✝ : ∀ (i : ι), HasHomology M i
hφ : QuasiIso φ'
hφφ' : QuasiIso (φ ≫ φ')
⊢ QuasiIso φ

Next tactic:
rw [← quasiIso_iff_comp_right φ φ']
lemma quasiIso_of_comp_right (φ : K ⟶ L) (φ' : L ⟶ M) [∀ i, K.HasHomology i]
    [∀ i, L.HasHomology i] [∀ i, M.HasHomology i]
    [hφ : QuasiIso φ'] [hφφ' : QuasiIso (φ ≫ φ')] :
    QuasiIso φ := by
  rw [← quasiIso_iff_comp_right φ φ']
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : L ⟶ M
inst✝² : ∀ (i : ι), HasHomology K i
inst✝¹ : ∀ (i : ι), HasHomology L i
inst✝ : ∀ (i : ι), HasHomology M i
hφ : QuasiIso φ'
hφφ' : QuasiIso (φ ≫ φ')
⊢ QuasiIso (φ ≫ φ')

Next tactic:
infer_instance
lemma quasiIso_iff_of_arrow_mk_iso (φ : K ⟶ L) (φ' : K' ⟶ L') (e : Arrow.mk φ ≅ Arrow.mk φ')
    [∀ i, K.HasHomology i] [∀ i, L.HasHomology i]
    [∀ i, K'.HasHomology i] [∀ i, L'.HasHomology i] :
    QuasiIso φ ↔ QuasiIso φ' := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁵ : Category.{v, u} C
inst✝⁴ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : K' ⟶ L'
e : Arrow.mk φ ≅ Arrow.mk φ'
inst✝³ : ∀ (i : ι), HasHomology K i
inst✝² : ∀ (i : ι), HasHomology L i
inst✝¹ : ∀ (i : ι), HasHomology K' i
inst✝ : ∀ (i : ι), HasHomology L' i
⊢ QuasiIso φ ↔ QuasiIso φ'

Next tactic:
rw [← quasiIso_iff_comp_left (show K' ⟶ K from e.inv.left) φ,
    ← quasiIso_iff_comp_right φ' (show L' ⟶ L from e.inv.right)]
lemma quasiIso_iff_of_arrow_mk_iso (φ : K ⟶ L) (φ' : K' ⟶ L') (e : Arrow.mk φ ≅ Arrow.mk φ')
    [∀ i, K.HasHomology i] [∀ i, L.HasHomology i]
    [∀ i, K'.HasHomology i] [∀ i, L'.HasHomology i] :
    QuasiIso φ ↔ QuasiIso φ' := by
  rw [← quasiIso_iff_comp_left (show K' ⟶ K from e.inv.left) φ,
    ← quasiIso_iff_comp_right φ' (show L' ⟶ L from e.inv.right)]
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁵ : Category.{v, u} C
inst✝⁴ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : K' ⟶ L'
e : Arrow.mk φ ≅ Arrow.mk φ'
inst✝³ : ∀ (i : ι), HasHomology K i
inst✝² : ∀ (i : ι), HasHomology L i
inst✝¹ : ∀ (i : ι), HasHomology K' i
inst✝ : ∀ (i : ι), HasHomology L' i
⊢ QuasiIso
      ((let_fun this := e.inv.left;
        this) ≫
        φ) ↔
    QuasiIso
      (φ' ≫
        let_fun this := e.inv.right;
        this)

Next tactic:
erw [Arrow.w e.inv]
lemma quasiIso_iff_of_arrow_mk_iso (φ : K ⟶ L) (φ' : K' ⟶ L') (e : Arrow.mk φ ≅ Arrow.mk φ')
    [∀ i, K.HasHomology i] [∀ i, L.HasHomology i]
    [∀ i, K'.HasHomology i] [∀ i, L'.HasHomology i] :
    QuasiIso φ ↔ QuasiIso φ' := by
  rw [← quasiIso_iff_comp_left (show K' ⟶ K from e.inv.left) φ,
    ← quasiIso_iff_comp_right φ' (show L' ⟶ L from e.inv.right)]
  erw [Arrow.w e.inv]
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁵ : Category.{v, u} C
inst✝⁴ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : K' ⟶ L'
e : Arrow.mk φ ≅ Arrow.mk φ'
inst✝³ : ∀ (i : ι), HasHomology K i
inst✝² : ∀ (i : ι), HasHomology L i
inst✝¹ : ∀ (i : ι), HasHomology K' i
inst✝ : ∀ (i : ι), HasHomology L' i
⊢ QuasiIso ((Arrow.mk φ').hom ≫ e.inv.right) ↔
    QuasiIso
      (φ' ≫
        let_fun this := e.inv.right;
        this)

Next tactic:
rfl
lemma quasiIso_of_arrow_mk_iso (φ : K ⟶ L) (φ' : K' ⟶ L') (e : Arrow.mk φ ≅ Arrow.mk φ')
    [∀ i, K.HasHomology i] [∀ i, L.HasHomology i]
    [∀ i, K'.HasHomology i] [∀ i, L'.HasHomology i]
    [hφ : QuasiIso φ] : QuasiIso φ' := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁵ : Category.{v, u} C
inst✝⁴ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
φ : K ⟶ L
φ' : K' ⟶ L'
e : Arrow.mk φ ≅ Arrow.mk φ'
inst✝³ : ∀ (i : ι), HasHomology K i
inst✝² : ∀ (i : ι), HasHomology L i
inst✝¹ : ∀ (i : ι), HasHomology K' i
inst✝ : ∀ (i : ι), HasHomology L' i
hφ : QuasiIso φ
⊢ QuasiIso φ'

Next tactic:
simpa only [← quasiIso_iff_of_arrow_mk_iso φ φ' e]
instance quasiIsoAt_map_of_preservesHomology [hφ : QuasiIsoAt φ i] :
    QuasiIsoAt ((F.mapHomologicalComplex c).map φ) i := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝¹¹ : Category.{v, u} C
inst✝¹⁰ : HasZeroMorphisms C
c : ComplexShape ι
K✝ L✝ M K' L' : HomologicalComplex C c
C₁ : Type u_3
C₂ : Type u_4
inst✝⁹ : Category.{?u.185423, u_3} C₁
inst✝⁸ : Category.{?u.185427, u_4} C₂
inst✝⁷ : Preadditive C₁
inst✝⁶ : Preadditive C₂
K L : HomologicalComplex C₁ c
φ : K ⟶ L
F : C₁ ⥤ C₂
inst✝⁵ : Functor.Additive F
inst✝⁴ : Functor.PreservesHomology F
i : ι
inst✝³ : HasHomology K i
inst✝² : HasHomology L i
inst✝¹ : HasHomology ((Functor.mapHomologicalComplex F c).obj K) i
inst✝ : HasHomology ((Functor.mapHomologicalComplex F c).obj L) i
hφ : QuasiIsoAt φ i
⊢ QuasiIsoAt ((Functor.mapHomologicalComplex F c).map φ) i

Next tactic:
rw [quasiIsoAt_iff] at hφ ⊢
instance quasiIsoAt_map_of_preservesHomology [hφ : QuasiIsoAt φ i] :
    QuasiIsoAt ((F.mapHomologicalComplex c).map φ) i := by
  rw [quasiIsoAt_iff] at hφ ⊢
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝¹¹ : Category.{v, u} C
inst✝¹⁰ : HasZeroMorphisms C
c : ComplexShape ι
K✝ L✝ M K' L' : HomologicalComplex C c
C₁ : Type u_3
C₂ : Type u_4
inst✝⁹ : Category.{?u.185423, u_3} C₁
inst✝⁸ : Category.{?u.185427, u_4} C₂
inst✝⁷ : Preadditive C₁
inst✝⁶ : Preadditive C₂
K L : HomologicalComplex C₁ c
φ : K ⟶ L
F : C₁ ⥤ C₂
inst✝⁵ : Functor.Additive F
inst✝⁴ : Functor.PreservesHomology F
i : ι
inst✝³ : HasHomology K i
inst✝² : HasHomology L i
inst✝¹ : HasHomology ((Functor.mapHomologicalComplex F c).obj K) i
inst✝ : HasHomology ((Functor.mapHomologicalComplex F c).obj L) i
hφ : ShortComplex.QuasiIso ((shortComplexFunctor C₁ c i).map φ)
⊢ ShortComplex.QuasiIso ((shortComplexFunctor C₂ c i).map ((Functor.mapHomologicalComplex F c).map φ))

Next tactic:
exact ShortComplex.quasiIso_map_of_preservesLeftHomology F
    ((shortComplexFunctor C₁ c i).map φ)
lemma quasiIsoAt_map_iff_of_preservesHomology [ReflectsIsomorphisms F] :
    QuasiIsoAt ((F.mapHomologicalComplex c).map φ) i ↔ QuasiIsoAt φ i := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝¹² : Category.{v, u} C
inst✝¹¹ : HasZeroMorphisms C
c : ComplexShape ι
K✝ L✝ M K' L' : HomologicalComplex C c
C₁ : Type u_3
C₂ : Type u_4
inst✝¹⁰ : Category.{u_5, u_3} C₁
inst✝⁹ : Category.{u_6, u_4} C₂
inst✝⁸ : Preadditive C₁
inst✝⁷ : Preadditive C₂
K L : HomologicalComplex C₁ c
φ : K ⟶ L
F : C₁ ⥤ C₂
inst✝⁶ : Functor.Additive F
inst✝⁵ : Functor.PreservesHomology F
i : ι
inst✝⁴ : HasHomology K i
inst✝³ : HasHomology L i
inst✝² : HasHomology ((Functor.mapHomologicalComplex F c).obj K) i
inst✝¹ : HasHomology ((Functor.mapHomologicalComplex F c).obj L) i
inst✝ : ReflectsIsomorphisms F
⊢ QuasiIsoAt ((Functor.mapHomologicalComplex F c).map φ) i ↔ QuasiIsoAt φ i

Next tactic:
simp only [quasiIsoAt_iff]
lemma quasiIsoAt_map_iff_of_preservesHomology [ReflectsIsomorphisms F] :
    QuasiIsoAt ((F.mapHomologicalComplex c).map φ) i ↔ QuasiIsoAt φ i := by
  simp only [quasiIsoAt_iff]
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝¹² : Category.{v, u} C
inst✝¹¹ : HasZeroMorphisms C
c : ComplexShape ι
K✝ L✝ M K' L' : HomologicalComplex C c
C₁ : Type u_3
C₂ : Type u_4
inst✝¹⁰ : Category.{u_5, u_3} C₁
inst✝⁹ : Category.{u_6, u_4} C₂
inst✝⁸ : Preadditive C₁
inst✝⁷ : Preadditive C₂
K L : HomologicalComplex C₁ c
φ : K ⟶ L
F : C₁ ⥤ C₂
inst✝⁶ : Functor.Additive F
inst✝⁵ : Functor.PreservesHomology F
i : ι
inst✝⁴ : HasHomology K i
inst✝³ : HasHomology L i
inst✝² : HasHomology ((Functor.mapHomologicalComplex F c).obj K) i
inst✝¹ : HasHomology ((Functor.mapHomologicalComplex F c).obj L) i
inst✝ : ReflectsIsomorphisms F
⊢ ShortComplex.QuasiIso ((shortComplexFunctor C₂ c i).map ((Functor.mapHomologicalComplex F c).map φ)) ↔
    ShortComplex.QuasiIso ((shortComplexFunctor C₁ c i).map φ)

Next tactic:
exact ShortComplex.quasiIso_map_iff_of_preservesLeftHomology F
    ((shortComplexFunctor C₁ c i).map φ)
lemma quasiIso_map_iff_of_preservesHomology [ReflectsIsomorphisms F] :
    QuasiIso ((F.mapHomologicalComplex c).map φ) ↔ QuasiIso φ := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝¹² : Category.{v, u} C
inst✝¹¹ : HasZeroMorphisms C
c : ComplexShape ι
K✝ L✝ M K' L' : HomologicalComplex C c
C₁ : Type u_3
C₂ : Type u_4
inst✝¹⁰ : Category.{u_5, u_3} C₁
inst✝⁹ : Category.{u_6, u_4} C₂
inst✝⁸ : Preadditive C₁
inst✝⁷ : Preadditive C₂
K L : HomologicalComplex C₁ c
φ : K ⟶ L
F : C₁ ⥤ C₂
inst✝⁶ : Functor.Additive F
inst✝⁵ : Functor.PreservesHomology F
inst✝⁴ : ∀ (i : ι), HasHomology K i
inst✝³ : ∀ (i : ι), HasHomology L i
inst✝² : ∀ (i : ι), HasHomology ((Functor.mapHomologicalComplex F c).obj K) i
inst✝¹ : ∀ (i : ι), HasHomology ((Functor.mapHomologicalComplex F c).obj L) i
inst✝ : ReflectsIsomorphisms F
⊢ QuasiIso ((Functor.mapHomologicalComplex F c).map φ) ↔ QuasiIso φ

Next tactic:
simp only [quasiIso_iff, quasiIsoAt_map_iff_of_preservesHomology φ F]
@[simp]
lemma qis_iff [CategoryWithHomology C] (f : K ⟶ L) : qis C c f ↔ QuasiIso f := by 

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : HasZeroMorphisms C
c : ComplexShape ι
K L M K' L' : HomologicalComplex C c
inst✝ : CategoryWithHomology C
f : K ⟶ L
⊢ qis C c f ↔ QuasiIso f

Next tactic:
rfl
instance : QuasiIso e.hom where
  quasiIsoAt n := by
    

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
e : HomotopyEquiv K L
inst✝¹ : ∀ (i : ι), HasHomology K i
inst✝ : ∀ (i : ι), HasHomology L i
n : ι
⊢ QuasiIsoAt e.hom n

Next tactic:
classical
    rw [quasiIsoAt_iff_isIso_homologyMap]
    exact IsIso.of_iso (e.toHomologyIso n)
instance : QuasiIso e.hom where
  quasiIsoAt n := by
    classical
    

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
e : HomotopyEquiv K L
inst✝¹ : ∀ (i : ι), HasHomology K i
inst✝ : ∀ (i : ι), HasHomology L i
n : ι
⊢ QuasiIsoAt e.hom n

Next tactic:
rw [quasiIsoAt_iff_isIso_homologyMap]
instance : QuasiIso e.hom where
  quasiIsoAt n := by
    classical
    rw [quasiIsoAt_iff_isIso_homologyMap]
    

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
e : HomotopyEquiv K L
inst✝¹ : ∀ (i : ι), HasHomology K i
inst✝ : ∀ (i : ι), HasHomology L i
n : ι
⊢ IsIso (homologyMap e.hom n)

Next tactic:
exact IsIso.of_iso (e.toHomologyIso n)
lemma homotopyEquivalences_subset_qis [CategoryWithHomology C] :
    homotopyEquivalences C c ⊆ qis C c := by
  

Proof state:
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
e : HomotopyEquiv K L
inst✝² : ∀ (i : ι), HasHomology K i
inst✝¹ : ∀ (i : ι), HasHomology L i
inst✝ : CategoryWithHomology C
⊢ homotopyEquivalences C c ⊆ qis C c

Next tactic:
rintro K L _ ⟨e, rfl⟩
lemma homotopyEquivalences_subset_qis [CategoryWithHomology C] :
    homotopyEquivalences C c ⊆ qis C c := by
  rintro K L _ ⟨e, rfl⟩
  

Proof state:
case intro
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : Preadditive C
c : ComplexShape ι
K✝ L✝ : HomologicalComplex C c
e✝ : HomotopyEquiv K✝ L✝
inst✝² : ∀ (i : ι), HasHomology K✝ i
inst✝¹ : ∀ (i : ι), HasHomology L✝ i
inst✝ : CategoryWithHomology C
K L : HomologicalComplex C c
e : HomotopyEquiv K L
⊢ qis C c e.hom

Next tactic:
simp only [qis_iff]
lemma homotopyEquivalences_subset_qis [CategoryWithHomology C] :
    homotopyEquivalences C c ⊆ qis C c := by
  rintro K L _ ⟨e, rfl⟩
  simp only [qis_iff]
  

Proof state:
case intro
ι✝ : Type u_1
ι : Type u_2
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : Preadditive C
c : ComplexShape ι
K✝ L✝ : HomologicalComplex C c
e✝ : HomotopyEquiv K✝ L✝
inst✝² : ∀ (i : ι), HasHomology K✝ i
inst✝¹ : ∀ (i : ι), HasHomology L✝ i
inst✝ : CategoryWithHomology C
K L : HomologicalComplex C c
e : HomotopyEquiv K L
⊢ QuasiIso e.hom

Next tactic:
infer_instance
lemma nat_lit_mul_eq_nsmul [n.AtLeastTwo] : no_index (OfNat.ofNat n) * r = n • r := by
  

Proof state:
R : Type u_1
inst✝¹ : NonAssocSemiring R
r : R
n : ℕ
inst✝ : Nat.AtLeastTwo n
⊢ OfNat.ofNat n * r = n • r

Next tactic:
simp only [nsmul_eq_mul, Nat.cast_eq_ofNat]
lemma mul_nat_lit_eq_nsmul [n.AtLeastTwo] : r * no_index (OfNat.ofNat n) = n • r := by
  

Proof state:
R : Type u_1
inst✝¹ : NonAssocSemiring R
r : R
n : ℕ
inst✝ : Nat.AtLeastTwo n
⊢ r * OfNat.ofNat n = n • r

Next tactic:
simp only [nsmul_eq_mul', Nat.cast_eq_ofNat]
theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by
  

Proof state:
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
h : IsAffine Y
⊢ IsAffine X

Next tactic:
rw [← mem_Spec_essImage] at h ⊢
theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by
  rw [← mem_Spec_essImage] at h ⊢; 

Proof state:
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
h : Y ∈ Functor.essImage Scheme.Spec
⊢ X ∈ Functor.essImage Scheme.Spec

Next tactic:
exact Functor.essImage.ofIso (asIso f).symm h
instance hasLimits : HasLimits AffineScheme.{u} := by
  

Proof state:
⊢ HasLimits AffineScheme

Next tactic:
haveI := Adjunction.has_colimits_of_equivalence Γ.{u}
instance hasLimits : HasLimits AffineScheme.{u} := by
  haveI := Adjunction.has_colimits_of_equivalence Γ.{u}
  

Proof state:
this : HasColimitsOfSize.{u, u, u, u + 1} AffineSchemeᵒᵖ
⊢ HasLimits AffineScheme

Next tactic:
haveI : HasLimits AffineScheme.{u}ᵒᵖᵒᵖ := Limits.hasLimits_op_of_hasColimits
instance hasLimits : HasLimits AffineScheme.{u} := by
  haveI := Adjunction.has_colimits_of_equivalence Γ.{u}
  haveI : HasLimits AffineScheme.{u}ᵒᵖᵒᵖ := Limits.hasLimits_op_of_hasColimits
  

Proof state:
this✝ : HasColimitsOfSize.{u, u, u, u + 1} AffineSchemeᵒᵖ
this : HasLimits AffineSchemeᵒᵖᵒᵖ
⊢ HasLimits AffineScheme

Next tactic:
exact Adjunction.has_limits_of_equivalence (opOpEquivalence AffineScheme.{u}).inverse
noncomputable instance forgetToScheme_preservesLimits : PreservesLimits forgetToScheme := by
  

Proof state:
⊢ PreservesLimits forgetToScheme

Next tactic:
apply (config := { allowSynthFailures := true })
    @preservesLimitsOfNatIso _ _ _ _ _ _
      (isoWhiskerRight equivCommRingCat.unitIso forgetToScheme).symm
noncomputable instance forgetToScheme_preservesLimits : PreservesLimits forgetToScheme := by
  apply (config := { allowSynthFailures := true })
    @preservesLimitsOfNatIso _ _ _ _ _ _
      (isoWhiskerRight equivCommRingCat.unitIso forgetToScheme).symm
  

Proof state:
⊢ PreservesLimitsOfSize.{?u.56761, ?u.56761, ?u.56761, ?u.56761, ?u.56761 + 1, ?u.56761 + 1}
    ((equivCommRingCat.functor ⋙ equivCommRingCat.inverse) ⋙ forgetToScheme)

Next tactic:
change PreservesLimits (equivCommRingCat.functor ⋙ Scheme.Spec)
noncomputable instance forgetToScheme_preservesLimits : PreservesLimits forgetToScheme := by
  apply (config := { allowSynthFailures := true })
    @preservesLimitsOfNatIso _ _ _ _ _ _
      (isoWhiskerRight equivCommRingCat.unitIso forgetToScheme).symm
  change PreservesLimits (equivCommRingCat.functor ⋙ Scheme.Spec)
  

Proof state:
⊢ PreservesLimits (equivCommRingCat.functor ⋙ Scheme.Spec)

Next tactic:
infer_instance
theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
    [H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by
  

Proof state:
X Y : Scheme
inst✝ : IsAffine X
f : X ⟶ Y
H : IsOpenImmersion f
⊢ IsAffineOpen (Scheme.Hom.opensRange f)

Next tactic:
refine' isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) _).inv
theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
    [H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by
  refine' isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) _).inv
  

Proof state:
X Y : Scheme
inst✝ : IsAffine X
f : X ⟶ Y
H : IsOpenImmersion f
⊢ Set.range ⇑f.val.base =
    Set.range ⇑(Scheme.ofRestrict Y (_ : OpenEmbedding ⇑(Opens.inclusion (Scheme.Hom.opensRange f)))).val.base

Next tactic:
exact Subtype.range_val.symm
theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by
  

Proof state:
X : Scheme
inst✝ : IsAffine X
⊢ IsAffineOpen ⊤

Next tactic:
convert rangeIsAffineOpenOfOpenImmersion (𝟙 X)
theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by
  convert rangeIsAffineOpenOfOpenImmersion (𝟙 X)
  

Proof state:
case h.e'_2
X : Scheme
inst✝ : IsAffine X
⊢ ⊤ = Scheme.Hom.opensRange (𝟙 X)

Next tactic:
ext1
theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by
  convert rangeIsAffineOpenOfOpenImmersion (𝟙 X)
  ext1
  

Proof state:
case h.e'_2.h
X : Scheme
inst✝ : IsAffine X
⊢ ↑⊤ = ↑(Scheme.Hom.opensRange (𝟙 X))

Next tactic:
exact Set.range_id.symm
theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by
  

Proof state:
X : Scheme
⊢ Opens.IsBasis (Scheme.affineOpens X)

Next tactic:
rw [Opens.isBasis_iff_nbhd]
theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by
  rw [Opens.isBasis_iff_nbhd]
  

Proof state:
X : Scheme
⊢ ∀ {U : Opens ↑↑X.toPresheafedSpace} {x : ↑↑X.toPresheafedSpace}, x ∈ U → ∃ U' ∈ Scheme.affineOpens X, x ∈ U' ∧ U' ≤ U

Next tactic:
rintro U x (hU : x ∈ (U : Set X))
theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by
  rw [Opens.isBasis_iff_nbhd]
  rintro U x (hU : x ∈ (U : Set X))
  

Proof state:
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
x : ↑↑X.toPresheafedSpace
hU : x ∈ ↑U
⊢ ∃ U' ∈ Scheme.affineOpens X, x ∈ U' ∧ U' ≤ U

Next tactic:
obtain ⟨S, hS, hxS, hSU⟩ := X.affineBasisCover_is_basis.exists_subset_of_mem_open hU U.isOpen
theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by
  rw [Opens.isBasis_iff_nbhd]
  rintro U x (hU : x ∈ (U : Set X))
  obtain ⟨S, hS, hxS, hSU⟩ := X.affineBasisCover_is_basis.exists_subset_of_mem_open hU U.isOpen
  

Proof state:
case intro.intro.intro
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
x : ↑↑X.toPresheafedSpace
hU : x ∈ ↑U
S : Set ↑↑X.toPresheafedSpace
hS : S ∈ {x | ∃ a, x = Set.range ⇑(Scheme.OpenCover.map (Scheme.affineBasisCover X) a).val.base}
hxS : x ∈ S
hSU : S ⊆ ↑U
⊢ ∃ U' ∈ Scheme.affineOpens X, x ∈ U' ∧ U' ≤ U

Next tactic:
refine' ⟨⟨S, X.affineBasisCover_is_basis.isOpen hS⟩, _, hxS, hSU⟩