l3lab/ntp-mathlib huggingface dataset:
theorem ofStep_succ (n : ℕ) : (ofStep k (n + 1)).comp (toStepSucc k n) = ofStep k n := by
  ext x
  have hx : toStepOfLE' k n (n+1) n.le_succ x = toStepSucc k n x := Nat.leRecOn_succ' x
  unfold ofStep
  rw [RingHom.comp_apply]
  dsimp [toStepOfLE]
  

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
x : Step k n
hx : AlgebraicClosure.toStepOfLE' k n (n + 1) (_ : n ≤ Nat.succ n) x = (toStepSucc k n) x
⊢ (Ring.DirectLimit.of (Step k) (fun i j h => AlgebraicClosure.toStepOfLE' k i j h) (n + 1)) ((toStepSucc k n) x) =
    (Ring.DirectLimit.of (Step k) (fun i j h => AlgebraicClosure.toStepOfLE' k i j h) n) x

Next tactic:
rw [← hx]
theorem ofStep_succ (n : ℕ) : (ofStep k (n + 1)).comp (toStepSucc k n) = ofStep k n := by
  ext x
  have hx : toStepOfLE' k n (n+1) n.le_succ x = toStepSucc k n x := Nat.leRecOn_succ' x
  unfold ofStep
  rw [RingHom.comp_apply]
  dsimp [toStepOfLE]
  rw [← hx]
  

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
x : Step k n
hx : AlgebraicClosure.toStepOfLE' k n (n + 1) (_ : n ≤ Nat.succ n) x = (toStepSucc k n) x
⊢ (Ring.DirectLimit.of (Step k) (fun i j h => AlgebraicClosure.toStepOfLE' k i j h) (n + 1))
      (AlgebraicClosure.toStepOfLE' k n (n + 1) (_ : n ≤ Nat.succ n) x) =
    (Ring.DirectLimit.of (Step k) (fun i j h => AlgebraicClosure.toStepOfLE' k i j h) n) x

Next tactic:
change Ring.DirectLimit.of (Step k) (toStepOfLE' k) (n + 1) (_) =
      Ring.DirectLimit.of (Step k) (toStepOfLE' k) n x
theorem ofStep_succ (n : ℕ) : (ofStep k (n + 1)).comp (toStepSucc k n) = ofStep k n := by
  ext x
  have hx : toStepOfLE' k n (n+1) n.le_succ x = toStepSucc k n x := Nat.leRecOn_succ' x
  unfold ofStep
  rw [RingHom.comp_apply]
  dsimp [toStepOfLE]
  rw [← hx]
  change Ring.DirectLimit.of (Step k) (toStepOfLE' k) (n + 1) (_) =
      Ring.DirectLimit.of (Step k) (toStepOfLE' k) n x
  

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
x : Step k n
hx : AlgebraicClosure.toStepOfLE' k n (n + 1) (_ : n ≤ Nat.succ n) x = (toStepSucc k n) x
⊢ (Ring.DirectLimit.of (Step k) (AlgebraicClosure.toStepOfLE' k) (n + 1))
      (AlgebraicClosure.toStepOfLE' k n (n + 1) (_ : n ≤ Nat.succ n) x) =
    (Ring.DirectLimit.of (Step k) (AlgebraicClosure.toStepOfLE' k) n) x

Next tactic:
convert Ring.DirectLimit.of_f n.le_succ x
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  

Proof state:
k : Type u
inst✝ : Field k
f : (AlgebraicClosureAux k)[X]
hfm : Monic f
hfi : Irreducible f
⊢ ∃ x, eval x f = 0

Next tactic:
have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    

Proof state:
k : Type u
inst✝ : Field k
f : (AlgebraicClosureAux k)[X]
hfm : Monic f
hfi : Irreducible f
⊢ ∃ n p, map (ofStep k n) p = f

Next tactic:
convert Ring.DirectLimit.Polynomial.exists_of f
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
  

Proof state:
k : Type u
inst✝ : Field k
f : (AlgebraicClosureAux k)[X]
hfm : Monic f
hfi : Irreducible f
this : ∃ n p, map (ofStep k n) p = f
⊢ ∃ x, eval x f = 0

Next tactic:
obtain ⟨n, p, rfl⟩ := this
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
  obtain ⟨n, p, rfl⟩ := this
  

Proof state:
case intro.intro
k : Type u
inst✝ : Field k
n : ℕ
p : (Step k n)[X]
hfm : Monic (map (ofStep k n) p)
hfi : Irreducible (map (ofStep k n) p)
⊢ ∃ x, eval x (map (ofStep k n) p) = 0

Next tactic:
rw [monic_map_iff] at hfm
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
  obtain ⟨n, p, rfl⟩ := this
  rw [monic_map_iff] at hfm
  

Proof state:
case intro.intro
k : Type u
inst✝ : Field k
n : ℕ
p : (Step k n)[X]
hfm : Monic p
hfi : Irreducible (map (ofStep k n) p)
⊢ ∃ x, eval x (map (ofStep k n) p) = 0

Next tactic:
have := hfm.irreducible_of_irreducible_map (ofStep k n) p hfi
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
  obtain ⟨n, p, rfl⟩ := this
  rw [monic_map_iff] at hfm
  have := hfm.irreducible_of_irreducible_map (ofStep k n) p hfi
  

Proof state:
case intro.intro
k : Type u
inst✝ : Field k
n : ℕ
p : (Step k n)[X]
hfm : Monic p
hfi : Irreducible (map (ofStep k n) p)
this : Irreducible p
⊢ ∃ x, eval x (map (ofStep k n) p) = 0

Next tactic:
obtain ⟨x, hx⟩ := toStepSucc.exists_root k hfm this
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
  obtain ⟨n, p, rfl⟩ := this
  rw [monic_map_iff] at hfm
  have := hfm.irreducible_of_irreducible_map (ofStep k n) p hfi
  obtain ⟨x, hx⟩ := toStepSucc.exists_root k hfm this
  

Proof state:
case intro.intro.intro
k : Type u
inst✝ : Field k
n : ℕ
p : (Step k n)[X]
hfm : Monic p
hfi : Irreducible (map (ofStep k n) p)
this : Irreducible p
x : Step k (n + 1)
hx : eval₂ (toStepSucc k n) x p = 0
⊢ ∃ x, eval x (map (ofStep k n) p) = 0

Next tactic:
refine' ⟨ofStep k (n + 1) x, _⟩
theorem exists_root {f : Polynomial (AlgebraicClosureAux k)}
    (hfm : f.Monic) (hfi : Irreducible f) : ∃ x : AlgebraicClosureAux k, f.eval x = 0 := by
  have : ∃ n p, Polynomial.map (ofStep k n) p = f := by
    convert Ring.DirectLimit.Polynomial.exists_of f
  obtain ⟨n, p, rfl⟩ := this
  rw [monic_map_iff] at hfm
  have := hfm.irreducible_of_irreducible_map (ofStep k n) p hfi
  obtain ⟨x, hx⟩ := toStepSucc.exists_root k hfm this
  refine' ⟨ofStep k (n + 1) x, _⟩
  

Proof state:
case intro.intro.intro
k : Type u
inst✝ : Field k
n : ℕ
p : (Step k n)[X]
hfm : Monic p
hfi : Irreducible (map (ofStep k n) p)
this : Irreducible p
x : Step k (n + 1)
hx : eval₂ (toStepSucc k n) x p = 0
⊢ eval ((ofStep k (n + 1)) x) (map (ofStep k n) p) = 0

Next tactic:
rw [← ofStep_succ k n, eval_map, ← hom_eval₂, hx, RingHom.map_zero]
/-- Canonical algebra embedding from the `n`th step to the algebraic closure. -/
def ofStepHom (n) : Step k n →ₐ[k] AlgebraicClosureAux k :=
  { ofStep k n with
    commutes' := by
    --Porting Note: Originally `(fun x => Ring.DirectLimit.of_f n.zero_le x)`
    -- I think one problem was in recognizing that we want `toStepOfLE` in `of_f`
      

Proof state:
k : Type u
inst✝ : Field k
n : ℕ
src✝ : Step k n →+* AlgebraicClosureAux k := ofStep k n
⊢ ∀ (r : k),
    OneHom.toFun
        (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : Step k n),
                    OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
        ((algebraMap k (Step k n)) r) =
      (algebraMap k (AlgebraicClosureAux k)) r

Next tactic:
intro x
/-- Canonical algebra embedding from the `n`th step to the algebraic closure. -/
def ofStepHom (n) : Step k n →ₐ[k] AlgebraicClosureAux k :=
  { ofStep k n with
    commutes' := by
    --Porting Note: Originally `(fun x => Ring.DirectLimit.of_f n.zero_le x)`
    -- I think one problem was in recognizing that we want `toStepOfLE` in `of_f`
      intro x
      

Proof state:
k : Type u
inst✝ : Field k
n : ℕ
src✝ : Step k n →+* AlgebraicClosureAux k := ofStep k n
x : k
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : Step k n),
                  OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      ((algebraMap k (Step k n)) x) =
    (algebraMap k (AlgebraicClosureAux k)) x

Next tactic:
simp only [RingHom.toMonoidHom_eq_coe, OneHom.toFun_eq_coe, MonoidHom.toOneHom_coe,
          MonoidHom.coe_coe]
/-- Canonical algebra embedding from the `n`th step to the algebraic closure. -/
def ofStepHom (n) : Step k n →ₐ[k] AlgebraicClosureAux k :=
  { ofStep k n with
    commutes' := by
    --Porting Note: Originally `(fun x => Ring.DirectLimit.of_f n.zero_le x)`
    -- I think one problem was in recognizing that we want `toStepOfLE` in `of_f`
      intro x
      simp only [RingHom.toMonoidHom_eq_coe, OneHom.toFun_eq_coe, MonoidHom.toOneHom_coe,
          MonoidHom.coe_coe]
      

Proof state:
k : Type u
inst✝ : Field k
n : ℕ
src✝ : Step k n →+* AlgebraicClosureAux k := ofStep k n
x : k
⊢ (ofStep k n) ((algebraMap k (Step k n)) x) = (algebraMap k (AlgebraicClosureAux k)) x

Next tactic:
convert @Ring.DirectLimit.of_f ℕ _ (Step k) _ (fun m n h => (toStepOfLE k m n h : _ → _))
          0 n n.zero_le x
/-- The equivalence between `AlgebraicClosure` and `AlgebraicClosureAux`, which we use to transfer
properties of `AlgebraicClosureAux` to `AlgebraicClosure` -/
def algEquivAlgebraicClosureAux :
    AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := by
  

Proof state:
k : Type u
inst✝ : Field k
⊢ AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k

Next tactic:
delta AlgebraicClosure
/-- The equivalence between `AlgebraicClosure` and `AlgebraicClosureAux`, which we use to transfer
properties of `AlgebraicClosureAux` to `AlgebraicClosure` -/
def algEquivAlgebraicClosureAux :
    AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := by
  delta AlgebraicClosure
  

Proof state:
k : Type u
inst✝ : Field k
⊢ (MvPolynomial (AlgebraicClosureAux k) k ⧸ RingHom.ker ↑(MvPolynomial.aeval id)) ≃ₐ[k] AlgebraicClosureAux k

Next tactic:
exact Ideal.quotientKerAlgEquivOfSurjective
    (fun x => ⟨MvPolynomial.X x, by simp⟩)
/-- The equivalence between `AlgebraicClosure` and `AlgebraicClosureAux`, which we use to transfer
properties of `AlgebraicClosureAux` to `AlgebraicClosure` -/
def algEquivAlgebraicClosureAux :
    AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := by
  delta AlgebraicClosure
  exact Ideal.quotientKerAlgEquivOfSurjective
    (fun x => ⟨MvPolynomial.X x, by 

Proof state:
k : Type u
inst✝ : Field k
x : AlgebraicClosureAux k
⊢ (MvPolynomial.aeval id) (MvPolynomial.X x) = x

Next tactic:
simp
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      change e (algebraMap k _ _) = _
      simp only [map_ratCast, map_natCast, map_mul, map_intCast, AlgEquiv.commutes,
        AlgEquiv.apply_symm_apply]
      apply Field.ratCast_mk
    exists_pair_ne := ⟨e.symm 0, e.symm 1, fun w => zero_ne_one ((e.symm).injective w)⟩
    mul_inv_cancel := fun a w => by
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : AlgebraicClosure k
w : a ≠ 0
⊢ a * a⁻¹ = 1

Next tactic:
apply_fun e
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      change e (algebraMap k _ _) = _
      simp only [map_ratCast, map_natCast, map_mul, map_intCast, AlgEquiv.commutes,
        AlgEquiv.apply_symm_apply]
      apply Field.ratCast_mk
    exists_pair_ne := ⟨e.symm 0, e.symm 1, fun w => zero_ne_one ((e.symm).injective w)⟩
    mul_inv_cancel := fun a w => by
      apply_fun e
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : AlgebraicClosure k
w : a ≠ 0
⊢ e (a * a⁻¹) = e 1

Next tactic:
simp_rw [map_mul, e.apply_symm_apply, map_one]
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      change e (algebraMap k _ _) = _
      simp only [map_ratCast, map_natCast, map_mul, map_intCast, AlgEquiv.commutes,
        AlgEquiv.apply_symm_apply]
      apply Field.ratCast_mk
    exists_pair_ne := ⟨e.symm 0, e.symm 1, fun w => zero_ne_one ((e.symm).injective w)⟩
    mul_inv_cancel := fun a w => by
      apply_fun e
      simp_rw [map_mul, e.apply_symm_apply, map_one]
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : AlgebraicClosure k
w : a ≠ 0
⊢ (algEquivAlgebraicClosureAux k) a * ((algEquivAlgebraicClosureAux k) a)⁻¹ = 1

Next tactic:
exact mul_inv_cancel ((AddEquivClass.map_ne_zero_iff e).mpr w)
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      change e (algebraMap k _ _) = _
      simp only [map_ratCast, map_natCast, map_mul, map_intCast, AlgEquiv.commutes,
        AlgEquiv.apply_symm_apply]
      apply Field.ratCast_mk
    exists_pair_ne := ⟨e.symm 0, e.symm 1, fun w => zero_ne_one ((e.symm).injective w)⟩
    mul_inv_cancel := fun a w => by
      apply_fun e
      simp_rw [map_mul, e.apply_symm_apply, map_one]
      exact mul_inv_cancel ((AddEquivClass.map_ne_zero_iff e).mpr w)
    inv_zero := by 

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
⊢ 0⁻¹ = 0

Next tactic:
simp
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : ℤ
b : ℕ
h1 : b ≠ 0
h2 : Nat.Coprime (Int.natAbs a) b
⊢ ↑(Rat.mk' a b) = ↑a * (↑b)⁻¹

Next tactic:
apply_fun e
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : ℤ
b : ℕ
h1 : b ≠ 0
h2 : Nat.Coprime (Int.natAbs a) b
⊢ e ↑(Rat.mk' a b) = e (↑a * (↑b)⁻¹)

Next tactic:
change e (algebraMap k _ _) = _
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      change e (algebraMap k _ _) = _
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : ℤ
b : ℕ
h1 : b ≠ 0
h2 : Nat.Coprime (Int.natAbs a) b
⊢ e ((algebraMap k (AlgebraicClosure k)) ↑(Rat.mk' a b)) = e (↑a * (↑b)⁻¹)

Next tactic:
simp only [map_ratCast, map_natCast, map_mul, map_intCast, AlgEquiv.commutes,
        AlgEquiv.apply_symm_apply]
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; simp [MvPolynomial.algebraMap_eq, Rat.smul_def]))
    ratCast_mk := fun a b h1 h2 => by
      apply_fun e
      change e (algebraMap k _ _) = _
      simp only [map_ratCast, map_natCast, map_mul, map_intCast, AlgEquiv.commutes,
        AlgEquiv.apply_symm_apply]
      

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : ℤ
b : ℕ
h1 : b ≠ 0
h2 : Nat.Coprime (Int.natAbs a) b
⊢ ↑(Rat.mk' a b) = ↑a * (↑b)⁻¹

Next tactic:
apply Field.ratCast_mk
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by 

Proof state:
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : ℚ
x : AlgebraicClosure k
p : MvPolynomial (AlgebraicClosureAux k) k
⊢ (fun x => a • x) p = (fun x x_1 => x * x_1) ((algebraMap k (MvPolynomial (AlgebraicClosureAux k) k)) ↑a) p

Next tactic:
ext
instance : Field (AlgebraicClosure k) :=
  letI e := algEquivAlgebraicClosureAux k
  { toCommRing := AlgebraicClosure.commRing k
    ratCast := fun a => algebraMap k _ (a : k)
    inv := fun a => e.symm (e a)⁻¹
    qsmul := (· • ·)
    qsmul_eq_mul' := fun a x =>
      Quotient.inductionOn x (fun p => congr_arg Quotient.mk''
        (by ext; 

Proof state:
case a
k : Type u
inst✝ : Field k
e : AlgebraicClosure k ≃ₐ[k] AlgebraicClosureAux k := algEquivAlgebraicClosureAux k
a : ℚ
x : AlgebraicClosure k
p : MvPolynomial (AlgebraicClosureAux k) k
m✝ : AlgebraicClosureAux k →₀ ℕ
⊢ MvPolynomial.coeff m✝ ((fun x => a • x) p) =
    MvPolynomial.coeff m✝ ((fun x x_1 => x * x_1) ((algebraMap k (MvPolynomial (AlgebraicClosureAux k) k)) ↑a) p)

Next tactic:
simp [MvPolynomial.algebraMap_eq, Rat.smul_def]
instance : IsAlgClosure k (AlgebraicClosure k) := by
  

Proof state:
k : Type u
inst✝ : Field k
⊢ IsAlgClosure k (AlgebraicClosure k)

Next tactic:
rw [isAlgClosure_iff]
instance : IsAlgClosure k (AlgebraicClosure k) := by
  rw [isAlgClosure_iff]
  

Proof state:
k : Type u
inst✝ : Field k
⊢ IsAlgClosed (AlgebraicClosure k) ∧ Algebra.IsAlgebraic k (AlgebraicClosure k)

Next tactic:
refine ⟨inferInstance, (algEquivAlgebraicClosureAux k).symm.isAlgebraic <|
    AlgebraicClosureAux.isAlgebraic _⟩
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f := by
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Countable ι
α : Type u_5
β : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace β
inst✝ : Subsingleton β
f : α → β
⊢ StronglyMeasurable f

Next tactic:
let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f := by
  let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
  · 

Proof state:
case refine_2
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Countable ι
α : Type u_5
β : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace β
inst✝ : Subsingleton β
f : α → β
f_sf : α →ₛ β :=
  { toFun := f, measurableSet_fiber' := (_ : ∀ (x : β), MeasurableSet (f ⁻¹' {x})),
    finite_range' := (_ : Set.Finite (range f)) }
⊢ StronglyMeasurable f

Next tactic:
exact ⟨fun _ => f_sf, fun x => tendsto_const_nhds⟩
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f := by
  let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
  · exact ⟨fun _ => f_sf, fun x => tendsto_const_nhds⟩
  · 

Proof state:
case refine_1
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Countable ι
α : Type u_5
β : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace β
inst✝ : Subsingleton β
f : α → β
x : β
⊢ MeasurableSet (f ⁻¹' {x})

Next tactic:
have h_univ : f ⁻¹' {x} = Set.univ := by
      ext1 y
      simp [eq_iff_true_of_subsingleton]
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f := by
  let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
  · exact ⟨fun _ => f_sf, fun x => tendsto_const_nhds⟩
  · have h_univ : f ⁻¹' {x} = Set.univ := by
      

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Countable ι
α : Type u_5
β : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace β
inst✝ : Subsingleton β
f : α → β
x : β
⊢ f ⁻¹' {x} = univ

Next tactic:
ext1 y
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f := by
  let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
  · exact ⟨fun _ => f_sf, fun x => tendsto_const_nhds⟩
  · have h_univ : f ⁻¹' {x} = Set.univ := by
      ext1 y
      

Proof state:
case h
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Countable ι
α : Type u_5
β : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace β
inst✝ : Subsingleton β
f : α → β
x : β
y : α
⊢ y ∈ f ⁻¹' {x} ↔ y ∈ univ

Next tactic:
simp [eq_iff_true_of_subsingleton]
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f := by
  let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
  · exact ⟨fun _ => f_sf, fun x => tendsto_const_nhds⟩
  · have h_univ : f ⁻¹' {x} = Set.univ := by
      ext1 y
      simp [eq_iff_true_of_subsingleton]
    

Proof state:
case refine_1
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Countable ι
α : Type u_5
β : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace β
inst✝ : Subsingleton β
f : α → β
x : β
h_univ : f ⁻¹' {x} = univ
⊢ MeasurableSet (f ⁻¹' {x})

Next tactic:
rw [h_univ]