Theorem: HenselianLocalRing.TFAE
File: Mathlib/RingTheory/Henselian.lean

tactic: tfae_have _3_2 : 3 → 2
state_before: R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
⊢ List.TFAE
    [HenselianLocalRing R,
      ∀ (f : R[X]),
        Monic f →
          ∀ (a₀ : ResidueField R),
            ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀,
      ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
        Surjective ↑φ →
          ∀ (f : R[X]),
            Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀]

tactic: tfae_have _2_1 : 2 → 1
state_before: R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
⊢ List.TFAE
    [HenselianLocalRing R,
      ∀ (f : R[X]),
        Monic f →
          ∀ (a₀ : ResidueField R),
            ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀,
      ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
        Surjective ↑φ →
          ∀ (f : R[X]),
            Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀]

tactic: tfae_have _1_3 : 1 → 3
state_before: R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
⊢ List.TFAE
    [HenselianLocalRing R,
      ∀ (f : R[X]),
        Monic f →
          ∀ (a₀ : ResidueField R),
            ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀,
      ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
        Surjective ↑φ →
          ∀ (f : R[X]),
            Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀]

tactic: tfae_finish
state_before: R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
_1_3 :
  HenselianLocalRing R →
    ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀
⊢ List.TFAE
    [HenselianLocalRing R,
      ∀ (f : R[X]),
        Monic f →
          ∀ (a₀ : ResidueField R),
            ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀,
      ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
        Surjective ↑φ →
          ∀ (f : R[X]),
            Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀]

tactic: intro H
state_before: case _3_2
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
⊢ (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀

tactic: exact H (residue R) Ideal.Quotient.mk_surjective
state_before: case _3_2
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
H :
  ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
    Surjective ↑φ →
      ∀ (f : R[X]),
        Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀
⊢ ∀ (f : R[X]),
    Monic f →
      ∀ (a₀ : ResidueField R),
        ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀

tactic: intro H
state_before: case _2_1
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
⊢ (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R

tactic: constructor
state_before: case _2_1
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
H :
  ∀ (f : R[X]),
    Monic f →
      ∀ (a₀ : ResidueField R),
        ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
⊢ HenselianLocalRing R

tactic: intro f hf a₀ h₁ h₂
state_before: case _2_1.is_henselian
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
H :
  ∀ (f : R[X]),
    Monic f →
      ∀ (a₀ : ResidueField R),
        ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
⊢ ∀ (f : R[X]),
    Monic f →
      ∀ (a₀ : R),
        Polynomial.eval a₀ f ∈ maximalIdeal R →
          IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R

tactic: specialize H f hf (residue R a₀)
state_before: case _2_1.is_henselian
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
H :
  ∀ (f : R[X]),
    Monic f →
      ∀ (a₀ : ResidueField R),
        ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₁ : Polynomial.eval a₀ f ∈ maximalIdeal R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
⊢ ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R

tactic: have aux := flip mem_nonunits_iff.mp h₂
state_before: case _2_1.is_henselian
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₁ : Polynomial.eval a₀ f ∈ maximalIdeal R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
H :
  ↑(aeval (↑(residue R) a₀)) f = 0 →
    ↑(aeval (↑(residue R) a₀)) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = ↑(residue R) a₀
⊢ ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R

tactic: simp only [aeval_def, ResidueField.algebraMap_eq, eval₂_at_apply, ←
  Ideal.Quotient.eq_zero_iff_mem, ← LocalRing.mem_maximalIdeal] at H h₁ aux
state_before: case _2_1.is_henselian
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₁ : Polynomial.eval a₀ f ∈ maximalIdeal R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
H :
  ↑(aeval (↑(residue R) a₀)) f = 0 →
    ↑(aeval (↑(residue R) a₀)) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = ↑(residue R) a₀
aux : Polynomial.eval a₀ (↑derivative f) ∈ nonunits R → False
⊢ ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R

tactic: obtain ⟨a, ha₁, ha₂⟩ := H h₁ aux
state_before: case _2_1.is_henselian
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
H :
  ↑(residue R) (Polynomial.eval a₀ f) = 0 →
    ↑(residue R) (Polynomial.eval a₀ (↑derivative f)) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = ↑(residue R) a₀
h₁ : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ f) = 0
aux : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ (↑derivative f)) = 0 → False
⊢ ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R

tactic: refine' ⟨a, ha₁, _⟩
state_before: case _2_1.is_henselian.intro.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
H :
  ↑(residue R) (Polynomial.eval a₀ f) = 0 →
    ↑(residue R) (Polynomial.eval a₀ (↑derivative f)) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = ↑(residue R) a₀
h₁ : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ f) = 0
aux : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ (↑derivative f)) = 0 → False
a : R
ha₁ : IsRoot f a
ha₂ : ↑(residue R) a = ↑(residue R) a₀
⊢ ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R

tactic: rw [← Ideal.Quotient.eq_zero_iff_mem]
state_before: case _2_1.is_henselian.intro.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
H :
  ↑(residue R) (Polynomial.eval a₀ f) = 0 →
    ↑(residue R) (Polynomial.eval a₀ (↑derivative f)) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = ↑(residue R) a₀
h₁ : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ f) = 0
aux : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ (↑derivative f)) = 0 → False
a : R
ha₁ : IsRoot f a
ha₂ : ↑(residue R) a = ↑(residue R) a₀
⊢ a - a₀ ∈ maximalIdeal R

tactic: rwa [← sub_eq_zero, ← RingHom.map_sub] at ha₂
state_before: case _2_1.is_henselian.intro.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
f : R[X]
hf : Monic f
a₀ : R
h₂ : IsUnit (Polynomial.eval a₀ (↑derivative f))
H :
  ↑(residue R) (Polynomial.eval a₀ f) = 0 →
    ↑(residue R) (Polynomial.eval a₀ (↑derivative f)) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = ↑(residue R) a₀
h₁ : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ f) = 0
aux : ↑(Ideal.Quotient.mk (maximalIdeal R)) (Polynomial.eval a₀ (↑derivative f)) = 0 → False
a : R
ha₁ : IsRoot f a
ha₂ : ↑(residue R) a = ↑(residue R) a₀
⊢ ↑(Ideal.Quotient.mk (maximalIdeal R)) (a - a₀) = 0

tactic: intro hR K _K φ hφ f hf a₀ h₁ h₂
state_before: case _1_3
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
⊢ HenselianLocalRing R →
    ∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀

tactic: obtain ⟨a₀, rfl⟩ := hφ a₀
state_before: case _1_3
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : K
h₁ : eval₂ φ a₀ f = 0
h₂ : eval₂ φ a₀ (↑derivative f) ≠ 0
⊢ ∃ a, IsRoot f a ∧ ↑φ a = a₀

tactic: have H := HenselianLocalRing.is_henselian f hf a₀
state_before: case _1_3.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
h₁ : eval₂ φ (↑φ a₀) f = 0
h₂ : eval₂ φ (↑φ a₀) (↑derivative f) ≠ 0
⊢ ∃ a, IsRoot f a ∧ ↑φ a = ↑φ a₀

tactic: simp only [← ker_eq_maximalIdeal φ hφ, eval₂_at_apply, RingHom.mem_ker φ] at H h₁ h₂
state_before: case _1_3.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
h₁ : eval₂ φ (↑φ a₀) f = 0
h₂ : eval₂ φ (↑φ a₀) (↑derivative f) ≠ 0
H :
  Polynomial.eval a₀ f ∈ maximalIdeal R →
    IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ a - a₀ ∈ maximalIdeal R
⊢ ∃ a, IsRoot f a ∧ ↑φ a = ↑φ a₀

tactic: obtain ⟨a, ha₁, ha₂⟩ := H h₁ (by
  contrapose! h₂
  rwa [← mem_nonunits_iff, ← LocalRing.mem_maximalIdeal, ← LocalRing.ker_eq_maximalIdeal φ hφ,
    RingHom.mem_ker] at h₂)
state_before: case _1_3.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
H : ↑φ (Polynomial.eval a₀ f) = 0 → IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ ↑φ (a - a₀) = 0
h₁ : ↑φ (Polynomial.eval a₀ f) = 0
h₂ : ↑φ (Polynomial.eval a₀ (↑derivative f)) ≠ 0
⊢ ∃ a, IsRoot f a ∧ ↑φ a = ↑φ a₀

tactic: refine' ⟨a, ha₁, _⟩
state_before: case _1_3.intro.intro.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
H : ↑φ (Polynomial.eval a₀ f) = 0 → IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ ↑φ (a - a₀) = 0
h₁ : ↑φ (Polynomial.eval a₀ f) = 0
h₂ : ↑φ (Polynomial.eval a₀ (↑derivative f)) ≠ 0
a : R
ha₁ : IsRoot f a
ha₂ : ↑φ (a - a₀) = 0
⊢ ∃ a, IsRoot f a ∧ ↑φ a = ↑φ a₀

tactic: rwa [φ.map_sub, sub_eq_zero] at ha₂
state_before: case _1_3.intro.intro.intro
R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
H : ↑φ (Polynomial.eval a₀ f) = 0 → IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ ↑φ (a - a₀) = 0
h₁ : ↑φ (Polynomial.eval a₀ f) = 0
h₂ : ↑φ (Polynomial.eval a₀ (↑derivative f)) ≠ 0
a : R
ha₁ : IsRoot f a
ha₂ : ↑φ (a - a₀) = 0
⊢ ↑φ a = ↑φ a₀

tactic: contrapose! h₂
state_before: R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
H : ↑φ (Polynomial.eval a₀ f) = 0 → IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ ↑φ (a - a₀) = 0
h₁ : ↑φ (Polynomial.eval a₀ f) = 0
h₂ : ↑φ (Polynomial.eval a₀ (↑derivative f)) ≠ 0
⊢ IsUnit (Polynomial.eval a₀ (↑derivative f))

tactic: rwa [← mem_nonunits_iff, ← LocalRing.mem_maximalIdeal, ← LocalRing.ker_eq_maximalIdeal φ hφ,
  RingHom.mem_ker] at h₂
state_before: R : Type u
inst✝¹ : CommRing R
inst✝ : LocalRing R
_3_2 :
  (∀ {K : Type u} [inst : Field K] (φ : R →+* K),
      Surjective ↑φ →
        ∀ (f : R[X]),
          Monic f → ∀ (a₀ : K), eval₂ φ a₀ f = 0 → eval₂ φ a₀ (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑φ a = a₀) →
    ∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀
_2_1 :
  (∀ (f : R[X]),
      Monic f →
        ∀ (a₀ : ResidueField R),
          ↑(aeval a₀) f = 0 → ↑(aeval a₀) (↑derivative f) ≠ 0 → ∃ a, IsRoot f a ∧ ↑(residue R) a = a₀) →
    HenselianLocalRing R
hR : HenselianLocalRing R
K : Type u
_K : Field K
φ : R →+* K
hφ : Surjective ↑φ
f : R[X]
hf : Monic f
a₀ : R
H : ↑φ (Polynomial.eval a₀ f) = 0 → IsUnit (Polynomial.eval a₀ (↑derivative f)) → ∃ a, IsRoot f a ∧ ↑φ (a - a₀) = 0
h₁ : ↑φ (Polynomial.eval a₀ f) = 0
h₂ : ¬IsUnit (Polynomial.eval a₀ (↑derivative f))
⊢ ↑φ (Polynomial.eval a₀ (↑derivative f)) = 0