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

tactic: let leval : R[X] →ₗ[R] A := (aeval x).toLinearMap
state_before: R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
⊢ IsIntegral R x

tactic: let D : ℕ → Submodule R A := fun n => (degreeLE R n).map leval
state_before: R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
⊢ IsIntegral R x

tactic: let M := WellFounded.min (isNoetherian_iff_wellFounded.1 H) (Set.range D) ⟨_, ⟨0, rfl⟩⟩
state_before: R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
⊢ IsIntegral R x

tactic: have HM : M ∈ Set.range D := WellFounded.min_mem _ _ _
state_before: R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
⊢ IsIntegral R x

tactic: cases' HM with N HN
state_before: R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
HM : M ∈ Set.range D
⊢ IsIntegral R x

tactic: have HM : ¬M < D (N + 1) :=
  WellFounded.not_lt_min (isNoetherian_iff_wellFounded.1 H) (Set.range D) _ ⟨N + 1, rfl⟩
state_before: case intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
⊢ IsIntegral R x

tactic: rw [← HN] at HM
state_before: case intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬M < D (N + 1)
⊢ IsIntegral R x

tactic: have HN2 : D (N + 1) ≤ D N :=
  _root_.by_contradiction fun H =>
    HM (lt_of_le_not_le (map_mono (degreeLE_mono (WithBot.coe_le_coe.2 (Nat.le_succ N)))) H)
state_before: case intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬D N < D (N + 1)
⊢ IsIntegral R x

tactic: have HN3 : leval (X ^ (N + 1)) ∈ D N := HN2 (mem_map_of_mem (mem_degreeLE.2 (degree_X_pow_le _)))
state_before: case intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬D N < D (N + 1)
HN2 : D (N + 1) ≤ D N
⊢ IsIntegral R x

tactic: rcases HN3 with ⟨p, hdp, hpe⟩
state_before: case intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬D N < D (N + 1)
HN2 : D (N + 1) ≤ D N
HN3 : ↑leval (X ^ (N + 1)) ∈ D N
⊢ IsIntegral R x

tactic: refine' ⟨X ^ (N + 1) - p, monic_X_pow_sub (mem_degreeLE.1 hdp), _⟩
state_before: case intro.intro.intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬D N < D (N + 1)
HN2 : D (N + 1) ≤ D N
p : R[X]
hdp : p ∈ ↑(degreeLE R ↑N)
hpe : ↑leval p = ↑leval (X ^ (N + 1))
⊢ IsIntegral R x

tactic: show leval (X ^ (N + 1) - p) = 0
state_before: case intro.intro.intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬D N < D (N + 1)
HN2 : D (N + 1) ≤ D N
p : R[X]
hdp : p ∈ ↑(degreeLE R ↑N)
hpe : ↑leval p = ↑leval (X ^ (N + 1))
⊢ eval₂ (algebraMap R A) x (X ^ (N + 1) - p) = 0

tactic: rw [LinearMap.map_sub, hpe, sub_self]
state_before: case intro.intro.intro
R : Type u_1
S : Type ?u.77479
A : Type u_2
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
H : IsNoetherian R A
x : A
leval : R[X] →ₗ[R] A := AlgHom.toLinearMap (aeval x)
D : ℕ → Submodule R A := fun n => Submodule.map leval (degreeLE R ↑n)
M : Submodule R A := WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range D) (_ : ∃ x, x ∈ Set.range D)
N : ℕ
HN : D N = M
HM : ¬D N < D (N + 1)
HN2 : D (N + 1) ≤ D N
p : R[X]
hdp : p ∈ ↑(degreeLE R ↑N)
hpe : ↑leval p = ↑leval (X ^ (N + 1))
⊢ ↑leval (X ^ (N + 1) - p) = 0