l3lab/ntp-mathlib huggingface dataset:
lemma InjectiveResolution.toRightDerivedZero_eq
    {X : C} (I : InjectiveResolution X) (F : C ⥤ D) [F.Additive] :
    F.toRightDerivedZero.app X = I.toRightDerivedZero' F ≫
      (CochainComplex.isoHomologyπ₀ _).hom ≫ (I.isoRightDerivedObj F 0).inv := by
  dsimp [Functor.toRightDerivedZero, isoRightDerivedObj]
  have h₁ := InjectiveResolution.toRightDerivedZero'_naturality
    (𝟙 X) (injectiveResolution X) I (desc (𝟙 X) _ _) (by simp) F
  simp only [Functor.map_id, id_comp] at h₁
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u_1
inst✝⁴ : Category.{u_2, u_1} D
inst✝³ : Abelian C
inst✝² : HasInjectiveResolutions C
inst✝¹ : Abelian D
X : C
I : InjectiveResolution X
F : C ⥤ D
inst✝ : Functor.Additive F
h₁ :
  toRightDerivedZero' I F =
    toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.cyclesMap
        ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) 0
⊢ toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) =
    toRightDerivedZero' I F ≫
      HomologicalComplex.homologyπ ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex) 0 ≫
        (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex) ≫
          (HomotopyCategory.homologyFunctor D (ComplexShape.up ℕ) 0).map (isoRightDerivedToHomotopyCategoryObj I F).inv

Next tactic:
have h₂ : (I.isoRightDerivedToHomotopyCategoryObj F).hom =
    (F.mapHomologicalComplex _ ⋙ HomotopyCategory.quotient _ _).map (desc (𝟙 X) _ _) :=
    comp_id _
lemma InjectiveResolution.toRightDerivedZero_eq
    {X : C} (I : InjectiveResolution X) (F : C ⥤ D) [F.Additive] :
    F.toRightDerivedZero.app X = I.toRightDerivedZero' F ≫
      (CochainComplex.isoHomologyπ₀ _).hom ≫ (I.isoRightDerivedObj F 0).inv := by
  dsimp [Functor.toRightDerivedZero, isoRightDerivedObj]
  have h₁ := InjectiveResolution.toRightDerivedZero'_naturality
    (𝟙 X) (injectiveResolution X) I (desc (𝟙 X) _ _) (by simp) F
  simp only [Functor.map_id, id_comp] at h₁
  have h₂ : (I.isoRightDerivedToHomotopyCategoryObj F).hom =
    (F.mapHomologicalComplex _ ⋙ HomotopyCategory.quotient _ _).map (desc (𝟙 X) _ _) :=
    comp_id _
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u_1
inst✝⁴ : Category.{u_2, u_1} D
inst✝³ : Abelian C
inst✝² : HasInjectiveResolutions C
inst✝¹ : Abelian D
X : C
I : InjectiveResolution X
F : C ⥤ D
inst✝ : Functor.Additive F
h₁ :
  toRightDerivedZero' I F =
    toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.cyclesMap
        ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) 0
h₂ :
  (isoRightDerivedToHomotopyCategoryObj I F).hom =
    (Functor.mapHomologicalComplex F (ComplexShape.up ℕ) ⋙ HomotopyCategory.quotient D (ComplexShape.up ℕ)).map
      (desc (𝟙 X) I (injectiveResolution X))
⊢ toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) =
    toRightDerivedZero' I F ≫
      HomologicalComplex.homologyπ ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex) 0 ≫
        (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex) ≫
          (HomotopyCategory.homologyFunctor D (ComplexShape.up ℕ) 0).map (isoRightDerivedToHomotopyCategoryObj I F).inv

Next tactic:
rw [← cancel_mono ((HomotopyCategory.homologyFunctor _ _ 0).map
      (I.isoRightDerivedToHomotopyCategoryObj F).hom),
    assoc, assoc, assoc, assoc, assoc, ← Functor.map_comp,
    Iso.inv_hom_id, Functor.map_id, comp_id,
    reassoc_of% h₁, h₂, ← HomologicalComplex.homologyπ_naturality_assoc]
lemma InjectiveResolution.toRightDerivedZero_eq
    {X : C} (I : InjectiveResolution X) (F : C ⥤ D) [F.Additive] :
    F.toRightDerivedZero.app X = I.toRightDerivedZero' F ≫
      (CochainComplex.isoHomologyπ₀ _).hom ≫ (I.isoRightDerivedObj F 0).inv := by
  dsimp [Functor.toRightDerivedZero, isoRightDerivedObj]
  have h₁ := InjectiveResolution.toRightDerivedZero'_naturality
    (𝟙 X) (injectiveResolution X) I (desc (𝟙 X) _ _) (by simp) F
  simp only [Functor.map_id, id_comp] at h₁
  have h₂ : (I.isoRightDerivedToHomotopyCategoryObj F).hom =
    (F.mapHomologicalComplex _ ⋙ HomotopyCategory.quotient _ _).map (desc (𝟙 X) _ _) :=
    comp_id _
  rw [← cancel_mono ((HomotopyCategory.homologyFunctor _ _ 0).map
      (I.isoRightDerivedToHomotopyCategoryObj F).hom),
    assoc, assoc, assoc, assoc, assoc, ← Functor.map_comp,
    Iso.inv_hom_id, Functor.map_id, comp_id,
    reassoc_of% h₁, h₂, ← HomologicalComplex.homologyπ_naturality_assoc]
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u_1
inst✝⁴ : Category.{u_2, u_1} D
inst✝³ : Abelian C
inst✝² : HasInjectiveResolutions C
inst✝¹ : Abelian D
X : C
I : InjectiveResolution X
F : C ⥤ D
inst✝ : Functor.Additive F
h₁ :
  toRightDerivedZero' I F =
    toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.cyclesMap
        ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) 0
h₂ :
  (isoRightDerivedToHomotopyCategoryObj I F).hom =
    (Functor.mapHomologicalComplex F (ComplexShape.up ℕ) ⋙ HomotopyCategory.quotient D (ComplexShape.up ℕ)).map
      (desc (𝟙 X) I (injectiveResolution X))
⊢ toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) ≫
          (HomotopyCategory.homologyFunctor D (ComplexShape.up ℕ) 0).map
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ) ⋙ HomotopyCategory.quotient D (ComplexShape.up ℕ)).map
              (desc (𝟙 X) I (injectiveResolution X))) =
    toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        HomologicalComplex.homologyMap
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) 0 ≫
          (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex)

Next tactic:
erw [← NatTrans.naturality]
lemma InjectiveResolution.toRightDerivedZero_eq
    {X : C} (I : InjectiveResolution X) (F : C ⥤ D) [F.Additive] :
    F.toRightDerivedZero.app X = I.toRightDerivedZero' F ≫
      (CochainComplex.isoHomologyπ₀ _).hom ≫ (I.isoRightDerivedObj F 0).inv := by
  dsimp [Functor.toRightDerivedZero, isoRightDerivedObj]
  have h₁ := InjectiveResolution.toRightDerivedZero'_naturality
    (𝟙 X) (injectiveResolution X) I (desc (𝟙 X) _ _) (by simp) F
  simp only [Functor.map_id, id_comp] at h₁
  have h₂ : (I.isoRightDerivedToHomotopyCategoryObj F).hom =
    (F.mapHomologicalComplex _ ⋙ HomotopyCategory.quotient _ _).map (desc (𝟙 X) _ _) :=
    comp_id _
  rw [← cancel_mono ((HomotopyCategory.homologyFunctor _ _ 0).map
      (I.isoRightDerivedToHomotopyCategoryObj F).hom),
    assoc, assoc, assoc, assoc, assoc, ← Functor.map_comp,
    Iso.inv_hom_id, Functor.map_id, comp_id,
    reassoc_of% h₁, h₂, ← HomologicalComplex.homologyπ_naturality_assoc]
  erw [← NatTrans.naturality]
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u_1
inst✝⁴ : Category.{u_2, u_1} D
inst✝³ : Abelian C
inst✝² : HasInjectiveResolutions C
inst✝¹ : Abelian D
X : C
I : InjectiveResolution X
F : C ⥤ D
inst✝ : Functor.Additive F
h₁ :
  toRightDerivedZero' I F =
    toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.cyclesMap
        ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) 0
h₂ :
  (isoRightDerivedToHomotopyCategoryObj I F).hom =
    (Functor.mapHomologicalComplex F (ComplexShape.up ℕ) ⋙ HomotopyCategory.quotient D (ComplexShape.up ℕ)).map
      (desc (𝟙 X) I (injectiveResolution X))
⊢ toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        (HomologicalComplex.homologyFunctor D (ComplexShape.up ℕ) 0).map
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) ≫
          (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex) =
    toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        HomologicalComplex.homologyMap
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).map (desc (𝟙 X) I (injectiveResolution X))) 0 ≫
          (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj I.cocomplex)

Next tactic:
rfl
instance (F : C ⥤ D) [F.Additive] (X : C) [Injective X] :
    IsIso (F.toRightDerivedZero.app X) := by
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.193630, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
X : C
inst✝ : Injective X
⊢ IsIso ((Functor.toRightDerivedZero F).app X)

Next tactic:
rw [(InjectiveResolution.self X).toRightDerivedZero_eq F]
instance (F : C ⥤ D) [F.Additive] (X : C) [Injective X] :
    IsIso (F.toRightDerivedZero.app X) := by
  rw [(InjectiveResolution.self X).toRightDerivedZero_eq F]
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.193630, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
X : C
inst✝ : Injective X
⊢ IsIso
    (InjectiveResolution.toRightDerivedZero' (InjectiveResolution.self X) F ≫
      (CochainComplex.isoHomologyπ₀
            ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (InjectiveResolution.self X).cocomplex)).hom ≫
        (InjectiveResolution.isoRightDerivedObj (InjectiveResolution.self X) F 0).inv)

Next tactic:
infer_instance
instance {X : C} (P : InjectiveResolution X) :
    IsIso (P.toRightDerivedZero' F) := by
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.195449, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
inst✝ : PreservesFiniteLimits F
X : C
P : InjectiveResolution X
⊢ IsIso (InjectiveResolution.toRightDerivedZero' P F)

Next tactic:
dsimp [InjectiveResolution.toRightDerivedZero']
instance {X : C} (P : InjectiveResolution X) :
    IsIso (P.toRightDerivedZero' F) := by
  dsimp [InjectiveResolution.toRightDerivedZero']
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.195449, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
inst✝ : PreservesFiniteLimits F
X : C
P : InjectiveResolution X
⊢ IsIso
    (HomologicalComplex.liftCycles ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex)
      (F.map (HomologicalComplex.Hom.f P.ι 0)) 1 InjectiveResolution.toRightDerivedZero'.proof_2
      (_ :
        F.map (HomologicalComplex.Hom.f P.ι 0) ≫
            HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0 1 =
          0))

Next tactic:
rw [CochainComplex.isIso_liftCycles_iff, ShortComplex.exact_and_mono_f_iff_f_is_kernel]
instance {X : C} (P : InjectiveResolution X) :
    IsIso (P.toRightDerivedZero' F) := by
  dsimp [InjectiveResolution.toRightDerivedZero']
  rw [CochainComplex.isIso_liftCycles_iff, ShortComplex.exact_and_mono_f_iff_f_is_kernel]
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.195449, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
inst✝ : PreservesFiniteLimits F
X : C
P : InjectiveResolution X
⊢ Nonempty
    (IsLimit
      (KernelFork.ofι
        (ShortComplex.mk (F.map (HomologicalComplex.Hom.f P.ι 0))
            (HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0 1)
            (_ :
              F.map (HomologicalComplex.Hom.f P.ι 0) ≫
                  HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0 1 =
                0)).f
        (_ :
          (ShortComplex.mk (F.map (HomologicalComplex.Hom.f P.ι 0))
                  (HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0 1)
                  (_ :
                    F.map (HomologicalComplex.Hom.f P.ι 0) ≫
                        HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0
                          1 =
                      0)).f ≫
              (ShortComplex.mk (F.map (HomologicalComplex.Hom.f P.ι 0))
                  (HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0 1)
                  (_ :
                    F.map (HomologicalComplex.Hom.f P.ι 0) ≫
                        HomologicalComplex.d ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj P.cocomplex) 0
                          1 =
                      0)).g =
            0)))

Next tactic:
exact ⟨KernelFork.mapIsLimit _ (P.isLimitKernelFork) F⟩
instance (X : C) : IsIso (F.toRightDerivedZero.app X) := by
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.198175, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
inst✝ : PreservesFiniteLimits F
X : C
⊢ IsIso ((Functor.toRightDerivedZero F).app X)

Next tactic:
dsimp [Functor.toRightDerivedZero]
instance (X : C) : IsIso (F.toRightDerivedZero.app X) := by
  dsimp [Functor.toRightDerivedZero]
  

Proof state:
C : Type u
inst✝⁶ : Category.{v, u} C
D : Type u_1
inst✝⁵ : Category.{?u.198175, u_1} D
inst✝⁴ : Abelian C
inst✝³ : HasInjectiveResolutions C
inst✝² : Abelian D
F : C ⥤ D
inst✝¹ : Functor.Additive F
inst✝ : PreservesFiniteLimits F
X : C
⊢ IsIso
    (InjectiveResolution.toRightDerivedZero' (injectiveResolution X) F ≫
      HomologicalComplex.homologyπ
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex) 0 ≫
        (HomotopyCategory.homologyFunctorFactors D (ComplexShape.up ℕ) 0).inv.app
          ((Functor.mapHomologicalComplex F (ComplexShape.up ℕ)).obj (injectiveResolution X).cocomplex))

Next tactic:
infer_instance
@[simp]
theorem aeval_map_algebraMap (x : B) (p : R[X]) : aeval x (map (algebraMap R A) p) = aeval x p := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : Semiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : B
p : R[X]
⊢ (aeval x) (map (algebraMap R A) p) = (aeval x) p

Next tactic:
rw [aeval_def, aeval_def, eval₂_map, IsScalarTower.algebraMap_eq R A B]
theorem aeval_algebraMap_apply (x : A) (p : R[X]) :
    aeval (algebraMap A B x) p = algebraMap A B (aeval x p) := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : Semiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : A
p : R[X]
⊢ (aeval ((algebraMap A B) x)) p = (algebraMap A B) ((aeval x) p)

Next tactic:
rw [aeval_def, aeval_def, hom_eval₂, ← IsScalarTower.algebraMap_eq]
@[simp]
theorem aeval_algebraMap_eq_zero_iff [NoZeroSMulDivisors A B] [Nontrivial B] (x : A) (p : R[X]) :
    aeval (algebraMap A B x) p = 0 ↔ aeval x p = 0 := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁸ : CommSemiring R
inst✝⁷ : CommSemiring A
inst✝⁶ : Semiring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra A B
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A B
inst✝¹ : NoZeroSMulDivisors A B
inst✝ : Nontrivial B
x : A
p : R[X]
⊢ (aeval ((algebraMap A B) x)) p = 0 ↔ (aeval x) p = 0

Next tactic:
rw [aeval_algebraMap_apply, Algebra.algebraMap_eq_smul_one, smul_eq_zero,
    iff_false_intro (one_ne_zero' B), or_false_iff]
theorem aeval_algebraMap_eq_zero_iff_of_injective {x : A} {p : R[X]}
    (h : Function.Injective (algebraMap A B)) : aeval (algebraMap A B x) p = 0 ↔ aeval x p = 0 := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : Semiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : A
p : R[X]
h : Function.Injective ⇑(algebraMap A B)
⊢ (aeval ((algebraMap A B) x)) p = 0 ↔ (aeval x) p = 0

Next tactic:
rw [aeval_algebraMap_apply, ← (algebraMap A B).map_zero, h.eq_iff]
@[simp]
theorem str_incl (X : Compactum) (x : X) : X.str (X.incl x) = x := by
  

Proof state:
X : Compactum
x : X.A
⊢ str X (incl X x) = x

Next tactic:
change ((β ).η.app _ ≫ X.a) _ = _
@[simp]
theorem str_incl (X : Compactum) (x : X) : X.str (X.incl x) = x := by
  change ((β ).η.app _ ≫ X.a) _ = _
  

Proof state:
X : Compactum
x : X.A
⊢ ((Monad.η β).app X.A ≫ X.a) x = x

Next tactic:
rw [Monad.Algebra.unit]
@[simp]
theorem str_incl (X : Compactum) (x : X) : X.str (X.incl x) = x := by
  change ((β ).η.app _ ≫ X.a) _ = _
  rw [Monad.Algebra.unit]
  

Proof state:
X : Compactum
x : X.A
⊢ 𝟙 X.A x = x

Next tactic:
rfl
@[simp]
theorem str_hom_commute (X Y : Compactum) (f : X ⟶ Y) (xs : Ultrafilter X) :
    f (X.str xs) = Y.str (map f xs) := by
  

Proof state:
X Y : Compactum
f : X ⟶ Y
xs : Ultrafilter X.A
⊢ Monad.Algebra.Hom.f f (str X xs) = str Y (Ultrafilter.map f.f xs)

Next tactic:
change (X.a ≫ f.f) _ = _
@[simp]
theorem str_hom_commute (X Y : Compactum) (f : X ⟶ Y) (xs : Ultrafilter X) :
    f (X.str xs) = Y.str (map f xs) := by
  change (X.a ≫ f.f) _ = _
  

Proof state:
X Y : Compactum
f : X ⟶ Y
xs : Ultrafilter X.A
⊢ (X.a ≫ f.f) xs = str Y (Ultrafilter.map f.f xs)

Next tactic:
rw [← f.h]
@[simp]
theorem str_hom_commute (X Y : Compactum) (f : X ⟶ Y) (xs : Ultrafilter X) :
    f (X.str xs) = Y.str (map f xs) := by
  change (X.a ≫ f.f) _ = _
  rw [← f.h]
  

Proof state:
X Y : Compactum
f : X ⟶ Y
xs : Ultrafilter X.A
⊢ (β.toFunctor.map f.f ≫ Y.a) xs = str Y (Ultrafilter.map f.f xs)

Next tactic:
rfl
@[simp]
theorem join_distrib (X : Compactum) (uux : Ultrafilter (Ultrafilter X)) :
    X.str (X.join uux) = X.str (map X.str uux) := by
  

Proof state:
X : Compactum
uux : Ultrafilter (Ultrafilter X.A)
⊢ str X (join X uux) = str X (Ultrafilter.map (str X) uux)

Next tactic:
change ((β ).μ.app _ ≫ X.a) _ = _
@[simp]
theorem join_distrib (X : Compactum) (uux : Ultrafilter (Ultrafilter X)) :
    X.str (X.join uux) = X.str (map X.str uux) := by
  change ((β ).μ.app _ ≫ X.a) _ = _
  

Proof state:
X : Compactum
uux : Ultrafilter (Ultrafilter X.A)
⊢ ((Monad.μ β).app X.A ≫ X.a) uux = str X (Ultrafilter.map (str X) uux)

Next tactic:
rw [Monad.Algebra.assoc]
@[simp]
theorem join_distrib (X : Compactum) (uux : Ultrafilter (Ultrafilter X)) :
    X.str (X.join uux) = X.str (map X.str uux) := by
  change ((β ).μ.app _ ≫ X.a) _ = _
  rw [Monad.Algebra.assoc]
  

Proof state:
X : Compactum
uux : Ultrafilter (Ultrafilter X.A)
⊢ (β.toFunctor.map X.a ≫ X.a) uux = str X (Ultrafilter.map (str X) uux)

Next tactic:
rfl
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  

Proof state:
X : Compactum
S : Set X.A
⊢ IsClosed S ↔ ∀ (F : Ultrafilter X.A), S ∈ F → str X F ∈ S

Next tactic:
rw [← isOpen_compl_iff]
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  

Proof state:
X : Compactum
S : Set X.A
⊢ IsOpen Sᶜ ↔ ∀ (F : Ultrafilter X.A), S ∈ F → str X F ∈ S

Next tactic:
constructor
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · 

Proof state:
case mp
X : Compactum
S : Set X.A
⊢ IsOpen Sᶜ → ∀ (F : Ultrafilter X.A), S ∈ F → str X F ∈ S

Next tactic:
intro cond F h
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    

Proof state:
case mp
X : Compactum
S : Set X.A
cond : IsOpen Sᶜ
F : Ultrafilter X.A
h : S ∈ F
⊢ str X F ∈ S

Next tactic:
by_contra c
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    by_contra c
    

Proof state:
case mp
X : Compactum
S : Set X.A
cond : IsOpen Sᶜ
F : Ultrafilter X.A
h : S ∈ F
c : str X F ∉ S
⊢ False

Next tactic:
specialize cond F c
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    by_contra c
    specialize cond F c
    

Proof state:
case mp
X : Compactum
S : Set X.A
F : Ultrafilter X.A
h : S ∈ F
c : str X F ∉ S
cond : Sᶜ ∈ F
⊢ False

Next tactic:
rw [compl_mem_iff_not_mem] at cond
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    by_contra c
    specialize cond F c
    rw [compl_mem_iff_not_mem] at cond
    

Proof state:
case mp
X : Compactum
S : Set X.A
F : Ultrafilter X.A
h : S ∈ F
c : str X F ∉ S
cond : S ∉ F
⊢ False

Next tactic:
contradiction
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    by_contra c
    specialize cond F c
    rw [compl_mem_iff_not_mem] at cond
    contradiction
  · 

Proof state:
case mpr
X : Compactum
S : Set X.A
⊢ (∀ (F : Ultrafilter X.A), S ∈ F → str X F ∈ S) → IsOpen Sᶜ

Next tactic:
intro h1 F h2
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    by_contra c
    specialize cond F c
    rw [compl_mem_iff_not_mem] at cond
    contradiction
  · intro h1 F h2
    

Proof state:
case mpr
X : Compactum
S : Set X.A
h1 : ∀ (F : Ultrafilter X.A), S ∈ F → str X F ∈ S
F : Ultrafilter X.A
h2 : str X F ∈ Sᶜ
⊢ Sᶜ ∈ F

Next tactic:
specialize h1 F
theorem isClosed_iff {X : Compactum} (S : Set X) :
    IsClosed S ↔ ∀ F : Ultrafilter X, S ∈ F → X.str F ∈ S := by
  rw [← isOpen_compl_iff]
  constructor
  · intro cond F h
    by_contra c
    specialize cond F c
    rw [compl_mem_iff_not_mem] at cond
    contradiction
  · intro h1 F h2
    specialize h1 F
    

Proof state:
case mpr
X : Compactum
S : Set X.A
F : Ultrafilter X.A
h2 : str X F ∈ Sᶜ
h1 : S ∈ F → str X F ∈ S
⊢ Sᶜ ∈ F

Next tactic:
cases' F.mem_or_compl_mem S with h h