Theorem: isIntegral_of_submodule_noetherian
File: Mathlib/RingTheory/IntegralClosure.lean

tactic: suffices IsIntegral R (show S from ⟨x, hx⟩) by
  rcases this with ⟨p, hpm, hpx⟩
  replace hpx := congr_arg S.val hpx
  refine' ⟨p, hpm, Eq.trans _ hpx⟩
  simp only [aeval_def, eval₂, sum_def]
  rw [S.val.map_sum]
  refine' Finset.sum_congr rfl fun n _hn => _
  rw [S.val.map_mul, S.val.map_pow, S.val.commutes, S.val_apply, Subtype.coe_mk]
state_before: R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
⊢ IsIntegral R x

tactic: refine' isIntegral_of_noetherian H ⟨x, hx⟩
state_before: R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
⊢ IsIntegral R
    (let_fun this := { val := x, property := hx };
    this)

tactic: rcases this with ⟨p, hpm, hpx⟩
state_before: R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
this :
  IsIntegral R
    (let_fun this := { val := x, property := hx };
    this)
⊢ IsIntegral R x

tactic: replace hpx := congr_arg S.val hpx
state_before: case intro.intro
R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
p : R[X]
hpm : Monic p
hpx :
  eval₂ (algebraMap R { x // x ∈ S })
      (let_fun this := { val := x, property := hx };
      this)
      p =
    0
⊢ IsIntegral R x

tactic: refine' ⟨p, hpm, Eq.trans _ hpx⟩
state_before: case intro.intro
R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
p : R[X]
hpm : Monic p
hpx :
  ↑(Subalgebra.val S)
      (eval₂ (algebraMap R { x // x ∈ S })
        (let_fun this := { val := x, property := hx };
        this)
        p) =
    ↑(Subalgebra.val S) 0
⊢ IsIntegral R x

tactic: simp only [aeval_def, eval₂, sum_def]
state_before: case intro.intro
R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
p : R[X]
hpm : Monic p
hpx :
  ↑(Subalgebra.val S)
      (eval₂ (algebraMap R { x // x ∈ S })
        (let_fun this := { val := x, property := hx };
        this)
        p) =
    ↑(Subalgebra.val S) 0
⊢ eval₂ (algebraMap R A) x p =
    ↑(Subalgebra.val S)
      (eval₂ (algebraMap R { x // x ∈ S })
        (let_fun this := { val := x, property := hx };
        this)
        p)

tactic: rw [S.val.map_sum]
state_before: case intro.intro
R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
p : R[X]
hpm : Monic p
hpx :
  ↑(Subalgebra.val S)
      (eval₂ (algebraMap R { x // x ∈ S })
        (let_fun this := { val := x, property := hx };
        this)
        p) =
    ↑(Subalgebra.val S) 0
⊢ ∑ n in support p, ↑(algebraMap R A) (coeff p n) * x ^ n =
    ↑(Subalgebra.val S)
      (∑ n in support p, ↑(algebraMap R { x // x ∈ S }) (coeff p n) * { val := x, property := hx } ^ n)

tactic: refine' Finset.sum_congr rfl fun n _hn => _
state_before: case intro.intro
R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
p : R[X]
hpm : Monic p
hpx :
  ↑(Subalgebra.val S)
      (eval₂ (algebraMap R { x // x ∈ S })
        (let_fun this := { val := x, property := hx };
        this)
        p) =
    ↑(Subalgebra.val S) 0
⊢ ∑ n in support p, ↑(algebraMap R A) (coeff p n) * x ^ n =
    ∑ x_1 in support p,
      ↑(Subalgebra.val S) (↑(algebraMap R { x // x ∈ S }) (coeff p x_1) * { val := x, property := hx } ^ x_1)

tactic: rw [S.val.map_mul, S.val.map_pow, S.val.commutes, S.val_apply, Subtype.coe_mk]
state_before: case intro.intro
R : Type u_1
S✝ : Type ?u.86903
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S✝
f : R →+* S✝
inst✝ : Algebra R A
S : Subalgebra R A
H : IsNoetherian R { x // x ∈ ↑Subalgebra.toSubmodule S }
x : A
hx : x ∈ S
p : R[X]
hpm : Monic p
hpx :
  ↑(Subalgebra.val S)
      (eval₂ (algebraMap R { x // x ∈ S })
        (let_fun this := { val := x, property := hx };
        this)
        p) =
    ↑(Subalgebra.val S) 0
n : ℕ
_hn : n ∈ support p
⊢ ↑(algebraMap R A) (coeff p n) * x ^ n =
    ↑(Subalgebra.val S) (↑(algebraMap R { x // x ∈ S }) (coeff p n) * { val := x, property := hx } ^ n)