l3lab/ntp-mathlib huggingface dataset:
/-- The canonical ring homomorphism to a step with a greater index. -/
def toStepOfLE (m n : ℕ) (h : m ≤ n) : Step k m →+* Step k n where
  toFun := toStepOfLE' k m n h
  map_one' := by
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 1`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_one]`
    induction' h with a h ih
    · exact Nat.leRecOn_self 1
    · rw [toStepOfLE'.succ k m a h]; simp [ih]
  map_mul' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_mul]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; simp_rw [Nat.leRecOn_self]
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 0`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_zero]`
  map_zero' := by
    induction' h with a h ih
    · 

Proof state:
case refl
k : Type u
inst✝ : Field k
m n : ℕ
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m),
              map_one' := (_ : AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : Step k m),
                OneHom.toFun
                    { toFun := AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m),
                      map_one' := (_ : AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m) 1 = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m),
                        map_one' := (_ : AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m) 1 = 1) }
                      x *
                    OneHom.toFun
                      { toFun := AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m),
                        map_one' := (_ : AlgebraicClosure.toStepOfLE' k m m (_ : Nat.le m m) 1 = 1) }
                      y) })
      0 =
    0

Next tactic:
exact Nat.leRecOn_self 0
/-- The canonical ring homomorphism to a step with a greater index. -/
def toStepOfLE (m n : ℕ) (h : m ≤ n) : Step k m →+* Step k n where
  toFun := toStepOfLE' k m n h
  map_one' := by
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 1`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_one]`
    induction' h with a h ih
    · exact Nat.leRecOn_self 1
    · rw [toStepOfLE'.succ k m a h]; simp [ih]
  map_mul' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_mul]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; simp_rw [Nat.leRecOn_self]
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 0`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_zero]`
  map_zero' := by
    induction' h with a h ih
    · exact Nat.leRecOn_self 0
    · simp_rw [toStepOfLE'.succ k m a h]; 

Proof state:
case step
k : Type u
inst✝ : Field k
m n a : ℕ
h : Nat.le m a
ih :
  OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := AlgebraicClosure.toStepOfLE' k m a h,
              map_one' := (_ : AlgebraicClosure.toStepOfLE' k m a h 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : Step k m),
                OneHom.toFun
                    { toFun := AlgebraicClosure.toStepOfLE' k m a h,
                      map_one' := (_ : AlgebraicClosure.toStepOfLE' k m a h 1 = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := AlgebraicClosure.toStepOfLE' k m a h,
                        map_one' := (_ : AlgebraicClosure.toStepOfLE' k m a h 1 = 1) }
                      x *
                    OneHom.toFun
                      { toFun := AlgebraicClosure.toStepOfLE' k m a h,
                        map_one' := (_ : AlgebraicClosure.toStepOfLE' k m a h 1 = 1) }
                      y) })
      0 =
    0
⊢ (⇑(toStepSucc k a) ∘ AlgebraicClosure.toStepOfLE' k m a h) 0 = 0

Next tactic:
simp only at ih
/-- The canonical ring homomorphism to a step with a greater index. -/
def toStepOfLE (m n : ℕ) (h : m ≤ n) : Step k m →+* Step k n where
  toFun := toStepOfLE' k m n h
  map_one' := by
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 1`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_one]`
    induction' h with a h ih
    · exact Nat.leRecOn_self 1
    · rw [toStepOfLE'.succ k m a h]; simp [ih]
  map_mul' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_mul]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; simp_rw [Nat.leRecOn_self]
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 0`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_zero]`
  map_zero' := by
    induction' h with a h ih
    · exact Nat.leRecOn_self 0
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; 

Proof state:
case step
k : Type u
inst✝ : Field k
m n a : ℕ
h : Nat.le m a
ih : AlgebraicClosure.toStepOfLE' k m a h 0 = 0
⊢ (⇑(toStepSucc k a) ∘ AlgebraicClosure.toStepOfLE' k m a h) 0 = 0

Next tactic:
simp [ih]
/-- The canonical ring homomorphism to a step with a greater index. -/
def toStepOfLE (m n : ℕ) (h : m ≤ n) : Step k m →+* Step k n where
  toFun := toStepOfLE' k m n h
  map_one' := by
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 1`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_one]`
    induction' h with a h ih
    · exact Nat.leRecOn_self 1
    · rw [toStepOfLE'.succ k m a h]; simp [ih]
  map_mul' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_mul]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; simp_rw [Nat.leRecOn_self]
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 0`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_zero]`
  map_zero' := by
    induction' h with a h ih
    · exact Nat.leRecOn_self 0
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
  map_add' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_add]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; 

Proof state:
case refl
k : Type u
inst✝ : Field k
m n : ℕ
x y : Step k m
⊢ Nat.leRecOn (_ : Nat.le m m) (fun a => ⇑(toStepSucc k a)) (x + y) =
    Nat.leRecOn (_ : Nat.le m m) (fun a => ⇑(toStepSucc k a)) x +
      Nat.leRecOn (_ : Nat.le m m) (fun a => ⇑(toStepSucc k a)) y

Next tactic:
simp_rw [Nat.leRecOn_self]
/-- The canonical ring homomorphism to a step with a greater index. -/
def toStepOfLE (m n : ℕ) (h : m ≤ n) : Step k m →+* Step k n where
  toFun := toStepOfLE' k m n h
  map_one' := by
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 1`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_one]`
    induction' h with a h ih
    · exact Nat.leRecOn_self 1
    · rw [toStepOfLE'.succ k m a h]; simp [ih]
  map_mul' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_mul]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; simp_rw [Nat.leRecOn_self]
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
-- Porting note: original proof was `induction' h with n h ih; · exact Nat.leRecOn_self 0`
--                                   `rw [Nat.leRecOn_succ h, ih, RingHom.map_zero]`
  map_zero' := by
    induction' h with a h ih
    · exact Nat.leRecOn_self 0
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; simp [ih]
  map_add' x y := by
-- Porting note: original proof was `induction' h with n h ih; · simp_rw [Nat.leRecOn_self]`
--                                   `simp_rw [Nat.leRecOn_succ h, ih, RingHom.map_add]`
    induction' h with a h ih
    · dsimp [toStepOfLE']; simp_rw [Nat.leRecOn_self]
    · simp_rw [toStepOfLE'.succ k m a h]; simp only at ih; 

Proof state:
case step
k : Type u
inst✝ : Field k
m n : ℕ
x y : Step k m
a : ℕ
h : Nat.le m a
ih :
  AlgebraicClosure.toStepOfLE' k m a h (x + y) =
    AlgebraicClosure.toStepOfLE' k m a h x + AlgebraicClosure.toStepOfLE' k m a h y
⊢ (⇑(toStepSucc k a) ∘ AlgebraicClosure.toStepOfLE' k m a h) (x + y) =
    (⇑(toStepSucc k a) ∘ AlgebraicClosure.toStepOfLE' k m a h) x +
      (⇑(toStepSucc k a) ∘ AlgebraicClosure.toStepOfLE' k m a h) y

Next tactic:
simp [ih]
private theorem toStepOfLE.succ (n : ℕ) (h : 0 ≤ n) :
    toStepOfLE k 0 (n + 1) (h.trans n.le_succ) =
    (toStepSucc k n).comp (toStepOfLE k 0 n h) := by
    

Proof state:
k : Type u
inst✝ : Field k
n : ℕ
h : 0 ≤ n
⊢ toStepOfLE k 0 (n + 1) (_ : 0 ≤ n + 1) = RingHom.comp (toStepSucc k n) (toStepOfLE k 0 n h)

Next tactic:
ext1 x
private theorem toStepOfLE.succ (n : ℕ) (h : 0 ≤ n) :
    toStepOfLE k 0 (n + 1) (h.trans n.le_succ) =
    (toStepSucc k n).comp (toStepOfLE k 0 n h) := by
    ext1 x
    

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
h : 0 ≤ n
x : Step k 0
⊢ (toStepOfLE k 0 (n + 1) (_ : 0 ≤ n + 1)) x = (RingHom.comp (toStepSucc k n) (toStepOfLE k 0 n h)) x

Next tactic:
rw [RingHom.comp_apply]
private theorem toStepOfLE.succ (n : ℕ) (h : 0 ≤ n) :
    toStepOfLE k 0 (n + 1) (h.trans n.le_succ) =
    (toStepSucc k n).comp (toStepOfLE k 0 n h) := by
    ext1 x
    rw [RingHom.comp_apply]
    

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
h : 0 ≤ n
x : Step k 0
⊢ (toStepOfLE k 0 (n + 1) (_ : 0 ≤ n + 1)) x = (toStepSucc k n) ((toStepOfLE k 0 n h) x)

Next tactic:
simp only [toStepOfLE, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
private theorem toStepOfLE.succ (n : ℕ) (h : 0 ≤ n) :
    toStepOfLE k 0 (n + 1) (h.trans n.le_succ) =
    (toStepSucc k n).comp (toStepOfLE k 0 n h) := by
    ext1 x
    rw [RingHom.comp_apply]
    simp only [toStepOfLE, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
    

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
h : 0 ≤ n
x : Step k 0
⊢ AlgebraicClosure.toStepOfLE' k 0 (n + 1) (_ : 0 ≤ n + 1) x = (toStepSucc k n) (AlgebraicClosure.toStepOfLE' k 0 n h x)

Next tactic:
change _ = (_ ∘ _) x
private theorem toStepOfLE.succ (n : ℕ) (h : 0 ≤ n) :
    toStepOfLE k 0 (n + 1) (h.trans n.le_succ) =
    (toStepSucc k n).comp (toStepOfLE k 0 n h) := by
    ext1 x
    rw [RingHom.comp_apply]
    simp only [toStepOfLE, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
    change _ = (_ ∘ _) x
    

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
h : 0 ≤ n
x : Step k 0
⊢ AlgebraicClosure.toStepOfLE' k 0 (n + 1) (_ : 0 ≤ n + 1) x =
    (⇑(toStepSucc k n) ∘ AlgebraicClosure.toStepOfLE' k 0 n h) x

Next tactic:
rw [toStepOfLE'.succ k 0 n h]
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  

Proof state:
k : Type u
inst✝ : Field k
n : ℕ
⊢ ∀ (z : Step k n), IsIntegral k z

Next tactic:
induction' n with a h
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · 

Proof state:
case zero
k : Type u
inst✝ : Field k
⊢ ∀ (z : Step k Nat.zero), IsIntegral k z

Next tactic:
intro z
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    

Proof state:
case zero
k : Type u
inst✝ : Field k
z : Step k Nat.zero
⊢ IsIntegral k z

Next tactic:
exact isIntegral_algebraMap
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · 

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ ∀ (z : Step k (Nat.succ a)), IsIntegral k z

Next tactic:
intro z
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
z : Step k (Nat.succ a)
⊢ IsIntegral k z

Next tactic:
change RingHom.IsIntegralElem _ _
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
z : Step k (Nat.succ a)
⊢ RingHom.IsIntegralElem (algebraMap k (Step k (Nat.succ a))) z

Next tactic:
revert z
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ ∀ (z : Step k (Nat.succ a)), RingHom.IsIntegralElem (algebraMap k (Step k (Nat.succ a))) z

Next tactic:
change RingHom.IsIntegral _
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (algebraMap k (Step k (Nat.succ a)))

Next tactic:
unfold algebraMap
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral Algebra.toRingHom

Next tactic:
unfold Algebra.toRingHom
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (algebra k (Nat.succ a)).2

Next tactic:
unfold algebra
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (RingHom.toAlgebra (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a))).2

Next tactic:
unfold RingHom.toAlgebra
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral
    (RingHom.toAlgebra' (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a))
        (_ :
          ∀ (x : Step k 0) (b : Step k (Nat.succ a)),
            (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a)) x * b =
              b * (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a)) x)).2

Next tactic:
unfold RingHom.toAlgebra'
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral
    (Algebra.mk (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a))
        (_ :
          ∀ (x : Step k 0) (b : Step k (Nat.succ a)),
            (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a)) x * b =
              b * (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a)) x)
        (_ : ∀ (x : Step k 0) (x_1 : Step k (Nat.succ a)), x • x_1 = x • x_1)).2

Next tactic:
simp only
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    simp only
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (toStepOfLE k 0 (Nat.succ a) (_ : 0 ≤ Nat.succ a))

Next tactic:
rw [toStepOfLE.succ k a a.zero_le]
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    simp only
    rw [toStepOfLE.succ k a a.zero_le]
    

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (RingHom.comp (toStepSucc k a) (toStepOfLE k 0 a (_ : 0 ≤ a)))

Next tactic:
apply @RingHom.IsIntegral.trans (Step k 0) (Step k a) (Step k (a + 1)) _ _ _
        (toStepOfLE k 0 a (a.zero_le : 0 ≤ a)) (toStepSucc k a) _
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    simp only
    rw [toStepOfLE.succ k a a.zero_le]
    apply @RingHom.IsIntegral.trans (Step k 0) (Step k a) (Step k (a + 1)) _ _ _
        (toStepOfLE k 0 a (a.zero_le : 0 ≤ a)) (toStepSucc k a) _
    · 

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (toStepSucc k a)

Next tactic:
intro z
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    simp only
    rw [toStepOfLE.succ k a a.zero_le]
    apply @RingHom.IsIntegral.trans (Step k 0) (Step k a) (Step k (a + 1)) _ _ _
        (toStepOfLE k 0 a (a.zero_le : 0 ≤ a)) (toStepSucc k a) _
    · intro z
      

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
z : Step k (a + 1)
⊢ RingHom.IsIntegralElem (toStepSucc k a) z

Next tactic:
have := AdjoinMonic.isIntegral (Step k a) (z : Step k (a + 1))
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    simp only
    rw [toStepOfLE.succ k a a.zero_le]
    apply @RingHom.IsIntegral.trans (Step k 0) (Step k a) (Step k (a + 1)) _ _ _
        (toStepOfLE k 0 a (a.zero_le : 0 ≤ a)) (toStepSucc k a) _
    · intro z
      have := AdjoinMonic.isIntegral (Step k a) (z : Step k (a + 1))
      

Proof state:
case succ
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
z : Step k (a + 1)
this : IsIntegral (Step k a) z
⊢ RingHom.IsIntegralElem (toStepSucc k a) z

Next tactic:
convert this
theorem Step.isIntegral (n) : ∀ z : Step k n, IsIntegral k z := by
  induction' n with a h
  · intro z
    exact isIntegral_algebraMap
  · intro z
    change RingHom.IsIntegralElem _ _
    revert z
    change RingHom.IsIntegral _
    unfold algebraMap
    unfold Algebra.toRingHom
    unfold algebra
    unfold RingHom.toAlgebra
    unfold RingHom.toAlgebra'
    simp only
    rw [toStepOfLE.succ k a a.zero_le]
    apply @RingHom.IsIntegral.trans (Step k 0) (Step k a) (Step k (a + 1)) _ _ _
        (toStepOfLE k 0 a (a.zero_le : 0 ≤ a)) (toStepSucc k a) _
    · intro z
      have := AdjoinMonic.isIntegral (Step k a) (z : Step k (a + 1))
      convert this
    · 

Proof state:
k : Type u
inst✝ : Field k
a : ℕ
h : ∀ (z : Step k a), IsIntegral k z
⊢ RingHom.IsIntegral (toStepOfLE k 0 a (_ : 0 ≤ a))

Next tactic:
convert h
theorem ofStep_succ (n : ℕ) : (ofStep k (n + 1)).comp (toStepSucc k n) = ofStep k n := by
  

Proof state:
k : Type u
inst✝ : Field k
n : ℕ
⊢ RingHom.comp (ofStep k (n + 1)) (toStepSucc k n) = ofStep k n

Next tactic:
ext x
theorem ofStep_succ (n : ℕ) : (ofStep k (n + 1)).comp (toStepSucc k n) = ofStep k n := by
  ext x
  

Proof state:
case a
k : Type u
inst✝ : Field k
n : ℕ
x : Step k n
⊢ (RingHom.comp (ofStep k (n + 1)) (toStepSucc k n)) x = (ofStep k n) x

Next tactic:
have hx : toStepOfLE' k n (n+1) n.le_succ x = toStepSucc k n x := Nat.leRecOn_succ' 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
  

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
⊢ (RingHom.comp (ofStep k (n + 1)) (toStepSucc k n)) x = (ofStep k n) x

Next tactic:
unfold ofStep
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
  

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
⊢ (RingHom.comp (Ring.DirectLimit.of (Step k) (fun i j h => ⇑(toStepOfLE k i j h)) (n + 1)) (toStepSucc k n)) x =
    (Ring.DirectLimit.of (Step k) (fun i j h => ⇑(toStepOfLE k i j h)) n) x

Next tactic:
rw [RingHom.comp_apply]
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]
  

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 => ⇑(toStepOfLE k i j h)) (n + 1)) ((toStepSucc k n) x) =
    (Ring.DirectLimit.of (Step k) (fun i j h => ⇑(toStepOfLE k i j h)) n) x

Next tactic:
dsimp [toStepOfLE]