[GOAL]
R : Type u_1
S : Type u_2
A : Type u_3
inst✝³ : CommRing R
inst✝² : Ring A
inst✝¹ : Ring S
f : R →+* S
inst✝ : Algebra R A
x : R
⊢ eval₂ f (↑f x) (X - ↑C x) = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
let leval : R[X] →ₗ[R] A := (aeval x).toLinearMap
[GOAL]
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
let D : ℕ → Submodule R A := fun n => (degreeLE R n).map leval
[GOAL]
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
let M := WellFounded.min (isNoetherian_iff_wellFounded.1 H) (Set.range D) ⟨_, ⟨0, rfl⟩⟩
[GOAL]
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
have HM : M ∈ Set.range D := WellFounded.min_mem _ _ _
[GOAL]
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
cases' HM with N HN
[GOAL]
case intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
have HM : ¬M < D (N + 1) := WellFounded.not_lt_min (isNoetherian_iff_wellFounded.1 H) (Set.range D) _ ⟨N + 1, rfl⟩
[GOAL]
case intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
rw [← HN] at HM 
[GOAL]
case intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
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)
[GOAL]
case intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
have HN3 : leval (X ^ (N + 1)) ∈ D N := HN2 (mem_map_of_mem (mem_degreeLE.2 (degree_X_pow_le _)))
[GOAL]
case intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
rcases HN3 with ⟨p, hdp, hpe⟩
[GOAL]
case intro.intro.intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
refine' ⟨X ^ (N + 1) - p, monic_X_pow_sub (mem_degreeLE.1 hdp), _⟩
[GOAL]
case intro.intro.intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
show leval (X ^ (N + 1) - p) = 0
[GOAL]
case intro.intro.intro
R : Type u_1
S : Type u_2
A : Type u_3
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
[PROOFSTEP]
rw [LinearMap.map_sub, hpe, sub_self]
[GOAL]
R : Type u_1
S✝ : Type u_2
A : Type u_3
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
[PROOFSTEP]
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]
[GOAL]
R : Type u_1
S✝ : Type u_2
A : Type u_3
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
[PROOFSTEP]
rcases this with ⟨p, hpm, hpx⟩
[GOAL]
case intro.intro
R : Type u_1
S✝ : Type u_2
A : Type u_3
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
[PROOFSTEP]
replace hpx := congr_arg S.val hpx
[GOAL]
case intro.intro
R : Type u_1
S✝ : Type u_2
A : Type u_3
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
[PROOFSTEP]
refine' ⟨p, hpm, Eq.trans _ hpx⟩
[GOAL]
case intro.intro
R : Type u_1
S✝ : Type u_2
A : Type u_3
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)
[PROOFSTEP]
simp only [aeval_def, eval₂, sum_def]
[GOAL]
case intro.intro
R : Type u_1
S✝ : Type u_2
A : Type u_3
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)
[PROOFSTEP]
rw [S.val.map_sum]
[GOAL]
case intro.intro
R : Type u_1
S✝ : Type u_2
A : Type u_3
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)
[PROOFSTEP]
refine' Finset.sum_congr rfl fun n _hn => _
[GOAL]
case intro.intro
R : Type u_1
S✝ : Type u_2
A : Type u_3
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)
[PROOFSTEP]
rw [S.val.map_mul, S.val.map_pow, S.val.commutes, S.val_apply, Subtype.coe_mk]
[GOAL]
R : Type u_1
S✝ : Type u_2
A : Type u_3
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)
[PROOFSTEP]
refine' isIntegral_of_noetherian H ⟨x, hx⟩
[GOAL]
R : Type u_1
A : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : CommRing B✝
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R A
inst✝⁹ : Algebra R B✝
f✝ : R →+* S
B : Type u_5
C : Type u_6
F : Type u_7
inst✝⁸ : Ring B
inst✝⁷ : Ring C
inst✝⁶ : Algebra R B
inst✝⁵ : Algebra A B
inst✝⁴ : Algebra R C
inst✝³ : IsScalarTower R A B
inst✝² : Algebra A C
inst✝¹ : IsScalarTower R A C
b : B
inst✝ : AlgHomClass F A B C
f : F
hb : IsIntegral R b
⊢ IsIntegral R (↑f b)
[PROOFSTEP]
obtain ⟨P, hP⟩ := hb
[GOAL]
case intro
R : Type u_1
A : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : CommRing B✝
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R A
inst✝⁹ : Algebra R B✝
f✝ : R →+* S
B : Type u_5
C : Type u_6
F : Type u_7
inst✝⁸ : Ring B
inst✝⁷ : Ring C
inst✝⁶ : Algebra R B
inst✝⁵ : Algebra A B
inst✝⁴ : Algebra R C
inst✝³ : IsScalarTower R A B
inst✝² : Algebra A C
inst✝¹ : IsScalarTower R A C
b : B
inst✝ : AlgHomClass F A B C
f : F
P : R[X]
hP : Monic P ∧ eval₂ (algebraMap R B) b P = 0
⊢ IsIntegral R (↑f b)
[PROOFSTEP]
refine' ⟨P, hP.1, _⟩
[GOAL]
case intro
R : Type u_1
A : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : CommRing B✝
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R A
inst✝⁹ : Algebra R B✝
f✝ : R →+* S
B : Type u_5
C : Type u_6
F : Type u_7
inst✝⁸ : Ring B
inst✝⁷ : Ring C
inst✝⁶ : Algebra R B
inst✝⁵ : Algebra A B
inst✝⁴ : Algebra R C
inst✝³ : IsScalarTower R A B
inst✝² : Algebra A C
inst✝¹ : IsScalarTower R A C
b : B
inst✝ : AlgHomClass F A B C
f : F
P : R[X]
hP : Monic P ∧ eval₂ (algebraMap R B) b P = 0
⊢ eval₂ (algebraMap R ((fun x => C) b)) (↑f b) P = 0
[PROOFSTEP]
rw [← aeval_def, show (aeval (f b)) P = (aeval (f b)) (P.map (algebraMap R A)) by simp, aeval_algHom_apply,
  aeval_map_algebraMap, aeval_def, hP.2, _root_.map_zero]
[GOAL]
R : Type u_1
A : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing A
inst✝¹² : CommRing B✝
inst✝¹¹ : CommRing S
inst✝¹⁰ : Algebra R A
inst✝⁹ : Algebra R B✝
f✝ : R →+* S
B : Type u_5
C : Type u_6
F : Type u_7
inst✝⁸ : Ring B
inst✝⁷ : Ring C
inst✝⁶ : Algebra R B
inst✝⁵ : Algebra A B
inst✝⁴ : Algebra R C
inst✝³ : IsScalarTower R A B
inst✝² : Algebra A C
inst✝¹ : IsScalarTower R A C
b : B
inst✝ : AlgHomClass F A B C
f : F
P : R[X]
hP : Monic P ∧ eval₂ (algebraMap R B) b P = 0
⊢ ↑(aeval (↑f b)) P = ↑(aeval (↑f b)) (Polynomial.map (algebraMap R A) P)
[PROOFSTEP]
simp
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝¹¹ : CommRing R✝
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : CommRing S✝
inst✝⁷ : Algebra R✝ A
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
R : Type u_5
S : Type u_6
T : Type u_7
U : Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
inst✝³ : CommRing T
inst✝² : CommRing U
inst✝¹ : Algebra R S
inst✝ : Algebra T U
φ : R →+* T
ψ : S →+* U
h : RingHom.comp (algebraMap T U) φ = RingHom.comp ψ (algebraMap R S)
a : S
ha : IsIntegral R a
⊢ IsIntegral T (↑ψ a)
[PROOFSTEP]
rw [IsIntegral, RingHom.IsIntegralElem] at ha ⊢
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝¹¹ : CommRing R✝
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : CommRing S✝
inst✝⁷ : Algebra R✝ A
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
R : Type u_5
S : Type u_6
T : Type u_7
U : Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
inst✝³ : CommRing T
inst✝² : CommRing U
inst✝¹ : Algebra R S
inst✝ : Algebra T U
φ : R →+* T
ψ : S →+* U
h : RingHom.comp (algebraMap T U) φ = RingHom.comp ψ (algebraMap R S)
a : S
ha : ∃ p, Monic p ∧ eval₂ (algebraMap R S) a p = 0
⊢ ∃ p, Monic p ∧ eval₂ (algebraMap T ((fun x => U) a)) (↑ψ a) p = 0
[PROOFSTEP]
obtain ⟨p, hp⟩ := ha
[GOAL]
case intro
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝¹¹ : CommRing R✝
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : CommRing S✝
inst✝⁷ : Algebra R✝ A
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
R : Type u_5
S : Type u_6
T : Type u_7
U : Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
inst✝³ : CommRing T
inst✝² : CommRing U
inst✝¹ : Algebra R S
inst✝ : Algebra T U
φ : R →+* T
ψ : S →+* U
h : RingHom.comp (algebraMap T U) φ = RingHom.comp ψ (algebraMap R S)
a : S
p : R[X]
hp : Monic p ∧ eval₂ (algebraMap R S) a p = 0
⊢ ∃ p, Monic p ∧ eval₂ (algebraMap T ((fun x => U) a)) (↑ψ a) p = 0
[PROOFSTEP]
refine' ⟨p.map φ, hp.left.map _, _⟩
[GOAL]
case intro
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝¹¹ : CommRing R✝
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : CommRing S✝
inst✝⁷ : Algebra R✝ A
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
R : Type u_5
S : Type u_6
T : Type u_7
U : Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
inst✝³ : CommRing T
inst✝² : CommRing U
inst✝¹ : Algebra R S
inst✝ : Algebra T U
φ : R →+* T
ψ : S →+* U
h : RingHom.comp (algebraMap T U) φ = RingHom.comp ψ (algebraMap R S)
a : S
p : R[X]
hp : Monic p ∧ eval₂ (algebraMap R S) a p = 0
⊢ eval₂ (algebraMap T ((fun x => U) a)) (↑ψ a) (Polynomial.map φ p) = 0
[PROOFSTEP]
rw [← eval_map, map_map, h, ← map_map, eval_map, eval₂_at_apply, eval_map, hp.right, RingHom.map_zero]
[GOAL]
R : Type u_1
A✝ : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝⁹ : CommRing R
inst✝⁸ : CommRing A✝
inst✝⁷ : CommRing B✝
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R A✝
inst✝⁴ : Algebra R B✝
f✝ : R →+* S
A : Type u_5
B : Type u_6
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Function.Injective ↑f
x : A
⊢ IsIntegral R (↑f x) ↔ IsIntegral R x
[PROOFSTEP]
refine' ⟨_, map_isIntegral f⟩
[GOAL]
R : Type u_1
A✝ : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝⁹ : CommRing R
inst✝⁸ : CommRing A✝
inst✝⁷ : CommRing B✝
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R A✝
inst✝⁴ : Algebra R B✝
f✝ : R →+* S
A : Type u_5
B : Type u_6
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Function.Injective ↑f
x : A
⊢ IsIntegral R (↑f x) → IsIntegral R x
[PROOFSTEP]
rintro ⟨p, hp, hx⟩
[GOAL]
case intro.intro
R : Type u_1
A✝ : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝⁹ : CommRing R
inst✝⁸ : CommRing A✝
inst✝⁷ : CommRing B✝
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R A✝
inst✝⁴ : Algebra R B✝
f✝ : R →+* S
A : Type u_5
B : Type u_6
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Function.Injective ↑f
x : A
p : R[X]
hp : Monic p
hx : eval₂ (algebraMap R ((fun x => B) x)) (↑f x) p = 0
⊢ IsIntegral R x
[PROOFSTEP]
use p, hp
[GOAL]
case right
R : Type u_1
A✝ : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝⁹ : CommRing R
inst✝⁸ : CommRing A✝
inst✝⁷ : CommRing B✝
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R A✝
inst✝⁴ : Algebra R B✝
f✝ : R →+* S
A : Type u_5
B : Type u_6
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Function.Injective ↑f
x : A
p : R[X]
hp : Monic p
hx : eval₂ (algebraMap R ((fun x => B) x)) (↑f x) p = 0
⊢ eval₂ (algebraMap R A) x p = 0
[PROOFSTEP]
rwa [← f.comp_algebraMap, ← AlgHom.coe_toRingHom, ← Polynomial.hom_eval₂, AlgHom.coe_toRingHom, map_eq_zero_iff f hf] at
  hx 
[GOAL]
R : Type u_1
A✝ : Type u_2
B✝ : Type u_3
S : Type u_4
inst✝⁹ : CommRing R
inst✝⁸ : CommRing A✝
inst✝⁷ : CommRing B✝
inst✝⁶ : CommRing S
inst✝⁵ : Algebra R A✝
inst✝⁴ : Algebra R B✝
f✝ : R →+* S
A : Type u_5
B : Type u_6
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : A ≃ₐ[R] B
x : A
h : IsIntegral R (↑f x)
⊢ IsIntegral R x
[PROOFSTEP]
simpa using map_isIntegral f.symm.toAlgHom h
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : CommRing S
inst✝³ : Algebra R A
inst✝² : Algebra R B
f : R →+* S
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x : B
hx : IsIntegral R x
p : R[X]
hp : Monic p
hpx : eval₂ (algebraMap R B) x p = 0
⊢ eval₂ (algebraMap A B) x (Polynomial.map (algebraMap R A) p) = 0
[PROOFSTEP]
rw [← aeval_def, aeval_map_algebraMap, aeval_def, hpx]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : CommRing S
inst✝³ : Algebra R A
inst✝² : Algebra R B
f : R →+* S
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x : A
h : IsIntegral R x
⊢ IsIntegral R (↑(_root_.algebraMap A B) x)
[PROOFSTEP]
rcases h with ⟨f, hf, hx⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : CommRing S
inst✝³ : Algebra R A
inst✝² : Algebra R B
f✝ : R →+* S
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x : A
f : R[X]
hf : Monic f
hx : eval₂ (_root_.algebraMap R A) x f = 0
⊢ IsIntegral R (↑(_root_.algebraMap A B) x)
[PROOFSTEP]
use f, hf
[GOAL]
case right
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : CommRing S
inst✝³ : Algebra R A
inst✝² : Algebra R B
f✝ : R →+* S
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x : A
f : R[X]
hf : Monic f
hx : eval₂ (_root_.algebraMap R A) x f = 0
⊢ eval₂ (_root_.algebraMap R ((fun x => B) x)) (↑(_root_.algebraMap A B) x) f = 0
[PROOFSTEP]
rw [IsScalarTower.algebraMap_eq R A B, ← hom_eval₂, hx, RingHom.map_zero]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
⊢ IsIntegral R r ↔ ∃ s, Set.Finite s ∧ IsIntegral { x // x ∈ Subring.closure s } r
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
⊢ IsIntegral R r → ∃ s, Set.Finite s ∧ IsIntegral { x // x ∈ Subring.closure s } r
[PROOFSTEP]
intro hr
[GOAL]
case mpr
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
⊢ (∃ s, Set.Finite s ∧ IsIntegral { x // x ∈ Subring.closure s } r) → IsIntegral R r
[PROOFSTEP]
intro hr
[GOAL]
case mp
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
hr : IsIntegral R r
⊢ ∃ s, Set.Finite s ∧ IsIntegral { x // x ∈ Subring.closure s } r
[PROOFSTEP]
rcases hr with ⟨p, hmp, hpr⟩
[GOAL]
case mp.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
p : R[X]
hmp : Monic p
hpr : eval₂ (algebraMap R A) r p = 0
⊢ ∃ s, Set.Finite s ∧ IsIntegral { x // x ∈ Subring.closure s } r
[PROOFSTEP]
refine' ⟨_, Finset.finite_toSet _, p.restriction, monic_restriction.2 hmp, _⟩
[GOAL]
case mp.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
p : R[X]
hmp : Monic p
hpr : eval₂ (algebraMap R A) r p = 0
⊢ eval₂ (algebraMap { x // x ∈ Subring.closure ↑(frange p) } A) r (restriction p) = 0
[PROOFSTEP]
rw [← aeval_def, ← aeval_map_algebraMap R r p.restriction, map_restriction, aeval_def, hpr]
[GOAL]
case mpr
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
hr : ∃ s, Set.Finite s ∧ IsIntegral { x // x ∈ Subring.closure s } r
⊢ IsIntegral R r
[PROOFSTEP]
rcases hr with ⟨s, _, hsr⟩
[GOAL]
case mpr.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
r : A
s : Set R
left✝ : Set.Finite s
hsr : IsIntegral { x // x ∈ Subring.closure s } r
⊢ IsIntegral R r
[PROOFSTEP]
exact isIntegral_ofSubring _ hsr
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
hx : IsIntegral R x
⊢ FG (↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
rcases hx with ⟨f, hfm, hfx⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
⊢ FG (↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
exists Finset.image ((· ^ ·) x) (Finset.range (natDegree f + 1))
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
⊢ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))) =
    ↑Subalgebra.toSubmodule (Algebra.adjoin R {x})
[PROOFSTEP]
apply le_antisymm
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
⊢ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))) ≤
    ↑Subalgebra.toSubmodule (Algebra.adjoin R {x})
[PROOFSTEP]
rw [span_le]
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
⊢ ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))) ⊆
    ↑(↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
intro s hs
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
s : A
hs : s ∈ ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
⊢ s ∈ ↑(↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
rw [Finset.mem_coe] at hs 
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
s : A
hs : s ∈ Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))
⊢ s ∈ ↑(↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
rcases Finset.mem_image.1 hs with ⟨k, hk, rfl⟩
[GOAL]
case intro.intro.a.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
k : ℕ
hk : k ∈ Finset.range (natDegree f + 1)
hs : (fun x x_1 => x ^ x_1) x k ∈ Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))
⊢ (fun x x_1 => x ^ x_1) x k ∈ ↑(↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
clear hk
[GOAL]
case intro.intro.a.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
k : ℕ
hs : (fun x x_1 => x ^ x_1) x k ∈ Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))
⊢ (fun x x_1 => x ^ x_1) x k ∈ ↑(↑Subalgebra.toSubmodule (Algebra.adjoin R {x}))
[PROOFSTEP]
exact (Algebra.adjoin R { x }).pow_mem (Algebra.subset_adjoin (Set.mem_singleton _)) k
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
⊢ ↑Subalgebra.toSubmodule (Algebra.adjoin R {x}) ≤
    span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
intro r hr
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
r : A
hr : r ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin R {x})
⊢ r ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
change r ∈ Algebra.adjoin R ({ x } : Set A) at hr 
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
r : A
hr : r ∈ Algebra.adjoin R {x}
⊢ r ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [Algebra.adjoin_singleton_eq_range_aeval] at hr 
[GOAL]
case intro.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
r : A
hr : r ∈ AlgHom.range (aeval x)
⊢ r ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rcases(aeval x).mem_range.mp hr with ⟨p, rfl⟩
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
⊢ ↑(aeval x) p ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [← modByMonic_add_div p hfm]
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : eval₂ (algebraMap R A) x f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
⊢ ↑(aeval x) (p %ₘ f + f * (p /ₘ f)) ∈
    span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [← aeval_def] at hfx 
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
⊢ ↑(aeval x) (p %ₘ f + f * (p /ₘ f)) ∈
    span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [AlgHom.map_add, AlgHom.map_mul, hfx, zero_mul, add_zero]
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
⊢ ↑(aeval x) (p %ₘ f) ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
have : degree (p %ₘ f) ≤ degree f := degree_modByMonic_le p hfm
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
this : degree (p %ₘ f) ≤ degree f
⊢ ↑(aeval x) (p %ₘ f) ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
generalize p %ₘ f = q at this ⊢
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
⊢ ↑(aeval x) q ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [← sum_C_mul_X_pow_eq q, aeval_def, eval₂_sum, sum_def]
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
⊢ ∑ n in support q, eval₂ (algebraMap R A) x (↑C (coeff q n) * X ^ n) ∈
    span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
refine' sum_mem fun k hkq => _
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
⊢ eval₂ (algebraMap R A) x (↑C (coeff q k) * X ^ k) ∈
    span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [eval₂_mul, eval₂_C, eval₂_pow, eval₂_X, ← Algebra.smul_def]
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
⊢ coeff q k • x ^ k ∈ span R ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
refine' smul_mem _ _ (subset_span _)
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
⊢ x ^ k ∈ ↑(Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1)))
[PROOFSTEP]
rw [Finset.mem_coe]
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
⊢ x ^ k ∈ Finset.image ((fun x x_1 => x ^ x_1) x) (Finset.range (natDegree f + 1))
[PROOFSTEP]
refine' Finset.mem_image.2 ⟨_, _, rfl⟩
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
⊢ k ∈ Finset.range (natDegree f + 1)
[PROOFSTEP]
rw [Finset.mem_range, Nat.lt_succ_iff]
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
⊢ k ≤ natDegree f
[PROOFSTEP]
refine' le_of_not_lt fun hk => _
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : degree q ≤ degree f
k : ℕ
hkq : k ∈ support q
hk : natDegree f < k
⊢ False
[PROOFSTEP]
rw [degree_le_iff_coeff_zero] at this 
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : ∀ (m : ℕ), degree f < ↑m → coeff q m = 0
k : ℕ
hkq : k ∈ support q
hk : natDegree f < k
⊢ False
[PROOFSTEP]
rw [mem_support_iff] at hkq 
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : ∀ (m : ℕ), degree f < ↑m → coeff q m = 0
k : ℕ
hkq : coeff q k ≠ 0
hk : natDegree f < k
⊢ False
[PROOFSTEP]
apply hkq
[GOAL]
case intro.intro.a.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : ∀ (m : ℕ), degree f < ↑m → coeff q m = 0
k : ℕ
hkq : coeff q k ≠ 0
hk : natDegree f < k
⊢ coeff q k = 0
[PROOFSTEP]
apply this
[GOAL]
case intro.intro.a.intro.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
x : A
f : R[X]
hfm : Monic f
hfx : ↑(aeval x) f = 0
p : R[X]
hr : ↑(aeval x) p ∈ AlgHom.range (aeval x)
q : R[X]
this : ∀ (m : ℕ), degree f < ↑m → coeff q m = 0
k : ℕ
hkq : coeff q k ≠ 0
hk : natDegree f < k
⊢ degree f < ↑k
[PROOFSTEP]
exact lt_of_le_of_lt degree_le_natDegree (WithBot.coe_lt_coe.2 hk)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
s : Set A
hfs : Set.Finite s
his : ∀ (x : A), x ∈ s → IsIntegral R x
x✝ : ∀ (x : A), x ∈ ∅ → IsIntegral R x
x : A
⊢ x ∈ span R ↑{1} ↔ x ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin R ∅)
[PROOFSTEP]
erw [Algebra.adjoin_empty, Finset.coe_singleton, ← one_eq_span, one_eq_range, LinearMap.mem_range, Algebra.mem_bot]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
s : Set A
hfs : Set.Finite s
his : ∀ (x : A), x ∈ s → IsIntegral R x
x✝ : ∀ (x : A), x ∈ ∅ → IsIntegral R x
x : A
⊢ (∃ y, ↑(Algebra.linearMap R A) y = x) ↔ x ∈ Set.range ↑(algebraMap R A)
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
s✝ : Set A
hfs : Set.Finite s✝
his✝ : ∀ (x : A), x ∈ s✝ → IsIntegral R x
a : A
s : Set A
x✝¹ : ¬a ∈ s
x✝ : Set.Finite s
ih : (∀ (x : A), x ∈ s → IsIntegral R x) → FG (↑Subalgebra.toSubmodule (Algebra.adjoin R s))
his : ∀ (x : A), x ∈ insert a s → IsIntegral R x
⊢ FG (↑Subalgebra.toSubmodule (Algebra.adjoin R (insert a s)))
[PROOFSTEP]
rw [← Set.union_singleton, Algebra.adjoin_union_coe_submodule]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
s✝ : Set A
hfs : Set.Finite s✝
his✝ : ∀ (x : A), x ∈ s✝ → IsIntegral R x
a : A
s : Set A
x✝¹ : ¬a ∈ s
x✝ : Set.Finite s
ih : (∀ (x : A), x ∈ s → IsIntegral R x) → FG (↑Subalgebra.toSubmodule (Algebra.adjoin R s))
his : ∀ (x : A), x ∈ insert a s → IsIntegral R x
⊢ FG (↑Subalgebra.toSubmodule (Algebra.adjoin R s) * ↑Subalgebra.toSubmodule (Algebra.adjoin R {a}))
[PROOFSTEP]
exact
  FG.mul (ih fun i hi => his i <| Set.mem_insert_of_mem a hi)
    (FG_adjoin_singleton_of_integral _ <| his a <| Set.mem_insert a s)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
HS : FG (↑Subalgebra.toSubmodule S)
x : A
hx : x ∈ S
⊢ IsIntegral R x
[PROOFSTEP]
cases' HS with y hy
[GOAL]
case intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
⊢ IsIntegral R x
[PROOFSTEP]
obtain ⟨lx, hlx1, hlx2⟩ : ∃ (l : A →₀ R), l ∈ Finsupp.supported R R ↑y ∧ (Finsupp.total A A R id) l = x := by
  rwa [← @Finsupp.mem_span_image_iff_total A A R _ _ _ id (↑y) x, Set.image_id (y : Set A), hy]
    -- Note that `y ⊆ S`.
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
⊢ ∃ l, l ∈ Finsupp.supported R R ↑y ∧ ↑(Finsupp.total A A R id) l = x
[PROOFSTEP]
rwa [← @Finsupp.mem_span_image_iff_total A A R _ _ _ id (↑y) x, Set.image_id (y : Set A), hy]
  -- Note that `y ⊆ S`.
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
⊢ IsIntegral R x
[PROOFSTEP]
have hyS : ∀ {p}, p ∈ y → p ∈ S := fun {p} hp =>
  show p ∈ Subalgebra.toSubmodule S by
    rw [← hy]
    exact subset_span hp
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
p : A
hp : p ∈ y
⊢ p ∈ ↑Subalgebra.toSubmodule S
[PROOFSTEP]
rw [← hy]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
p : A
hp : p ∈ y
⊢ p ∈ span R ↑y
[PROOFSTEP]
exact subset_span hp
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
⊢ IsIntegral R x
[PROOFSTEP]
have : ∀ jk : (y ×ˢ y : Finset (A × A)), jk.1.1 * jk.1.2 ∈ (Subalgebra.toSubmodule S) := fun jk =>
  S.mul_mem (hyS (Finset.mem_product.1 jk.2).1) (hyS (Finset.mem_product.1 jk.2).2)
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
this : ∀ (jk : { x // x ∈ y ×ˢ y }), (↑jk).fst * (↑jk).snd ∈ ↑Subalgebra.toSubmodule S
⊢ IsIntegral R x
[PROOFSTEP]
rw [← hy, ← Set.image_id (y : Set A)] at this 
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
this : ∀ (jk : { x // x ∈ y ×ˢ y }), (↑jk).fst * (↑jk).snd ∈ span R (id '' ↑y)
⊢ IsIntegral R x
[PROOFSTEP]
simp only [Finsupp.mem_span_image_iff_total] at this 
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
this :
  ∀ (jk : { x // x ∈ y ×ˢ y }), ∃ l, l ∈ Finsupp.supported R R ↑y ∧ ↑(Finsupp.total A A R id) l = (↑jk).fst * (↑jk).snd
⊢ IsIntegral R x
[PROOFSTEP]
choose ly hly1 hly2 using this
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
⊢ IsIntegral R x
[PROOFSTEP]
let S₀ : Subring R :=
  Subring.closure
    ↑(lx.frange ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
        -- It suffices to prove that `x` is integral over `S₀`.
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
⊢ IsIntegral R x
[PROOFSTEP]
refine' isIntegral_ofSubring S₀ _
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
letI : CommRing S₀ := SubringClass.toCommRing S₀
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
letI : Algebra S₀ A := Algebra.ofSubring S₀
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
have : span S₀ (insert 1 ↑y : Set A) * span S₀ (insert 1 ↑y : Set A) ≤ span S₀ (insert 1 ↑y : Set A) :=
  by
  rw [span_mul_span]
  refine' span_le.2 fun z hz => _
  rcases Set.mem_mul.1 hz with ⟨p, q, rfl | hp, hq, rfl⟩
  · rw [one_mul]
    exact subset_span hq
  rcases hq with (rfl | hq)
  · rw [mul_one]
    exact subset_span (Or.inr hp)
  erw [← hly2 ⟨(p, q), Finset.mem_product.2 ⟨hp, hq⟩⟩]
  rw [Finsupp.total_apply, Finsupp.sum]
  refine' (span S₀ (insert 1 ↑y : Set A)).sum_mem fun t ht => _
  have : ly ⟨(p, q), Finset.mem_product.2 ⟨hp, hq⟩⟩ t ∈ S₀ :=
    Subring.subset_closure
      (Finset.mem_union_right _ <|
        Finset.mem_biUnion.2
          ⟨⟨(p, q), Finset.mem_product.2 ⟨hp, hq⟩⟩, Finset.mem_univ _,
            Finsupp.mem_frange.2 ⟨Finsupp.mem_support_iff.1 ht, _, rfl⟩⟩)
  change (⟨_, this⟩ : S₀) • t ∈ _
  exact
    smul_mem _ _
      (subset_span <| Or.inr <| hly1 _ ht)
        -- Hence this span is a subring. Call this subring `S₁`.
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
⊢ span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
rw [span_mul_span]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
⊢ span { x // x ∈ S₀ } (insert 1 ↑y * insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
refine' span_le.2 fun z hz => _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
z : A
hz : z ∈ insert 1 ↑y * insert 1 ↑y
⊢ z ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
rcases Set.mem_mul.1 hz with ⟨p, q, rfl | hp, hq, rfl⟩
[GOAL]
case intro.intro.intro.inl.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
q : A
hq : q ∈ insert 1 ↑y
hz : 1 * q ∈ insert 1 ↑y * insert 1 ↑y
⊢ 1 * q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
rw [one_mul]
[GOAL]
case intro.intro.intro.inl.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
q : A
hq : q ∈ insert 1 ↑y
hz : 1 * q ∈ insert 1 ↑y * insert 1 ↑y
⊢ q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
exact subset_span hq
[GOAL]
case intro.intro.intro.inr.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hq : q ∈ insert 1 ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
⊢ p * q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
rcases hq with (rfl | hq)
[GOAL]
case intro.intro.intro.inr.intro.inl
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p : A
hp : p ∈ ↑y
hz : p * 1 ∈ insert 1 ↑y * insert 1 ↑y
⊢ p * 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
rw [mul_one]
[GOAL]
case intro.intro.intro.inr.intro.inl
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p : A
hp : p ∈ ↑y
hz : p * 1 ∈ insert 1 ↑y * insert 1 ↑y
⊢ p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
exact subset_span (Or.inr hp)
[GOAL]
case intro.intro.intro.inr.intro.inr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
hq : q ∈ ↑y
⊢ p * q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
erw [← hly2 ⟨(p, q), Finset.mem_product.2 ⟨hp, hq⟩⟩]
[GOAL]
case intro.intro.intro.inr.intro.inr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
hq : q ∈ ↑y
⊢ ↑(Finsupp.total A A R id) (ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) ∈
    ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
rw [Finsupp.total_apply, Finsupp.sum]
[GOAL]
case intro.intro.intro.inr.intro.inr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
hq : q ∈ ↑y
⊢ ∑ a in (ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }).support,
      ↑(ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) a • id a ∈
    ↑(span { x // x ∈ S₀ } (insert 1 ↑y))
[PROOFSTEP]
refine' (span S₀ (insert 1 ↑y : Set A)).sum_mem fun t ht => _
[GOAL]
case intro.intro.intro.inr.intro.inr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
hq : q ∈ ↑y
t : A
ht : t ∈ (ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }).support
⊢ ↑(ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) t • id t ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
have : ly ⟨(p, q), Finset.mem_product.2 ⟨hp, hq⟩⟩ t ∈ S₀ :=
  Subring.subset_closure
    (Finset.mem_union_right _ <|
      Finset.mem_biUnion.2
        ⟨⟨(p, q), Finset.mem_product.2 ⟨hp, hq⟩⟩, Finset.mem_univ _,
          Finsupp.mem_frange.2 ⟨Finsupp.mem_support_iff.1 ht, _, rfl⟩⟩)
[GOAL]
case intro.intro.intro.inr.intro.inr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
hq : q ∈ ↑y
t : A
ht : t ∈ (ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }).support
this : ↑(ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) t ∈ S₀
⊢ ↑(ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) t • id t ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
change (⟨_, this⟩ : S₀) • t ∈ _
[GOAL]
case intro.intro.intro.inr.intro.inr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
p q : A
hp : p ∈ ↑y
hz : p * q ∈ insert 1 ↑y * insert 1 ↑y
hq : q ∈ ↑y
t : A
ht : t ∈ (ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }).support
this : ↑(ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) t ∈ S₀
⊢ { val := ↑(ly { val := (p, q), property := (_ : (p, q) ∈ y ×ˢ y) }) t, property := this } • t ∈
    span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
exact
  smul_mem _ _
    (subset_span <| Or.inr <| hly1 _ ht)
      -- Hence this span is a subring. Call this subring `S₁`.
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
let S₁ : Subring A :=
  { carrier := span S₀ (insert 1 ↑y : Set A)
    one_mem' := subset_span <| Or.inl rfl
    mul_mem' := fun {p q} hp hq => this <| mul_mem_mul hp hq
    zero_mem' := (span S₀ (insert 1 ↑y : Set A)).zero_mem
    add_mem' := fun {_ _} => (span S₀ (insert 1 ↑y : Set A)).add_mem
    neg_mem' := fun {_} => (span S₀ (insert 1 ↑y : Set A)).neg_mem }
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
have : S₁ = Subalgebra.toSubring (Algebra.adjoin S₀ (↑y : Set A)) :=
  by
  ext z
  suffices z ∈ span (↥S₀) (insert 1 ↑y : Set A) ↔ z ∈ Subalgebra.toSubmodule (Algebra.adjoin (↥S₀) (y : Set A)) by simpa
  constructor <;> intro hz
  · exact (span_le.2 (Set.insert_subset_iff.2 ⟨(Algebra.adjoin S₀ (y : Set A)).one_mem, Algebra.subset_adjoin⟩)) hz
  · rw [Subalgebra.mem_toSubmodule, Algebra.mem_adjoin_iff] at hz 
    suffices Subring.closure (Set.range (algebraMap (↥S₀) A) ∪ ↑y) ≤ S₁ by exact this hz
    refine' Subring.closure_le.2 (Set.union_subset _ fun t ht => subset_span <| Or.inr ht)
    rw [Set.range_subset_iff]
    intro y'
    rw [Algebra.algebraMap_eq_smul_one]
    exact smul_mem (span S₀ (insert (1 : A) (y : Set A))) y' (subset_span (Or.inl rfl))
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
⊢ S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
ext z
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
⊢ z ∈ S₁ ↔ z ∈ Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
suffices z ∈ span (↥S₀) (insert 1 ↑y : Set A) ↔ z ∈ Subalgebra.toSubmodule (Algebra.adjoin (↥S₀) (y : Set A)) by simpa
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝² : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝¹ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
this : z ∈ span { x // x ∈ S₀ } (insert 1 ↑y) ↔ z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
⊢ z ∈ S₁ ↔ z ∈ Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
simpa
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
⊢ z ∈ span { x // x ∈ S₀ } (insert 1 ↑y) ↔ z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
constructor
[GOAL]
case h.mp
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
⊢ z ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
intro hz
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
⊢ z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y) → z ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
intro hz
[GOAL]
case h.mp
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
⊢ z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
exact (span_le.2 (Set.insert_subset_iff.2 ⟨(Algebra.adjoin S₀ (y : Set A)).one_mem, Algebra.subset_adjoin⟩)) hz
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
⊢ z ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
rw [Subalgebra.mem_toSubmodule, Algebra.mem_adjoin_iff] at hz 
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
⊢ z ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
suffices Subring.closure (Set.range (algebraMap (↥S₀) A) ∪ ↑y) ≤ S₁ by exact this hz
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝² : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝¹ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
this : Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y) ≤ S₁
⊢ z ∈ span { x // x ∈ S₀ } (insert 1 ↑y)
[PROOFSTEP]
exact this hz
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
⊢ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y) ≤ S₁
[PROOFSTEP]
refine' Subring.closure_le.2 (Set.union_subset _ fun t ht => subset_span <| Or.inr ht)
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
⊢ Set.range ↑(algebraMap { x // x ∈ S₀ } A) ⊆ ↑S₁
[PROOFSTEP]
rw [Set.range_subset_iff]
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
⊢ ∀ (y : { x // x ∈ S₀ }), ↑(algebraMap { x // x ∈ S₀ } A) y ∈ ↑S₁
[PROOFSTEP]
intro y'
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
y' : { x // x ∈ S₀ }
⊢ ↑(algebraMap { x // x ∈ S₀ } A) y' ∈ ↑S₁
[PROOFSTEP]
rw [Algebra.algebraMap_eq_smul_one]
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝¹ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
z : A
hz : z ∈ Subring.closure (Set.range ↑(algebraMap { x // x ∈ S₀ } A) ∪ ↑y)
y' : { x // x ∈ S₀ }
⊢ y' • 1 ∈ ↑S₁
[PROOFSTEP]
exact smul_mem (span S₀ (insert (1 : A) (y : Set A))) y' (subset_span (Or.inl rfl))
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝² : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝¹ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
have foo : ∀ z, z ∈ S₁ ↔ z ∈ Algebra.adjoin (↥S₀) (y : Set A)
[GOAL]
case foo
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝² : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝¹ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
⊢ ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝² : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝¹ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
simp [this]
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝² : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝¹ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
haveI : IsNoetherianRing S₀ := is_noetherian_subring_closure _ (Finset.finite_toSet _)
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
⊢ IsIntegral { x // x ∈ S₀ } x
[PROOFSTEP]
refine'
  isIntegral_of_submodule_noetherian (Algebra.adjoin S₀ ↑y)
    (isNoetherian_of_fg_of_noetherian _
      ⟨insert 1 y, by
        rw [Finset.coe_insert]
        ext z
        simp only [Finset.coe_sort_coe, Finset.univ_eq_attach, Finset.mem_coe, Subalgebra.mem_toSubmodule]
        convert foo z⟩)
    _ _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
⊢ span { x // x ∈ S₀ } ↑(insert 1 y) = ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
rw [Finset.coe_insert]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
⊢ span { x // x ∈ S₀ } (insert 1 ↑y) = ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
ext z
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
z : A
⊢ z ∈ span { x // x ∈ S₀ } (insert 1 ↑y) ↔ z ∈ ↑Subalgebra.toSubmodule (Algebra.adjoin { x // x ∈ S₀ } ↑y)
[PROOFSTEP]
simp only [Finset.coe_sort_coe, Finset.univ_eq_attach, Finset.mem_coe, Subalgebra.mem_toSubmodule]
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
z : A
⊢ z ∈
      span
        { x //
          x ∈ Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion (Finset.attach (y ×ˢ y)) (Finsupp.frange ∘ ly)) }
        (insert 1 ↑y) ↔
    z ∈
      Algebra.adjoin
        { x //
          x ∈ Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion (Finset.attach (y ×ˢ y)) (Finsupp.frange ∘ ly)) }
        ↑y
[PROOFSTEP]
convert foo z
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
⊢ x ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
[PROOFSTEP]
rw [← hlx2, Finsupp.total_apply, Finsupp.sum]
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
⊢ ∑ a in lx.support, ↑lx a • id a ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
[PROOFSTEP]
refine' Subalgebra.sum_mem _ fun r hr => _
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝³ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝² : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝¹ : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this : IsNoetherianRing { x // x ∈ S₀ }
r : A
hr : r ∈ lx.support
⊢ ↑lx r • id r ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
[PROOFSTEP]
have : lx r ∈ S₀ := Subring.subset_closure (Finset.mem_union_left _ (Finset.mem_image_of_mem _ hr))
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝⁴ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝³ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝² : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝¹ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this✝ : IsNoetherianRing { x // x ∈ S₀ }
r : A
hr : r ∈ lx.support
this : ↑lx r ∈ S₀
⊢ ↑lx r • id r ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
[PROOFSTEP]
change (⟨_, this⟩ : S₀) • r ∈ _
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : lx ∈ Finsupp.supported R R ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝⁴ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝³ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝² : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝¹ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this✝ : IsNoetherianRing { x // x ∈ S₀ }
r : A
hr : r ∈ lx.support
this : ↑lx r ∈ S₀
⊢ { val := ↑lx r, property := this } • r ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
[PROOFSTEP]
rw [Finsupp.mem_supported] at hlx1 
[GOAL]
case intro.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S : Subalgebra R A
x : A
hx : x ∈ S
y : Finset A
hy : span R ↑y = ↑Subalgebra.toSubmodule S
lx : A →₀ R
hlx1 : ↑lx.support ⊆ ↑y
hlx2 : ↑(Finsupp.total A A R id) lx = x
hyS : ∀ {p : A}, p ∈ y → p ∈ S
ly : { x // x ∈ y ×ˢ y } → A →₀ R
hly1 : ∀ (jk : { x // x ∈ y ×ˢ y }), ly jk ∈ Finsupp.supported R R ↑y
hly2 : ∀ (jk : { x // x ∈ y ×ˢ y }), ↑(Finsupp.total A A R id) (ly jk) = (↑jk).fst * (↑jk).snd
S₀ : Subring R := Subring.closure ↑(Finsupp.frange lx ∪ Finset.biUnion Finset.univ (Finsupp.frange ∘ ly))
this✝⁴ : CommRing { x // x ∈ S₀ } := SubringClass.toCommRing S₀
this✝³ : Algebra { x // x ∈ S₀ } A := Algebra.ofSubring S₀
this✝² : span { x // x ∈ S₀ } (insert 1 ↑y) * span { x // x ∈ S₀ } (insert 1 ↑y) ≤ span { x // x ∈ S₀ } (insert 1 ↑y)
S₁ : Subring A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := ↑(span { x // x ∈ S₀ } (insert 1 ↑y)),
                mul_mem' :=
                  (_ :
                    ∀ {p q : A},
                      p ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) →
                        q ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y)) → p * q ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
            one_mem' := (_ : 1 ∈ ↑(span { x // x ∈ S₀ } (insert 1 ↑y))) },
        add_mem' :=
          (_ :
            ∀ {x x_1 : A},
              x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) →
                x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → x + x_1 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)),
        zero_mem' := (_ : 0 ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) },
    neg_mem' := (_ : ∀ {x : A}, x ∈ span { x // x ∈ S₀ } (insert 1 ↑y) → -x ∈ span { x // x ∈ S₀ } (insert 1 ↑y)) }
this✝¹ : S₁ = Subalgebra.toSubring (Algebra.adjoin { x // x ∈ S₀ } ↑y)
foo : ∀ (z : A), z ∈ S₁ ↔ z ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
this✝ : IsNoetherianRing { x // x ∈ S₀ }
r : A
hr : r ∈ lx.support
this : ↑lx r ∈ S₀
⊢ { val := ↑lx r, property := this } • r ∈ Algebra.adjoin { x // x ∈ S₀ } ↑y
[PROOFSTEP]
exact Subalgebra.smul_mem _ (Algebra.subset_adjoin <| hlx1 hr) _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
⊢ IsIntegral R x
[PROOFSTEP]
let A' : Subalgebra R A :=
  { carrier := {x | ∀ n ∈ N, x • n ∈ N}
    mul_mem' := fun {a b} ha hb n hn => smul_smul a b n ▸ ha _ (hb _ hn)
    one_mem' := fun n hn => (one_smul A n).symm ▸ hn
    add_mem' := fun {a b} ha hb n hn => (add_smul a b n).symm ▸ N.add_mem (ha _ hn) (hb _ hn)
    zero_mem' := fun n _hn => (zero_smul A n).symm ▸ N.zero_mem
    algebraMap_mem' := fun r n hn => (algebraMap_smul A r n).symm ▸ N.smul_mem r hn }
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ IsIntegral R x
[PROOFSTEP]
let f : A' →ₐ[R] Module.End R N :=
  AlgHom.ofLinearMap
    { toFun := fun x => (DistribMulAction.toLinearMap R M x).restrict x.prop
      map_add' := by intros x y; ext;
        exact
          add_smul _ _
            _
              -- porting note: was
                              --  `fun r s => LinearMap.ext fun n => Subtype.ext <| smul_assoc r s n`
      map_smul' := by intros r s; ext; apply smul_assoc }
      -- porting note: the next two lines were
            --`(LinearMap.ext fun n => Subtype.ext <| one_smul _ _) fun x y =>`
            --`LinearMap.ext fun n => Subtype.ext <| mul_smul x y n` (by ext; apply one_smul)
    (by intros x y; ext; apply mul_smul)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ∀ (x y : { x // x ∈ A' }),
    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y
[PROOFSTEP]
intros x y
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝ : A
hx : ∀ (n : M), n ∈ N → x✝ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
⊢ (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y
[PROOFSTEP]
ext
[GOAL]
case h.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝¹ : A
hx : ∀ (n : M), n ∈ N → x✝¹ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑((fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y)) x✝) =
    ↑(↑((fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y)
        x✝)
[PROOFSTEP]
exact
  add_smul _ _
    _
      -- porting note: was
                      --  `fun r s => LinearMap.ext fun n => Subtype.ext <| smul_assoc r s n`
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ∀ (r : R) (x : { x // x ∈ A' }),
    AddHom.toFun
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
        (r • x) =
      ↑(RingHom.id R) r •
        AddHom.toFun
          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
            map_add' :=
              (_ :
                ∀ (x y : { x // x ∈ A' }),
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
          x
[PROOFSTEP]
intros r s
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
r : R
s : { x // x ∈ A' }
⊢ AddHom.toFun
      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
        map_add' :=
          (_ :
            ∀ (x y : { x // x ∈ A' }),
              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
      (r • s) =
    ↑(RingHom.id R) r •
      AddHom.toFun
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
        s
[PROOFSTEP]
ext
[GOAL]
case h.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
r : R
s : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑(AddHom.toFun
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
            (r • s))
        x✝) =
    ↑(↑(↑(RingHom.id R) r •
            AddHom.toFun
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
              s)
        x✝)
[PROOFSTEP]
apply smul_assoc
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ↑{
          toAddHom :=
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : { x // x ∈ A' }),
                AddHom.toFun
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                    (r • s) =
                  ↑(RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      s) }
      1 =
    1
[PROOFSTEP]
ext
[GOAL]
case h.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x✝ : { x // x ∈ N }
⊢ ↑(↑(↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            1)
        x✝) =
    ↑(↑1 x✝)
[PROOFSTEP]
apply one_smul
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ∀ (x y : { x // x ∈ A' }),
    ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        (x * y) =
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          x *
        ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          y
[PROOFSTEP]
intros x y
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝ : A
hx : ∀ (n : M), n ∈ N → x✝ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
⊢ ↑{
          toAddHom :=
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : { x // x ∈ A' }),
                AddHom.toFun
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                    (r • s) =
                  ↑(RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      s) }
      (x * y) =
    ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        x *
      ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        y
[PROOFSTEP]
ext
[GOAL]
case h.a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝¹ : A
hx : ∀ (n : M), n ∈ N → x✝¹ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑(↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y))
        x✝) =
    ↑(↑(↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
        x✝)
[PROOFSTEP]
apply mul_smul
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
⊢ IsIntegral R x
[PROOFSTEP]
obtain ⟨a, ha₁, ha₂⟩ : ∃ a ∈ N, a ≠ (0 : M) := by
  by_contra h'
  push_neg at h' 
  apply hN
  rwa [eq_bot_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
⊢ ∃ a, a ∈ N ∧ a ≠ 0
[PROOFSTEP]
by_contra h'
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ¬∃ a, a ∈ N ∧ a ≠ 0
⊢ False
[PROOFSTEP]
push_neg at h' 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ∀ (a : M), a ∈ N → a = 0
⊢ False
[PROOFSTEP]
apply hN
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ∀ (a : M), a ∈ N → a = 0
⊢ N = ⊥
[PROOFSTEP]
rwa [eq_bot_iff]
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ IsIntegral R x
[PROOFSTEP]
have : Function.Injective f := by
  show Function.Injective f.toLinearMap
  rw [← LinearMap.ker_eq_bot, eq_bot_iff]
  intro s hs
  have : s.1 • a = 0 := congr_arg Subtype.val (LinearMap.congr_fun hs ⟨a, ha₁⟩)
  exact Subtype.ext ((eq_zero_or_eq_zero_of_smul_eq_zero this).resolve_right ha₂)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ Function.Injective ↑f
[PROOFSTEP]
show Function.Injective f.toLinearMap
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ Function.Injective ↑(AlgHom.toLinearMap f)
[PROOFSTEP]
rw [← LinearMap.ker_eq_bot, eq_bot_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ LinearMap.ker (AlgHom.toLinearMap f) ≤ ⊥
[PROOFSTEP]
intro s hs
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
s : { x // x ∈ A' }
hs : s ∈ LinearMap.ker (AlgHom.toLinearMap f)
⊢ s ∈ ⊥
[PROOFSTEP]
have : s.1 • a = 0 := congr_arg Subtype.val (LinearMap.congr_fun hs ⟨a, ha₁⟩)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
s : { x // x ∈ A' }
hs : s ∈ LinearMap.ker (AlgHom.toLinearMap f)
this : ↑s • a = 0
⊢ s ∈ ⊥
[PROOFSTEP]
exact Subtype.ext ((eq_zero_or_eq_zero_of_smul_eq_zero this).resolve_right ha₂)
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R x
[PROOFSTEP]
show IsIntegral R (A'.val ⟨x, hx⟩)
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R (↑(Subalgebra.val A') { val := x, property := hx })
[PROOFSTEP]
rw [isIntegral_algHom_iff A'.val Subtype.val_injective, ← isIntegral_algHom_iff f this]
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R (↑f { val := x, property := hx })
[PROOFSTEP]
haveI : Module.Finite R N := by rwa [Module.finite_def, Submodule.fg_top]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ Module.Finite R { x // x ∈ N }
[PROOFSTEP]
rwa [Module.finite_def, Submodule.fg_top]
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_5
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this✝ : Function.Injective ↑f
this : Module.Finite R { x // x ∈ N }
⊢ IsIntegral R (↑f { val := x, property := hx })
[PROOFSTEP]
apply Module.End.isIntegral
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : IsIntegral f
h' : FiniteType f
⊢ Finite f
[PROOFSTEP]
letI := f.toAlgebra
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : IsIntegral f
h' : FiniteType f
this : Algebra R S := toAlgebra f
⊢ Finite f
[PROOFSTEP]
obtain ⟨s, hs⟩ := h'
[GOAL]
case mk.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : IsIntegral f
this : Algebra R S := toAlgebra f
s : Finset S
hs : Algebra.adjoin R ↑s = ⊤
⊢ Finite f
[PROOFSTEP]
constructor
[GOAL]
case mk.intro.out
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : IsIntegral f
this : Algebra R S := toAlgebra f
s : Finset S
hs : Algebra.adjoin R ↑s = ⊤
⊢ FG ⊤
[PROOFSTEP]
change (⊤ : Subalgebra R S).toSubmodule.FG
[GOAL]
case mk.intro.out
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : IsIntegral f
this : Algebra R S := toAlgebra f
s : Finset S
hs : Algebra.adjoin R ↑s = ⊤
⊢ FG (↑Subalgebra.toSubmodule ⊤)
[PROOFSTEP]
rw [← hs]
[GOAL]
case mk.intro.out
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : IsIntegral f
this : Algebra R S := toAlgebra f
s : Finset S
hs : Algebra.adjoin R ↑s = ⊤
⊢ FG (↑Subalgebra.toSubmodule (Algebra.adjoin R ↑s))
[PROOFSTEP]
exact FG_adjoin_of_finite (Set.toFinite _) fun x _ => h x
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
⊢ Module.Finite R A
[PROOFSTEP]
have :=
  h.to_finite
    (by
      rw [RingHom.FiniteType]
      convert h'
      refine IsScalarTower.Algebra.ext (algebraMap R A).toAlgebra _ fun r x => ?_
      exact (Algebra.smul_def _ _).symm)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
⊢ RingHom.FiniteType (algebraMap R A)
[PROOFSTEP]
rw [RingHom.FiniteType]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
⊢ FiniteType R A
[PROOFSTEP]
convert h'
[GOAL]
case h.e'_5
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
⊢ RingHom.toAlgebra (algebraMap R A) = inst✝¹
[PROOFSTEP]
refine IsScalarTower.Algebra.ext (algebraMap R A).toAlgebra _ fun r x => ?_
[GOAL]
case h.e'_5
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
r : R
x : A
⊢ (let_fun I := RingHom.toAlgebra (algebraMap R A);
    r • x) =
    r • x
[PROOFSTEP]
exact (Algebra.smul_def _ _).symm
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
this : RingHom.Finite (algebraMap R A)
⊢ Module.Finite R A
[PROOFSTEP]
rw [RingHom.Finite] at this 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
this : Module.Finite R A
⊢ Module.Finite R A
[PROOFSTEP]
convert this
[GOAL]
case h.e'_5.h.e'_5
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
this : Module.Finite R A
⊢ inst✝¹ = RingHom.toAlgebra (algebraMap R A)
[PROOFSTEP]
ext
[GOAL]
case h.e'_5.h.e'_5.h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Algebra.IsIntegral R A
h' : FiniteType R A
this : Module.Finite R A
r✝ : R
x✝ : A
⊢ (let_fun I := inst✝¹;
    r✝ • x✝) =
    r✝ • x✝
[PROOFSTEP]
exact Algebra.smul_def _ _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Module.Finite R A
⊢ Algebra.IsIntegral R A
[PROOFSTEP]
apply RingHom.Finite.to_isIntegral
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Module.Finite R A
⊢ RingHom.Finite (algebraMap R A)
[PROOFSTEP]
rw [RingHom.Finite]
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Module.Finite R A
⊢ Module.Finite R A
[PROOFSTEP]
convert h
[GOAL]
case h.e'_5.h.e'_5
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Module.Finite R A
⊢ RingHom.toAlgebra (algebraMap R A) = inst✝¹
[PROOFSTEP]
ext
[GOAL]
case h.e'_5.h.e'_5.h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
h : Module.Finite R A
r✝ : R
x✝ : A
⊢ (let_fun I := RingHom.toAlgebra (algebraMap R A);
    r✝ • x✝) =
    r✝ • x✝
[PROOFSTEP]
exact (Algebra.smul_def _ _).symm
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y z : S
hx : IsIntegralElem f x
hy : IsIntegralElem f y
hz : z ∈ Subring.closure {x, y}
⊢ IsIntegralElem f z
[PROOFSTEP]
letI : Algebra R S := f.toAlgebra
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y z : S
hx : IsIntegralElem f x
hy : IsIntegralElem f y
hz : z ∈ Subring.closure {x, y}
this : Algebra R S := toAlgebra f
⊢ IsIntegralElem f z
[PROOFSTEP]
have := (FG_adjoin_singleton_of_integral x hx).mul (FG_adjoin_singleton_of_integral y hy)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y z : S
hx : IsIntegralElem f x
hy : IsIntegralElem f y
hz : z ∈ Subring.closure {x, y}
this✝ : Algebra R S := toAlgebra f
this : FG (↑Subalgebra.toSubmodule (Algebra.adjoin R {x}) * ↑Subalgebra.toSubmodule (Algebra.adjoin R {y}))
⊢ IsIntegralElem f z
[PROOFSTEP]
rw [← Algebra.adjoin_union_coe_submodule, Set.singleton_union] at this 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y z : S
hx : IsIntegralElem f x
hy : IsIntegralElem f y
hz : z ∈ Subring.closure {x, y}
this✝ : Algebra R S := toAlgebra f
this : FG (↑Subalgebra.toSubmodule (Algebra.adjoin R {x, y}))
⊢ IsIntegralElem f z
[PROOFSTEP]
exact
  isIntegral_of_mem_of_FG (Algebra.adjoin R { x, y }) this z
    (Algebra.mem_adjoin_iff.2 <| Subring.closure_mono (Set.subset_union_right _ _) hz)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y : S
hx : IsIntegralElem f x
hy : IsIntegralElem f y
⊢ IsIntegralElem f (x - y)
[PROOFSTEP]
simpa only [sub_eq_add_neg] using f.is_integral_add hx (f.is_integral_neg hy)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
f : R →+* S
inst✝² : Algebra S A
inst✝¹ : Algebra R S
inst✝ : IsScalarTower R S A
x : A
r : R
hx : IsIntegral S x
⊢ IsIntegral S (r • x)
[PROOFSTEP]
rw [Algebra.smul_def, IsScalarTower.algebraMap_apply R S A]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
f : R →+* S
inst✝² : Algebra S A
inst✝¹ : Algebra R S
inst✝ : IsScalarTower R S A
x : A
r : R
hx : IsIntegral S x
⊢ IsIntegral S (↑(algebraMap S A) (↑(algebraMap R S) r) * x)
[PROOFSTEP]
exact isIntegral_mul isIntegral_algebraMap hx
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
n : ℕ
hn : 0 < n
hx : IsIntegral R (x ^ n)
⊢ IsIntegral R x
[PROOFSTEP]
rcases hx with ⟨p, ⟨hmonic, heval⟩⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
n : ℕ
hn : 0 < n
p : R[X]
hmonic : Monic p
heval : eval₂ (algebraMap R A) (x ^ n) p = 0
⊢ IsIntegral R x
[PROOFSTEP]
exact ⟨expand R n p, Monic.expand hn hmonic, by rwa [eval₂_eq_eval_map, map_expand, expand_eval, ← eval₂_eq_eval_map]⟩
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
n : ℕ
hn : 0 < n
p : R[X]
hmonic : Monic p
heval : eval₂ (algebraMap R A) (x ^ n) p = 0
⊢ eval₂ (algebraMap R A) x (↑(expand R n) p) = 0
[PROOFSTEP]
rwa [eval₂_eq_eval_map, map_expand, expand_eval, ← eval₂_eq_eval_map]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
hx : IsIntegral R x
⊢ Algebra.adjoin R {x} ≤ integralClosure R A
[PROOFSTEP]
rw [Algebra.adjoin_le_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
hx : IsIntegral R x
⊢ {x} ⊆ ↑(integralClosure R A)
[PROOFSTEP]
simp only [SetLike.mem_coe, Set.singleton_subset_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
hx : IsIntegral R x
⊢ x ∈ integralClosure R A
[PROOFSTEP]
exact hx
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S✝
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S✝
S T : Subalgebra R A
⊢ Algebra.IsIntegral R { x // x ∈ S ⊔ T } ↔ Algebra.IsIntegral R { x // x ∈ S } ∧ Algebra.IsIntegral R { x // x ∈ T }
[PROOFSTEP]
simp only [← le_integralClosure_iff_isIntegral, sup_le_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
⊢ Subalgebra.map (↑f) (integralClosure R A) = integralClosure R B
[PROOFSTEP]
ext y
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
y : B
⊢ y ∈ Subalgebra.map (↑f) (integralClosure R A) ↔ y ∈ integralClosure R B
[PROOFSTEP]
rw [Subalgebra.mem_map]
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
y : B
⊢ (∃ x, x ∈ integralClosure R A ∧ ↑↑f x = y) ↔ y ∈ integralClosure R B
[PROOFSTEP]
constructor
[GOAL]
case h.mp
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
y : B
⊢ (∃ x, x ∈ integralClosure R A ∧ ↑↑f x = y) → y ∈ integralClosure R B
[PROOFSTEP]
rintro ⟨x, hx, rfl⟩
[GOAL]
case h.mp.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
x : A
hx : x ∈ integralClosure R A
⊢ ↑↑f x ∈ integralClosure R B
[PROOFSTEP]
exact map_isIntegral f hx
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
y : B
⊢ y ∈ integralClosure R B → ∃ x, x ∈ integralClosure R A ∧ ↑↑f x = y
[PROOFSTEP]
intro hy
[GOAL]
case h.mpr
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
y : B
hy : y ∈ integralClosure R B
⊢ ∃ x, x ∈ integralClosure R A ∧ ↑↑f x = y
[PROOFSTEP]
use f.symm y, map_isIntegral (f.symm : B →ₐ[R] A) hy
[GOAL]
case right
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
f : A ≃ₐ[R] B
y : B
hy : y ∈ integralClosure R B
⊢ ↑↑f (↑(AlgEquiv.symm f) y) = y
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : { x // x ∈ integralClosure R A }
p : R[X]
hpm : Monic p
hpx : eval₂ (algebraMap R A) (↑x) p = 0
⊢ ↑(eval₂ (algebraMap R { x // x ∈ integralClosure R A }) x p) = ↑0
[PROOFSTEP]
rwa [← aeval_def, ← Subalgebra.val_apply, aeval_algHom_apply] at hpx 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y : S
r : R
hr : ↑f r * y = 1
hx : IsIntegralElem f (x * y)
⊢ IsIntegralElem f x
[PROOFSTEP]
obtain ⟨p, ⟨p_monic, hp⟩⟩ := hx
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y : S
r : R
hr : ↑f r * y = 1
p : R[X]
p_monic : Monic p
hp : eval₂ f (x * y) p = 0
⊢ IsIntegralElem f x
[PROOFSTEP]
refine' ⟨scaleRoots p r, ⟨(monic_scaleRoots_iff r).2 p_monic, _⟩⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y : S
r : R
hr : ↑f r * y = 1
p : R[X]
p_monic : Monic p
hp : eval₂ f (x * y) p = 0
⊢ eval₂ f x (scaleRoots p r) = 0
[PROOFSTEP]
convert scaleRoots_eval₂_eq_zero f hp
[GOAL]
case h.e'_2.h.e'_6
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x y : S
r : R
hr : ↑f r * y = 1
p : R[X]
p_monic : Monic p
hp : eval₂ f (x * y) p = 0
⊢ x = ↑f r * (x * y)
[PROOFSTEP]
rw [mul_comm x y, ← mul_assoc, hr, one_mul]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : CommRing S
inst✝³ : Algebra R A
inst✝² : Algebra R B
f : R →+* S
n : Type u_5
inst✝¹ : Fintype n
inst✝ : DecidableEq n
M : Matrix n n A
h : ∀ (i j : n), IsIntegral R (M i j)
⊢ IsIntegral R (Matrix.det M)
[PROOFSTEP]
rw [Matrix.det_apply]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : CommRing S
inst✝³ : Algebra R A
inst✝² : Algebra R B
f : R →+* S
n : Type u_5
inst✝¹ : Fintype n
inst✝ : DecidableEq n
M : Matrix n n A
h : ∀ (i j : n), IsIntegral R (M i j)
⊢ IsIntegral R (∑ σ : Equiv.Perm n, ↑Equiv.Perm.sign σ • ∏ i : n, M (↑σ i) i)
[PROOFSTEP]
exact IsIntegral.sum _ fun σ _hσ => IsIntegral.zsmul (IsIntegral.prod _ fun i _hi => h _ _) _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
h : IsIntegral R y
⊢ IsIntegral A (x ⊗ₜ[R] y)
[PROOFSTEP]
obtain ⟨p, hp, hp'⟩ := h
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ IsIntegral A (x ⊗ₜ[R] y)
[PROOFSTEP]
refine' ⟨(p.map (_root_.algebraMap R A)).scaleRoots x, _, _⟩
[GOAL]
case intro.intro.refine'_1
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ Monic (scaleRoots (Polynomial.map (_root_.algebraMap R A) p) x)
[PROOFSTEP]
rw [Polynomial.monic_scaleRoots_iff]
[GOAL]
case intro.intro.refine'_1
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ Monic (Polynomial.map (_root_.algebraMap R A) p)
[PROOFSTEP]
exact hp.map _
[GOAL]
case intro.intro.refine'_2
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ eval₂ (_root_.algebraMap A (A ⊗[R] B)) (x ⊗ₜ[R] y) (scaleRoots (Polynomial.map (_root_.algebraMap R A) p) x) = 0
[PROOFSTEP]
convert Polynomial.scaleRoots_eval₂_mul (R := A ⊗[R] B) (S := A) Algebra.TensorProduct.includeLeftRingHom (?_) x
[GOAL]
case h.e'_2.h.e'_6
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ x ⊗ₜ[R] y = ↑Algebra.TensorProduct.includeLeftRingHom x * ?intro.intro.refine'_2.convert_2
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ 0 =
    ↑Algebra.TensorProduct.includeLeftRingHom x ^ natDegree (Polynomial.map (_root_.algebraMap R A) p) *
      eval₂ Algebra.TensorProduct.includeLeftRingHom ?intro.intro.refine'_2.convert_2
        (Polynomial.map (_root_.algebraMap R A) p)
case intro.intro.refine'_2.convert_2
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ A ⊗[R] B
[PROOFSTEP]
any_goals exact 1 ⊗ₜ y
[GOAL]
case h.e'_2.h.e'_6
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ x ⊗ₜ[R] y = ↑Algebra.TensorProduct.includeLeftRingHom x * ?intro.intro.refine'_2.convert_2
[PROOFSTEP]
exact 1 ⊗ₜ y
[GOAL]
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ 0 =
    ↑Algebra.TensorProduct.includeLeftRingHom x ^ natDegree (Polynomial.map (_root_.algebraMap R A) p) *
      eval₂ Algebra.TensorProduct.includeLeftRingHom ?intro.intro.refine'_2.convert_2
        (Polynomial.map (_root_.algebraMap R A) p)
[PROOFSTEP]
exact 1 ⊗ₜ y
[GOAL]
case intro.intro.refine'_2.convert_2
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ A ⊗[R] B
[PROOFSTEP]
exact 1 ⊗ₜ y
[GOAL]
case h.e'_2.h.e'_6
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ x ⊗ₜ[R] y = ↑Algebra.TensorProduct.includeLeftRingHom x * 1 ⊗ₜ[R] y
[PROOFSTEP]
simp only [Algebra.TensorProduct.includeLeftRingHom_apply, Algebra.TensorProduct.tmul_mul_tmul, mul_one, one_mul]
[GOAL]
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ 0 =
    ↑Algebra.TensorProduct.includeLeftRingHom x ^ natDegree (Polynomial.map (_root_.algebraMap R A) p) *
      eval₂ Algebra.TensorProduct.includeLeftRingHom (1 ⊗ₜ[R] y) (Polynomial.map (_root_.algebraMap R A) p)
[PROOFSTEP]
simp only [Algebra.TensorProduct.includeLeftRingHom_apply, Algebra.TensorProduct.tmul_pow, one_pow]
[GOAL]
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ 0 =
    (x ^ natDegree (Polynomial.map (_root_.algebraMap R A) p)) ⊗ₜ[R] 1 *
      eval₂ Algebra.TensorProduct.includeLeftRingHom (1 ⊗ₜ[R] y) (Polynomial.map (_root_.algebraMap R A) p)
[PROOFSTEP]
convert (mul_zero (M₀ := A ⊗[R] B) _).symm
[GOAL]
case h.e'_3.h.e'_6
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ eval₂ Algebra.TensorProduct.includeLeftRingHom (1 ⊗ₜ[R] y) (Polynomial.map (_root_.algebraMap R A) p) = 0
[PROOFSTEP]
erw [Polynomial.eval₂_map, Algebra.TensorProduct.includeLeftRingHom_comp_algebraMap, ← Polynomial.eval₂_map]
[GOAL]
case h.e'_3.h.e'_6
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ eval₂ (↑Algebra.TensorProduct.includeRight) (1 ⊗ₜ[R] y) (Polynomial.map (_root_.algebraMap R B) p) = 0
[PROOFSTEP]
convert Polynomial.eval₂_at_apply (Algebra.TensorProduct.includeRight : B →ₐ[R] A ⊗[R] B).toRingHom y
[GOAL]
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
x : A
y : B
p : R[X]
hp : Monic p
hp' : eval₂ (_root_.algebraMap R B) y p = 0
⊢ 0 = ↑↑Algebra.TensorProduct.includeRight (eval y (Polynomial.map (_root_.algebraMap R B) p))
[PROOFSTEP]
rw [Polynomial.eval_map, hp', _root_.map_zero]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
⊢ coeff (normalizeScaleRoots p) i * leadingCoeff p ^ i = coeff p i * leadingCoeff p ^ (natDegree p - 1)
[PROOFSTEP]
simp only [normalizeScaleRoots, finset_sum_coeff, coeff_monomial, Finset.sum_ite_eq', one_mul, zero_mul,
  mem_support_iff, ite_mul, Ne.def, ite_not]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
⊢ (if coeff p i = 0 then 0
    else
      if i = natDegree p then leadingCoeff p ^ i
      else coeff p i * leadingCoeff p ^ (natDegree p - 1 - i) * leadingCoeff p ^ i) =
    coeff p i * leadingCoeff p ^ (natDegree p - 1)
[PROOFSTEP]
split_ifs with h₁ h₂
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
h₁ : coeff p i = 0
⊢ 0 = coeff p i * leadingCoeff p ^ (natDegree p - 1)
[PROOFSTEP]
simp [h₁]
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
h₁ : ¬coeff p i = 0
h₂ : i = natDegree p
⊢ leadingCoeff p ^ i = coeff p i * leadingCoeff p ^ (natDegree p - 1)
[PROOFSTEP]
rw [h₂, leadingCoeff, ← pow_succ, tsub_add_cancel_of_le hp]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
h₁ : ¬coeff p i = 0
h₂ : ¬i = natDegree p
⊢ coeff p i * leadingCoeff p ^ (natDegree p - 1 - i) * leadingCoeff p ^ i =
    coeff p i * leadingCoeff p ^ (natDegree p - 1)
[PROOFSTEP]
rw [mul_assoc, ← pow_add, tsub_add_cancel_of_le]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
h₁ : ¬coeff p i = 0
h₂ : ¬i = natDegree p
⊢ i ≤ natDegree p - 1
[PROOFSTEP]
apply Nat.le_pred_of_lt
[GOAL]
case neg.h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
h₁ : ¬coeff p i = 0
h₂ : ¬i = natDegree p
⊢ i < natDegree p
[PROOFSTEP]
rw [lt_iff_le_and_ne]
[GOAL]
case neg.h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
i : ℕ
hp : 1 ≤ natDegree p
h₁ : ¬coeff p i = 0
h₂ : ¬i = natDegree p
⊢ i ≤ natDegree p ∧ i ≠ natDegree p
[PROOFSTEP]
exact ⟨le_natDegree_of_ne_zero h₁, h₂⟩
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
⊢ leadingCoeff p • normalizeScaleRoots p = scaleRoots p (leadingCoeff p)
[PROOFSTEP]
ext
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
⊢ coeff (leadingCoeff p • normalizeScaleRoots p) n✝ = coeff (scaleRoots p (leadingCoeff p)) n✝
[PROOFSTEP]
simp only [coeff_scaleRoots, normalizeScaleRoots, coeff_monomial, coeff_smul, Finset.smul_sum, Ne.def,
  Finset.sum_ite_eq', finset_sum_coeff, smul_ite, smul_zero, mem_support_iff]
  -- porting note: added the following `simp only`
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
⊢ (∑ x in support p,
      leadingCoeff p •
        if x = n✝ then if x = natDegree p then 1 else coeff p x * leadingCoeff p ^ (natDegree p - 1 - x) else 0) =
    coeff p n✝ * leadingCoeff p ^ (natDegree p - n✝)
[PROOFSTEP]
simp only [ge_iff_le, tsub_le_iff_right, smul_eq_mul, mul_ite, mul_one, mul_zero, Finset.sum_ite_eq', mem_support_iff,
  ne_eq, ite_not]
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
⊢ (if coeff p n✝ = 0 then 0
    else
      if n✝ = natDegree p then leadingCoeff p
      else leadingCoeff p * (coeff p n✝ * leadingCoeff p ^ (natDegree p - 1 - n✝))) =
    coeff p n✝ * leadingCoeff p ^ (natDegree p - n✝)
[PROOFSTEP]
split_ifs with h₁ h₂
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
h₁ : coeff p n✝ = 0
⊢ 0 = coeff p n✝ * leadingCoeff p ^ (natDegree p - n✝)
[PROOFSTEP]
simp [*]
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
h₁ : ¬coeff p n✝ = 0
h₂ : n✝ = natDegree p
⊢ leadingCoeff p = coeff p n✝ * leadingCoeff p ^ (natDegree p - n✝)
[PROOFSTEP]
simp [*]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
h₁ : ¬coeff p n✝ = 0
h₂ : ¬n✝ = natDegree p
⊢ leadingCoeff p * (coeff p n✝ * leadingCoeff p ^ (natDegree p - 1 - n✝)) =
    coeff p n✝ * leadingCoeff p ^ (natDegree p - n✝)
[PROOFSTEP]
rw [mul_comm, mul_assoc, ← pow_succ', tsub_right_comm, tsub_add_cancel_of_le]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
h₁ : ¬coeff p n✝ = 0
h₂ : ¬n✝ = natDegree p
⊢ 1 ≤ natDegree p - n✝
[PROOFSTEP]
rw [Nat.succ_le_iff]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p✝ : R[X]
x : S
p : R[X]
n✝ : ℕ
h₁ : ¬coeff p n✝ = 0
h₂ : ¬n✝ = natDegree p
⊢ 0 < natDegree p - n✝
[PROOFSTEP]
exact tsub_pos_of_lt (lt_of_le_of_ne (le_natDegree_of_ne_zero h₁) h₂)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
⊢ support (normalizeScaleRoots p) ≤ support p
[PROOFSTEP]
intro x
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x✝ : S
x : ℕ
⊢ x ∈ support (normalizeScaleRoots p) → x ∈ support p
[PROOFSTEP]
contrapose
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x✝ : S
x : ℕ
⊢ ¬x ∈ support p → ¬x ∈ support (normalizeScaleRoots p)
[PROOFSTEP]
simp only [not_mem_support_iff, normalizeScaleRoots, finset_sum_coeff, coeff_monomial, Finset.sum_ite_eq',
  mem_support_iff, Ne.def, Classical.not_not, ite_eq_right_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x✝ : S
x : ℕ
⊢ coeff p x = 0 →
    ¬coeff p x = 0 → (if x = natDegree p then 1 else coeff p x * leadingCoeff p ^ (natDegree p - 1 - x)) = 0
[PROOFSTEP]
intro h₁ h₂
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x✝ : S
x : ℕ
h₁ : coeff p x = 0
h₂ : ¬coeff p x = 0
⊢ (if x = natDegree p then 1 else coeff p x * leadingCoeff p ^ (natDegree p - 1 - x)) = 0
[PROOFSTEP]
exact (h₂ h₁).elim
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
⊢ degree (normalizeScaleRoots p) = degree p
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
⊢ degree (normalizeScaleRoots p) ≤ degree p
[PROOFSTEP]
exact Finset.sup_mono (normalizeScaleRoots_support p)
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
⊢ degree p ≤ degree (normalizeScaleRoots p)
[PROOFSTEP]
rw [← degree_scaleRoots, ← leadingCoeff_smul_normalizeScaleRoots]
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
⊢ degree (leadingCoeff p • normalizeScaleRoots p) ≤ degree (normalizeScaleRoots p)
[PROOFSTEP]
exact degree_smul_le _ _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
p : R[X]
x✝ : S
h : 1 ≤ natDegree p
f : R →+* S
x : S
⊢ eval₂ f (↑f (leadingCoeff p) * x) (normalizeScaleRoots p) = ↑f (leadingCoeff p) ^ (natDegree p - 1) * eval₂ f x p
[PROOFSTEP]
rw [eval₂_eq_sum_range, eval₂_eq_sum_range, Finset.mul_sum]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
p : R[X]
x✝ : S
h : 1 ≤ natDegree p
f : R →+* S
x : S
⊢ ∑ i in Finset.range (natDegree (normalizeScaleRoots p) + 1),
      ↑f (coeff (normalizeScaleRoots p) i) * (↑f (leadingCoeff p) * x) ^ i =
    ∑ x_1 in Finset.range (natDegree p + 1), ↑f (leadingCoeff p) ^ (natDegree p - 1) * (↑f (coeff p x_1) * x ^ x_1)
[PROOFSTEP]
apply Finset.sum_congr
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
p : R[X]
x✝ : S
h : 1 ≤ natDegree p
f : R →+* S
x : S
⊢ Finset.range (natDegree (normalizeScaleRoots p) + 1) = Finset.range (natDegree p + 1)
[PROOFSTEP]
rw [natDegree_eq_of_degree_eq (normalizeScaleRoots_degree p)]
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
p : R[X]
x✝ : S
h : 1 ≤ natDegree p
f : R →+* S
x : S
⊢ ∀ (x_1 : ℕ),
    x_1 ∈ Finset.range (natDegree p + 1) →
      ↑f (coeff (normalizeScaleRoots p) x_1) * (↑f (leadingCoeff p) * x) ^ x_1 =
        ↑f (leadingCoeff p) ^ (natDegree p - 1) * (↑f (coeff p x_1) * x ^ x_1)
[PROOFSTEP]
intro n _hn
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
p : R[X]
x✝ : S
h : 1 ≤ natDegree p
f : R →+* S
x : S
n : ℕ
_hn : n ∈ Finset.range (natDegree p + 1)
⊢ ↑f (coeff (normalizeScaleRoots p) n) * (↑f (leadingCoeff p) * x) ^ n =
    ↑f (leadingCoeff p) ^ (natDegree p - 1) * (↑f (coeff p n) * x ^ n)
[PROOFSTEP]
rw [mul_pow, ← mul_assoc, ← f.map_pow, ← f.map_mul, normalizeScaleRoots_coeff_mul_leadingCoeff_pow _ _ h, f.map_mul,
  f.map_pow]
[GOAL]
case a
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : R →+* S
p : R[X]
x✝ : S
h : 1 ≤ natDegree p
f : R →+* S
x : S
n : ℕ
_hn : n ∈ Finset.range (natDegree p + 1)
⊢ ↑f (coeff p n) * ↑f (leadingCoeff p) ^ (natDegree p - 1) * x ^ n =
    ↑f (leadingCoeff p) ^ (natDegree p - 1) * (↑f (coeff p n) * x ^ n)
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : p ≠ 0
⊢ Monic (normalizeScaleRoots p)
[PROOFSTEP]
delta Monic leadingCoeff
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : p ≠ 0
⊢ coeff (normalizeScaleRoots p) (natDegree (normalizeScaleRoots p)) = 1
[PROOFSTEP]
rw [natDegree_eq_of_degree_eq (normalizeScaleRoots_degree p)]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : p ≠ 0
⊢ coeff (normalizeScaleRoots p) (natDegree p) = 1
[PROOFSTEP]
suffices p = 0 → (0 : R) = 1 by simpa [normalizeScaleRoots, coeff_monomial]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : p ≠ 0
this : p = 0 → 0 = 1
⊢ coeff (normalizeScaleRoots p) (natDegree p) = 1
[PROOFSTEP]
simpa [normalizeScaleRoots, coeff_monomial]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : p ≠ 0
⊢ p = 0 → 0 = 1
[PROOFSTEP]
exact fun h' => (h h').elim
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
by_cases h' : 1 ≤ p.natDegree
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : 1 ≤ natDegree p
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
use normalizeScaleRoots p
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : 1 ≤ natDegree p
⊢ Monic (normalizeScaleRoots p) ∧ eval₂ f (↑f (leadingCoeff p) * x) (normalizeScaleRoots p) = 0
[PROOFSTEP]
have : p ≠ 0 := fun h'' => by
  rw [h'', natDegree_zero] at h' 
  exact Nat.not_succ_le_zero 0 h'
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : 1 ≤ natDegree p
h'' : p = 0
⊢ False
[PROOFSTEP]
rw [h'', natDegree_zero] at h' 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : 1 ≤ 0
h'' : p = 0
⊢ False
[PROOFSTEP]
exact Nat.not_succ_le_zero 0 h'
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : 1 ≤ natDegree p
this : p ≠ 0
⊢ Monic (normalizeScaleRoots p) ∧ eval₂ f (↑f (leadingCoeff p) * x) (normalizeScaleRoots p) = 0
[PROOFSTEP]
use normalizeScaleRoots_monic p this
[GOAL]
case right
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : 1 ≤ natDegree p
this : p ≠ 0
⊢ eval₂ f (↑f (leadingCoeff p) * x) (normalizeScaleRoots p) = 0
[PROOFSTEP]
rw [normalizeScaleRoots_eval₂_leadingCoeff_mul p h' f x, h, mul_zero]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : ¬1 ≤ natDegree p
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
by_cases hp : p.map f = 0
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : ¬1 ≤ natDegree p
hp : Polynomial.map f p = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
apply_fun fun q => coeff q p.natDegree at hp 
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : ¬1 ≤ natDegree p
hp : coeff (Polynomial.map f p) (natDegree p) = coeff 0 (natDegree p)
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
rw [coeff_map, coeff_zero, coeff_natDegree] at hp 
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : ¬1 ≤ natDegree p
hp : ↑f (leadingCoeff p) = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
rw [hp, zero_mul]
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : ¬1 ≤ natDegree p
hp : ↑f (leadingCoeff p) = 0
⊢ IsIntegralElem f 0
[PROOFSTEP]
exact f.is_integral_zero
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : ¬1 ≤ natDegree p
hp : ¬Polynomial.map f p = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
rw [Nat.one_le_iff_ne_zero, Classical.not_not] at h' 
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : eval₂ f x p = 0
h' : natDegree p = 0
hp : ¬Polynomial.map f p = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
rw [eq_C_of_natDegree_eq_zero h', eval₂_C] at h 
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : ↑f (coeff p 0) = 0
h' : natDegree p = 0
hp : ¬Polynomial.map f p = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
suffices p.map f = 0 by exact (hp this).elim
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : ↑f (coeff p 0) = 0
h' : natDegree p = 0
hp : ¬Polynomial.map f p = 0
this : Polynomial.map f p = 0
⊢ IsIntegralElem f (↑f (leadingCoeff p) * x)
[PROOFSTEP]
exact (hp this).elim
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : CommRing S
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : R →+* S
p : R[X]
x : S
h : ↑f (coeff p 0) = 0
h' : natDegree p = 0
hp : ¬Polynomial.map f p = 0
⊢ Polynomial.map f p = 0
[PROOFSTEP]
rw [eq_C_of_natDegree_eq_zero h', map_C, h, C_eq_zero]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
f : R →+* S
p : R[X]
x : S
inst✝ : Algebra R S
h : ↑(aeval x) p = 0
⊢ IsIntegral R (leadingCoeff p • x)
[PROOFSTEP]
rw [aeval_def] at h 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
f : R →+* S
p : R[X]
x : S
inst✝ : Algebra R S
h : eval₂ (algebraMap R S) x p = 0
⊢ IsIntegral R (leadingCoeff p • x)
[PROOFSTEP]
rw [Algebra.smul_def]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
f : R →+* S
p : R[X]
x : S
inst✝ : Algebra R S
h : eval₂ (algebraMap R S) x p = 0
⊢ IsIntegral R (↑(algebraMap R S) (leadingCoeff p) * x)
[PROOFSTEP]
exact (algebraMap R S).isIntegralElem_leadingCoeff_mul p x h
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing A
inst✝ : Algebra R A
x : A
⊢ (∃ y, ↑(algebraMap { x // x ∈ integralClosure R A } A) y = x) → IsIntegral R x
[PROOFSTEP]
rintro ⟨⟨_, h⟩, rfl⟩
[GOAL]
case intro.mk
R : Type u_1
A : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing A
inst✝ : Algebra R A
val✝ : A
h : val✝ ∈ integralClosure R A
⊢ IsIntegral R (↑(algebraMap { x // x ∈ integralClosure R A } A) { val := val✝, property := h })
[PROOFSTEP]
exact h
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsIntegralClosure A R B
inst✝² : Algebra R A
inst✝¹ : IsScalarTower R A B
inst✝ : NoZeroSMulDivisors R B
⊢ NoZeroSMulDivisors R A
[PROOFSTEP]
refine' Function.Injective.noZeroSMulDivisors _ (IsIntegralClosure.algebraMap_injective A R B) (map_zero _) fun _ _ => _
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsIntegralClosure A R B
inst✝² : Algebra R A
inst✝¹ : IsScalarTower R A B
inst✝ : NoZeroSMulDivisors R B
x✝¹ : R
x✝ : A
⊢ ↑(algebraMap A B) (x✝¹ • x✝) = x✝¹ • ↑(algebraMap A B) x✝
[PROOFSTEP]
simp only [Algebra.algebraMap_eq_smul_one, IsScalarTower.smul_assoc]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsIntegralClosure A R B
h : optParam (IsIntegral R 1) (_ : IsIntegral R 1)
⊢ ↑(algebraMap A B) (mk' A 1 h) = ↑(algebraMap A B) 1
[PROOFSTEP]
rw [algebraMap_mk', RingHom.map_one]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsIntegralClosure A R B
h : optParam (IsIntegral R 0) (_ : IsIntegral R 0)
⊢ ↑(algebraMap A B) (mk' A 0 h) = ↑(algebraMap A B) 0
[PROOFSTEP]
rw [algebraMap_mk', RingHom.map_zero]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsIntegralClosure A R B
x y : B
hx : IsIntegral R x
hy : IsIntegral R y
⊢ ↑(algebraMap A B) (mk' A (x + y) (_ : IsIntegral R (x + y))) = ↑(algebraMap A B) (mk' A x hx + mk' A y hy)
[PROOFSTEP]
simp only [algebraMap_mk', RingHom.map_add]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsIntegralClosure A R B
x y : B
hx : IsIntegral R x
hy : IsIntegral R y
⊢ ↑(algebraMap A B) (mk' A (x * y) (_ : IsIntegral R (x * y))) = ↑(algebraMap A B) (mk' A x hx * mk' A y hy)
[PROOFSTEP]
simp only [algebraMap_mk', RingHom.map_mul]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing B
inst✝⁴ : Algebra R B
inst✝³ : Algebra A B
inst✝² : IsIntegralClosure A R B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
x : R
h : optParam (IsIntegral R (↑(algebraMap R B) x)) (_ : IsIntegral R (↑(algebraMap R ((fun x => B) x)) x))
⊢ ↑(algebraMap A B) (mk' A (↑(algebraMap R B) x) h) = ↑(algebraMap A B) (↑(algebraMap R A) x)
[PROOFSTEP]
rw [algebraMap_mk', ← IsScalarTower.algebraMap_apply]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : Algebra R B
inst✝⁷ : Algebra A B
inst✝⁶ : IsIntegralClosure A R B
S : Type u_4
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
inst✝³ : Algebra S B
inst✝² : IsScalarTower R S B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
h : Algebra.IsIntegral R S
⊢ (fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x))) 1 = 1
[PROOFSTEP]
simp only [RingHom.map_one, mk'_one]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : Algebra R B
inst✝⁷ : Algebra A B
inst✝⁶ : IsIntegralClosure A R B
S : Type u_4
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
inst✝³ : Algebra S B
inst✝² : IsScalarTower R S B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
h : Algebra.IsIntegral R S
x y : S
⊢ OneHom.toFun
      { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
        map_one' := (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
      (x * y) =
    OneHom.toFun
        { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
          map_one' := (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
        x *
      OneHom.toFun
        { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
          map_one' := (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
        y
[PROOFSTEP]
simp_rw [← mk'_mul, RingHom.map_mul]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : Algebra R B
inst✝⁷ : Algebra A B
inst✝⁶ : IsIntegralClosure A R B
S : Type u_4
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
inst✝³ : Algebra S B
inst✝² : IsScalarTower R S B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
h : Algebra.IsIntegral R S
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
              map_one' :=
                (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : S),
                OneHom.toFun
                    {
                      toFun := fun x =>
                        mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                      map_one' :=
                        (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                    (x * y) =
                  OneHom.toFun
                      {
                        toFun := fun x =>
                          mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                        map_one' :=
                          (_ :
                            mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                      x *
                    OneHom.toFun
                      {
                        toFun := fun x =>
                          mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                        map_one' :=
                          (_ :
                            mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                      y) })
      0 =
    0
[PROOFSTEP]
simp only [RingHom.map_zero, mk'_zero]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : Algebra R B
inst✝⁷ : Algebra A B
inst✝⁶ : IsIntegralClosure A R B
S : Type u_4
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
inst✝³ : Algebra S B
inst✝² : IsScalarTower R S B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
h : Algebra.IsIntegral R S
x y : S
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
              map_one' :=
                (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : S),
                OneHom.toFun
                    {
                      toFun := fun x =>
                        mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                      map_one' :=
                        (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                    (x * y) =
                  OneHom.toFun
                      {
                        toFun := fun x =>
                          mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                        map_one' :=
                          (_ :
                            mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                      x *
                    OneHom.toFun
                      {
                        toFun := fun x =>
                          mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                        map_one' :=
                          (_ :
                            mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                      y) })
      (x + y) =
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                map_one' :=
                  (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun
                      {
                        toFun := fun x =>
                          mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                        map_one' :=
                          (_ :
                            mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                      (x * y) =
                    OneHom.toFun
                        {
                          toFun := fun x =>
                            mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                          map_one' :=
                            (_ :
                              mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                        x *
                      OneHom.toFun
                        {
                          toFun := fun x =>
                            mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                          map_one' :=
                            (_ :
                              mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                        y) })
        x +
      OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                map_one' :=
                  (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun
                      {
                        toFun := fun x =>
                          mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                        map_one' :=
                          (_ :
                            mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                      (x * y) =
                    OneHom.toFun
                        {
                          toFun := fun x =>
                            mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                          map_one' :=
                            (_ :
                              mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                        x *
                      OneHom.toFun
                        {
                          toFun := fun x =>
                            mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                          map_one' :=
                            (_ :
                              mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) }
                        y) })
        y
[PROOFSTEP]
simp_rw [← mk'_add, RingHom.map_add]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : Algebra R B
inst✝⁷ : Algebra A B
inst✝⁶ : IsIntegralClosure A R B
S : Type u_4
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
inst✝³ : Algebra S B
inst✝² : IsScalarTower R S B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
h : Algebra.IsIntegral R S
x : R
⊢ OneHom.toFun
      (↑↑{
            toMonoidHom :=
              {
                toOneHom :=
                  {
                    toFun := fun x =>
                      mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                    map_one' :=
                      (_ : mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) = 1) },
                map_mul' :=
                  (_ :
                    ∀ (x y : S),
                      OneHom.toFun
                          {
                            toFun := fun x =>
                              mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                            map_one' :=
                              (_ :
                                mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                  1) }
                          (x * y) =
                        OneHom.toFun
                            {
                              toFun := fun x =>
                                mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                              map_one' :=
                                (_ :
                                  mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                    1) }
                            x *
                          OneHom.toFun
                            {
                              toFun := fun x =>
                                mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                              map_one' :=
                                (_ :
                                  mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                    1) }
                            y) },
            map_zero' := (_ : mk' A (↑(algebraMap S B) 0) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 0)) 0)) = 0),
            map_add' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            {
                              toFun := fun x =>
                                mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                              map_one' :=
                                (_ :
                                  mk' A (↑(algebraMap S B) 1) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : S),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        mk' A (↑(algebraMap S B) x)
                                          (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                      map_one' :=
                                        (_ :
                                          mk' A (↑(algebraMap S B) 1)
                                              (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          mk' A (↑(algebraMap S B) x)
                                            (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                        map_one' :=
                                          (_ :
                                            mk' A (↑(algebraMap S B) 1)
                                                (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          mk' A (↑(algebraMap S B) x)
                                            (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                        map_one' :=
                                          (_ :
                                            mk' A (↑(algebraMap S B) 1)
                                                (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                              1) }
                                      y) })
                      (x + y) =
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              {
                                toFun := fun x =>
                                  mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                map_one' :=
                                  (_ :
                                    mk' A (↑(algebraMap S B) 1)
                                        (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                      1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : S),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          mk' A (↑(algebraMap S B) x)
                                            (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                        map_one' :=
                                          (_ :
                                            mk' A (↑(algebraMap S B) 1)
                                                (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                              1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            mk' A (↑(algebraMap S B) x)
                                              (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                          map_one' :=
                                            (_ :
                                              mk' A (↑(algebraMap S B) 1)
                                                  (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                                1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            mk' A (↑(algebraMap S B) x)
                                              (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                          map_one' :=
                                            (_ :
                                              mk' A (↑(algebraMap S B) 1)
                                                  (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                                1) }
                                        y) })
                        x +
                      OneHom.toFun
                        (↑{
                            toOneHom :=
                              {
                                toFun := fun x =>
                                  mk' A (↑(algebraMap S B) x) (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                map_one' :=
                                  (_ :
                                    mk' A (↑(algebraMap S B) 1)
                                        (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                      1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : S),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          mk' A (↑(algebraMap S B) x)
                                            (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                        map_one' :=
                                          (_ :
                                            mk' A (↑(algebraMap S B) 1)
                                                (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                              1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            mk' A (↑(algebraMap S B) x)
                                              (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                          map_one' :=
                                            (_ :
                                              mk' A (↑(algebraMap S B) 1)
                                                  (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                                1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            mk' A (↑(algebraMap S B) x)
                                              (_ : IsIntegral R (↑(algebraMap S ((fun x => B) x)) x)),
                                          map_one' :=
                                            (_ :
                                              mk' A (↑(algebraMap S B) 1)
                                                  (_ : IsIntegral R (↑(algebraMap S ((fun x => B) 1)) 1)) =
                                                1) }
                                        y) })
                        y) })
      (↑(algebraMap R S) x) =
    ↑(algebraMap R A) x
[PROOFSTEP]
simp_rw [← IsScalarTower.algebraMap_apply, mk'_algebraMap]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : Algebra R B
inst✝⁸ : Algebra A B
inst✝⁷ : IsIntegralClosure A R B
A' : Type u_4
inst✝⁶ : CommRing A'
inst✝⁵ : Algebra A' B
inst✝⁴ : IsIntegralClosure A' R B
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : IsScalarTower R A B
inst✝ : IsScalarTower R A' B
⊢ AlgHom.comp (lift A' B (_ : Algebra.IsIntegral R A)) (lift A B (_ : Algebra.IsIntegral R A')) = AlgHom.id R A'
[PROOFSTEP]
ext x
[GOAL]
case H
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : Algebra R B
inst✝⁸ : Algebra A B
inst✝⁷ : IsIntegralClosure A R B
A' : Type u_4
inst✝⁶ : CommRing A'
inst✝⁵ : Algebra A' B
inst✝⁴ : IsIntegralClosure A' R B
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : IsScalarTower R A B
inst✝ : IsScalarTower R A' B
x : A'
⊢ ↑(AlgHom.comp (lift A' B (_ : Algebra.IsIntegral R A)) (lift A B (_ : Algebra.IsIntegral R A'))) x =
    ↑(AlgHom.id R A') x
[PROOFSTEP]
apply algebraMap_injective A' R B
[GOAL]
case H.a
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : Algebra R B
inst✝⁸ : Algebra A B
inst✝⁷ : IsIntegralClosure A R B
A' : Type u_4
inst✝⁶ : CommRing A'
inst✝⁵ : Algebra A' B
inst✝⁴ : IsIntegralClosure A' R B
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : IsScalarTower R A B
inst✝ : IsScalarTower R A' B
x : A'
⊢ ↑(algebraMap A' B)
      (↑(AlgHom.comp (lift A' B (_ : Algebra.IsIntegral R A)) (lift A B (_ : Algebra.IsIntegral R A'))) x) =
    ↑(algebraMap A' B) (↑(AlgHom.id R A') x)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : Algebra R B
inst✝⁸ : Algebra A B
inst✝⁷ : IsIntegralClosure A R B
A' : Type u_4
inst✝⁶ : CommRing A'
inst✝⁵ : Algebra A' B
inst✝⁴ : IsIntegralClosure A' R B
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : IsScalarTower R A B
inst✝ : IsScalarTower R A' B
⊢ AlgHom.comp (lift A B (_ : Algebra.IsIntegral R A')) (lift A' B (_ : Algebra.IsIntegral R A)) = AlgHom.id R A
[PROOFSTEP]
ext x
[GOAL]
case H
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : Algebra R B
inst✝⁸ : Algebra A B
inst✝⁷ : IsIntegralClosure A R B
A' : Type u_4
inst✝⁶ : CommRing A'
inst✝⁵ : Algebra A' B
inst✝⁴ : IsIntegralClosure A' R B
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : IsScalarTower R A B
inst✝ : IsScalarTower R A' B
x : A
⊢ ↑(AlgHom.comp (lift A B (_ : Algebra.IsIntegral R A')) (lift A' B (_ : Algebra.IsIntegral R A))) x =
    ↑(AlgHom.id R A) x
[PROOFSTEP]
apply algebraMap_injective A R B
[GOAL]
case H.a
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : Algebra R B
inst✝⁸ : Algebra A B
inst✝⁷ : IsIntegralClosure A R B
A' : Type u_4
inst✝⁶ : CommRing A'
inst✝⁵ : Algebra A' B
inst✝⁴ : IsIntegralClosure A' R B
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : IsScalarTower R A B
inst✝ : IsScalarTower R A' B
x : A
⊢ ↑(algebraMap A B)
      (↑(AlgHom.comp (lift A B (_ : Algebra.IsIntegral R A')) (lift A' B (_ : Algebra.IsIntegral R A))) x) =
    ↑(algebraMap A B) (↑(AlgHom.id R A) x)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S
g : S →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
⊢ IsIntegral { x // x ∈ adjoin R ↑(frange (Polynomial.map (algebraMap A B) p)) } x
[PROOFSTEP]
generalize hS : (↑(p.map <| algebraMap A B).frange : Set B) = S
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
⊢ IsIntegral { x // x ∈ adjoin R S } x
[PROOFSTEP]
have coeffs_mem : ∀ i, (p.map <| algebraMap A B).coeff i ∈ adjoin R S :=
  by
  intro i
  by_cases hi : (p.map <| algebraMap A B).coeff i = 0
  · rw [hi]
    exact Subalgebra.zero_mem _
  rw [← hS]
  exact subset_adjoin (coeff_mem_frange _ _ hi)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
⊢ ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
[PROOFSTEP]
intro i
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
i : ℕ
⊢ coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
[PROOFSTEP]
by_cases hi : (p.map <| algebraMap A B).coeff i = 0
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
i : ℕ
hi : coeff (Polynomial.map (algebraMap A B) p) i = 0
⊢ coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
[PROOFSTEP]
rw [hi]
[GOAL]
case pos
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
i : ℕ
hi : coeff (Polynomial.map (algebraMap A B) p) i = 0
⊢ 0 ∈ adjoin R S
[PROOFSTEP]
exact Subalgebra.zero_mem _
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
i : ℕ
hi : ¬coeff (Polynomial.map (algebraMap A B) p) i = 0
⊢ coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
[PROOFSTEP]
rw [← hS]
[GOAL]
case neg
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
i : ℕ
hi : ¬coeff (Polynomial.map (algebraMap A B) p) i = 0
⊢ coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R ↑(frange (Polynomial.map (algebraMap A B) p))
[PROOFSTEP]
exact subset_adjoin (coeff_mem_frange _ _ hi)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
⊢ IsIntegral { x // x ∈ adjoin R S } x
[PROOFSTEP]
obtain ⟨q, hq⟩ : ∃ q : (adjoin R S)[X], q.map (algebraMap (adjoin R S) B) = (p.map <| algebraMap A B) :=
  by
  rw [← Set.mem_range]
  exact (Polynomial.mem_map_range _).2 fun i => ⟨⟨_, coeffs_mem i⟩, rfl⟩
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
⊢ ∃ q, Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
[PROOFSTEP]
rw [← Set.mem_range]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
⊢ Polynomial.map (algebraMap A B) p ∈ Set.range fun q => Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q
[PROOFSTEP]
exact (Polynomial.mem_map_range _).2 fun i => ⟨⟨_, coeffs_mem i⟩, rfl⟩
[GOAL]
case intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ IsIntegral { x // x ∈ adjoin R S } x
[PROOFSTEP]
use q
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ Monic q ∧ eval₂ (algebraMap { x // x ∈ adjoin R S } B) x q = 0
[PROOFSTEP]
constructor
[GOAL]
case h.left
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ Monic q
[PROOFSTEP]
suffices h : (q.map (algebraMap (adjoin R S) B)).Monic
[GOAL]
case h.left
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
h : Monic (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q)
⊢ Monic q
[PROOFSTEP]
refine' monic_of_injective _ h
[GOAL]
case h.left
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
h : Monic (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q)
⊢ Function.Injective ↑(algebraMap { x // x ∈ adjoin R S } B)
[PROOFSTEP]
exact Subtype.val_injective
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ Monic (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q)
[PROOFSTEP]
rw [hq]
[GOAL]
case h
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ Monic (Polynomial.map (algebraMap A B) p)
[PROOFSTEP]
exact pmonic.map _
[GOAL]
case h.right
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ eval₂ (algebraMap { x // x ∈ adjoin R S } B) x q = 0
[PROOFSTEP]
convert hp using 1
[GOAL]
case h.e'_2
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q = Polynomial.map (algebraMap A B) p
⊢ eval₂ (algebraMap { x // x ∈ adjoin R S } B) x q = ↑(aeval x) p
[PROOFSTEP]
replace hq := congr_arg (eval x) hq
[GOAL]
case h.e'_2
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q) = eval x (Polynomial.map (algebraMap A B) p)
⊢ eval₂ (algebraMap { x // x ∈ adjoin R S } B) x q = ↑(aeval x) p
[PROOFSTEP]
convert hq using 1
[GOAL]
case h.e'_2
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q) = eval x (Polynomial.map (algebraMap A B) p)
⊢ eval₂ (algebraMap { x // x ∈ adjoin R S } B) x q = eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q)
[PROOFSTEP]
symm
[GOAL]
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q) = eval x (Polynomial.map (algebraMap A B) p)
⊢ ↑(aeval x) p = eval x (Polynomial.map (algebraMap A B) p)
[PROOFSTEP]
symm
[GOAL]
case h.e'_2
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q) = eval x (Polynomial.map (algebraMap A B) p)
⊢ eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q) = eval₂ (algebraMap { x // x ∈ adjoin R S } B) x q
[PROOFSTEP]
apply eval_map
[GOAL]
case h.e'_3
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing S✝
inst✝² : CommRing T
inst✝¹ : Algebra A B
inst✝ : Algebra R B
f : R →+* S✝
g : S✝ →+* T
x : B
p : A[X]
pmonic : Monic p
hp : ↑(aeval x) p = 0
S : Set B
hS : ↑(frange (Polynomial.map (algebraMap A B) p)) = S
coeffs_mem : ∀ (i : ℕ), coeff (Polynomial.map (algebraMap A B) p) i ∈ adjoin R S
q : { x // x ∈ adjoin R S }[X]
hq : eval x (Polynomial.map (algebraMap { x // x ∈ adjoin R S } B) q) = eval x (Polynomial.map (algebraMap A B) p)
⊢ eval x (Polynomial.map (algebraMap A B) p) = ↑(aeval x) p
[PROOFSTEP]
apply eval_map
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
hx : IsIntegral A x
⊢ IsIntegral R x
[PROOFSTEP]
rcases hx with ⟨p, pmonic, hp⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
⊢ IsIntegral R x
[PROOFSTEP]
let S : Set B := ↑(p.map <| algebraMap A B).frange
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
⊢ IsIntegral R x
[PROOFSTEP]
refine' isIntegral_of_mem_of_FG (adjoin R (S ∪ { x })) _ _ (subset_adjoin <| Or.inr rfl)
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
⊢ FG (↑Subalgebra.toSubmodule (adjoin R (S ∪ {x})))
[PROOFSTEP]
refine' fg_trans (FG_adjoin_of_finite (Finset.finite_toSet _) fun x hx => _) _
[GOAL]
case intro.intro.refine'_1
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x✝ : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x✝ p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
x : B
hx : x ∈ S
⊢ IsIntegral R x
[PROOFSTEP]
rw [Finset.mem_coe, frange, Finset.mem_image] at hx 
[GOAL]
case intro.intro.refine'_1
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x✝ : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x✝ p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
x : B
hx : ∃ a, a ∈ support (Polynomial.map (algebraMap A B) p) ∧ coeff (Polynomial.map (algebraMap A B) p) a = x
⊢ IsIntegral R x
[PROOFSTEP]
rcases hx with ⟨i, _, rfl⟩
[GOAL]
case intro.intro.refine'_1.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
i : ℕ
left✝ : i ∈ support (Polynomial.map (algebraMap A B) p)
⊢ IsIntegral R (coeff (Polynomial.map (algebraMap A B) p) i)
[PROOFSTEP]
rw [coeff_map]
[GOAL]
case intro.intro.refine'_1.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
i : ℕ
left✝ : i ∈ support (Polynomial.map (algebraMap A B) p)
⊢ IsIntegral R (↑(algebraMap A B) (coeff p i))
[PROOFSTEP]
exact map_isIntegral (IsScalarTower.toAlgHom R A B) (A_int _)
[GOAL]
case intro.intro.refine'_2
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
⊢ FG (↑Subalgebra.toSubmodule (adjoin { x // x ∈ adjoin R S } {x}))
[PROOFSTEP]
apply FG_adjoin_singleton_of_integral
[GOAL]
case intro.intro.refine'_2.hx
R : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S✝
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S✝
g : S✝ →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
A_int : Algebra.IsIntegral R A
x : B
p : A[X]
pmonic : Monic p
hp : eval₂ (algebraMap A B) x p = 0
S : Set B := ↑(frange (Polynomial.map (algebraMap A B) p))
⊢ IsIntegral { x // x ∈ adjoin R S } x
[PROOFSTEP]
exact isIntegral_trans_aux _ pmonic hp
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
H : Function.Injective ↑(algebraMap A B)
x : A
h : IsIntegral R (↑(algebraMap A B) x)
⊢ IsIntegral R x
[PROOFSTEP]
rcases h with ⟨p, ⟨hp, hp'⟩⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
H : Function.Injective ↑(algebraMap A B)
x : A
p : R[X]
hp : Monic p
hp' : eval₂ (algebraMap R ((fun x => B) x)) (↑(algebraMap A B) x) p = 0
⊢ IsIntegral R x
[PROOFSTEP]
refine' ⟨p, ⟨hp, _⟩⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
H : Function.Injective ↑(algebraMap A B)
x : A
p : R[X]
hp : Monic p
hp' : eval₂ (algebraMap R ((fun x => B) x)) (↑(algebraMap A B) x) p = 0
⊢ eval₂ (algebraMap R A) x p = 0
[PROOFSTEP]
rw [IsScalarTower.algebraMap_eq R A B, ← eval₂_map, eval₂_hom, ← RingHom.map_zero (algebraMap A B)] at hp' 
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
H : Function.Injective ↑(algebraMap A B)
x : A
p : R[X]
hp : Monic p
hp' : ↑(algebraMap A B) (eval x (Polynomial.map (algebraMap R A) p)) = ↑(algebraMap A B) 0
⊢ eval₂ (algebraMap R A) x p = 0
[PROOFSTEP]
rw [eval₂_eq_eval_map]
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
H : Function.Injective ↑(algebraMap A B)
x : A
p : R[X]
hp : Monic p
hp' : ↑(algebraMap A B) (eval x (Polynomial.map (algebraMap R A) p)) = ↑(algebraMap A B) 0
⊢ eval x (Polynomial.map (algebraMap R A) p) = 0
[PROOFSTEP]
exact H hp'
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
x : T
h : IsIntegralElem (comp g f) x
p : R[X]
hp : Monic p
hp' : eval₂ (comp g f) x p = 0
⊢ eval₂ g x (Polynomial.map f p) = 0
[PROOFSTEP]
rwa [← eval₂_map] at hp' 
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
x : B
h : IsIntegral R x
⊢ IsIntegral A x
[PROOFSTEP]
rcases h with ⟨p, ⟨hp, hp'⟩⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
x : B
p : R[X]
hp : Monic p
hp' : eval₂ (algebraMap R B) x p = 0
⊢ IsIntegral A x
[PROOFSTEP]
refine' ⟨p.map (algebraMap R A), ⟨hp.map (algebraMap R A), _⟩⟩
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
x : B
p : R[X]
hp : Monic p
hp' : eval₂ (algebraMap R B) x p = 0
⊢ eval₂ (algebraMap A B) x (Polynomial.map (algebraMap R A) p) = 0
[PROOFSTEP]
rw [IsScalarTower.algebraMap_eq R A B, ← eval₂_map] at hp' 
[GOAL]
case intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
x : B
p : R[X]
hp : Monic p
hp' : eval₂ (algebraMap A B) x (Polynomial.map (algebraMap R A) p) = 0
⊢ eval₂ (algebraMap A B) x (Polynomial.map (algebraMap R A) p) = 0
[PROOFSTEP]
exact hp'
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
hf : IsIntegral f
⊢ IsIntegral (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I))
[PROOFSTEP]
rintro ⟨x⟩
[GOAL]
case mk
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
hf : IsIntegral f
x✝ : S ⧸ I
x : S
⊢ IsIntegralElem (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) (Quot.mk Setoid.r x)
[PROOFSTEP]
obtain ⟨p, ⟨p_monic, hpx⟩⟩ := hf x
[GOAL]
case mk.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
hf : IsIntegral f
x✝ : S ⧸ I
x : S
p : R[X]
p_monic : Monic p
hpx : eval₂ f x p = 0
⊢ IsIntegralElem (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) (Quot.mk Setoid.r x)
[PROOFSTEP]
refine' ⟨p.map (Ideal.Quotient.mk _), ⟨p_monic.map _, _⟩⟩
[GOAL]
case mk.intro.intro
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
hf : IsIntegral f
x✝ : S ⧸ I
x : S
p : R[X]
p_monic : Monic p
hpx : eval₂ f x p = 0
⊢ eval₂ (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) (Quot.mk Setoid.r x)
      (Polynomial.map (Ideal.Quotient.mk (Ideal.comap f I)) p) =
    0
[PROOFSTEP]
simpa only [hom_eval₂, eval₂_map] using congr_arg (Ideal.Quotient.mk I) hpx
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
⊢ RingHom.IsIntegral (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) ↔
    RingHom.IsIntegral (RingHom.comp (Ideal.Quotient.mk I) f)
[PROOFSTEP]
let g :=
  Ideal.Quotient.mk
    (I.comap f)
      -- Porting note: added type ascription
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g✝ : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
g : R →+* R ⧸ Ideal.comap f I := Ideal.Quotient.mk (Ideal.comap f I)
⊢ RingHom.IsIntegral (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) ↔
    RingHom.IsIntegral (RingHom.comp (Ideal.Quotient.mk I) f)
[PROOFSTEP]
have : (Ideal.quotientMap I f le_rfl).comp g = (Ideal.Quotient.mk I).comp f := Ideal.quotientMap_comp_mk le_rfl
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g✝ : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
g : R →+* R ⧸ Ideal.comap f I := Ideal.Quotient.mk (Ideal.comap f I)
this :
  RingHom.comp (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) g = RingHom.comp (Ideal.Quotient.mk I) f
⊢ RingHom.IsIntegral (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) ↔
    RingHom.IsIntegral (RingHom.comp (Ideal.Quotient.mk I) f)
[PROOFSTEP]
refine' ⟨fun h => _, fun h => RingHom.isIntegral_tower_top_of_isIntegral g _ (this ▸ h)⟩
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g✝ : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
g : R →+* R ⧸ Ideal.comap f I := Ideal.Quotient.mk (Ideal.comap f I)
this :
  RingHom.comp (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) g = RingHom.comp (Ideal.Quotient.mk I) f
h : RingHom.IsIntegral (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I))
⊢ RingHom.IsIntegral (RingHom.comp (Ideal.Quotient.mk I) f)
[PROOFSTEP]
refine' this ▸ RingHom.isIntegral_trans g (Ideal.quotientMap I f le_rfl) _ h
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
S : Type u_4
T : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : CommRing S
inst✝⁴ : CommRing T
inst✝³ : Algebra A B
inst✝² : Algebra R B
f : R →+* S
g✝ : S →+* T
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
I : Ideal S
g : R →+* R ⧸ Ideal.comap f I := Ideal.Quotient.mk (Ideal.comap f I)
this :
  RingHom.comp (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I)) g = RingHom.comp (Ideal.Quotient.mk I) f
h : RingHom.IsIntegral (Ideal.quotientMap I f (_ : Ideal.comap f I ≤ Ideal.comap f I))
⊢ RingHom.IsIntegral g
[PROOFSTEP]
exact RingHom.isIntegral_of_surjective g Ideal.Quotient.mk_surjective
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
⊢ IsField R
[PROOFSTEP]
refine'
  ⟨⟨0, 1, zero_ne_one⟩, mul_comm, fun {a} ha => _⟩
    -- Let `a_inv` be the inverse of `algebraMap R S a`,
      -- then we need to show that `a_inv` is of the form `algebraMap R S b`.
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
⊢ ∃ b, a * b = 1
[PROOFSTEP]
obtain ⟨a_inv, ha_inv⟩ :=
  hS.mul_inv_cancel fun h =>
    ha
      (hRS (_root_.trans h (RingHom.map_zero _).symm))
        -- Let `p : R[X]` be monic with root `a_inv`,
          -- and `q` be `p` with coefficients reversed (so `q(a) = q'(a) * a + 1`).
          -- We claim that `q(a) = 0`, so `-q'(a)` is the inverse of `a`.
[GOAL]
case intro
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
⊢ ∃ b, a * b = 1
[PROOFSTEP]
obtain ⟨p, p_monic, hp⟩ := H a_inv
[GOAL]
case intro.intro.intro
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ ∃ b, a * b = 1
[PROOFSTEP]
use-∑ i : ℕ in Finset.range p.natDegree,
      p.coeff i *
        a ^
          (p.natDegree - i - 1)
            -- `q(a) = 0`, because multiplying everything with `a_inv^n` gives `p(a_inv) = 0`.
              -- TODO: this could be a lemma for `Polynomial.reverse`.
[GOAL]
case h
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ a * -∑ i in Finset.range (natDegree p), coeff p i * a ^ (natDegree p - i - 1) = 1
[PROOFSTEP]
have hq : (∑ i : ℕ in Finset.range (p.natDegree + 1), p.coeff i * a ^ (p.natDegree - i)) = 0 :=
  by
  apply (injective_iff_map_eq_zero (algebraMap R S)).mp hRS
  have a_inv_ne_zero : a_inv ≠ 0 := right_ne_zero_of_mul (mt ha_inv.symm.trans one_ne_zero)
  refine' (mul_eq_zero.mp _).resolve_right (pow_ne_zero p.natDegree a_inv_ne_zero)
  rw [eval₂_eq_sum_range] at hp 
  rw [map_sum, Finset.sum_mul]
  refine' (Finset.sum_congr rfl fun i hi => _).trans hp
  rw [RingHom.map_mul, mul_assoc]
  congr
  have : a_inv ^ p.natDegree = a_inv ^ (p.natDegree - i) * a_inv ^ i := by
    rw [← pow_add a_inv, tsub_add_cancel_of_le (Nat.le_of_lt_succ (Finset.mem_range.mp hi))]
  rw [RingHom.map_pow, this, ← mul_assoc, ← mul_pow, ha_inv, one_pow, one_mul]
    -- Since `q(a) = 0` and `q(a) = q'(a) * a + 1`, we have `a * -q'(a) = 1`.
      -- TODO: we could use a lemma for `Polynomial.divX` here.
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ ∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i) = 0
[PROOFSTEP]
apply (injective_iff_map_eq_zero (algebraMap R S)).mp hRS
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) = 0
[PROOFSTEP]
have a_inv_ne_zero : a_inv ≠ 0 := right_ne_zero_of_mul (mt ha_inv.symm.trans one_ne_zero)
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) = 0
[PROOFSTEP]
refine' (mul_eq_zero.mp _).resolve_right (pow_ne_zero p.natDegree a_inv_ne_zero)
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) * a_inv ^ natDegree p = 0
[PROOFSTEP]
rw [eval₂_eq_sum_range] at hp 
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) * a_inv ^ natDegree p = 0
[PROOFSTEP]
rw [map_sum, Finset.sum_mul]
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ∑ x in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p x * a ^ (natDegree p - x)) * a_inv ^ natDegree p = 0
[PROOFSTEP]
refine' (Finset.sum_congr rfl fun i hi => _).trans hp
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ ↑(algebraMap R S) (coeff p i * a ^ (natDegree p - i)) * a_inv ^ natDegree p =
    ↑(algebraMap R S) (coeff p i) * a_inv ^ i
[PROOFSTEP]
rw [RingHom.map_mul, mul_assoc]
[GOAL]
case a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ ↑(algebraMap R S) (coeff p i) * (↑(algebraMap R S) (a ^ (natDegree p - i)) * a_inv ^ natDegree p) =
    ↑(algebraMap R S) (coeff p i) * a_inv ^ i
[PROOFSTEP]
congr
[GOAL]
case a.e_a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ ↑(algebraMap R S) (a ^ (natDegree p - i)) * a_inv ^ natDegree p = a_inv ^ i
[PROOFSTEP]
have : a_inv ^ p.natDegree = a_inv ^ (p.natDegree - i) * a_inv ^ i := by
  rw [← pow_add a_inv, tsub_add_cancel_of_le (Nat.le_of_lt_succ (Finset.mem_range.mp hi))]
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ a_inv ^ natDegree p = a_inv ^ (natDegree p - i) * a_inv ^ i
[PROOFSTEP]
rw [← pow_add a_inv, tsub_add_cancel_of_le (Nat.le_of_lt_succ (Finset.mem_range.mp hi))]
[GOAL]
case a.e_a
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
this : a_inv ^ natDegree p = a_inv ^ (natDegree p - i) * a_inv ^ i
⊢ ↑(algebraMap R S) (a ^ (natDegree p - i)) * a_inv ^ natDegree p = a_inv ^ i
[PROOFSTEP]
rw [RingHom.map_pow, this, ← mul_assoc, ← mul_pow, ha_inv, one_pow, one_mul]
  -- Since `q(a) = 0` and `q(a) = q'(a) * a + 1`, we have `a * -q'(a) = 1`.
    -- TODO: we could use a lemma for `Polynomial.divX` here.
[GOAL]
case h
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq : ∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i) = 0
⊢ a * -∑ i in Finset.range (natDegree p), coeff p i * a ^ (natDegree p - i - 1) = 1
[PROOFSTEP]
rw [Finset.sum_range_succ_comm, p_monic.coeff_natDegree, one_mul, tsub_self, pow_zero, add_eq_zero_iff_eq_neg,
  eq_comm] at hq 
[GOAL]
case h
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
⊢ a * -∑ i in Finset.range (natDegree p), coeff p i * a ^ (natDegree p - i - 1) = 1
[PROOFSTEP]
rw [mul_comm, neg_mul, Finset.sum_mul]
[GOAL]
case h
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
⊢ -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x - 1) * a = 1
[PROOFSTEP]
convert hq using 2
[GOAL]
case h.e'_2.h.e'_3
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
⊢ ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x - 1) * a =
    ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x)
[PROOFSTEP]
refine' Finset.sum_congr rfl fun i hi => _
[GOAL]
case h.e'_2.h.e'_3
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
i : ℕ
hi : i ∈ Finset.range (natDegree p)
⊢ coeff p i * a ^ (natDegree p - i - 1) * a = coeff p i * a ^ (natDegree p - i)
[PROOFSTEP]
have : 1 ≤ p.natDegree - i := le_tsub_of_add_le_left (Finset.mem_range.mp hi)
[GOAL]
case h.e'_2.h.e'_3
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
i : ℕ
hi : i ∈ Finset.range (natDegree p)
this : 1 ≤ natDegree p - i
⊢ coeff p i * a ^ (natDegree p - i - 1) * a = coeff p i * a ^ (natDegree p - i)
[PROOFSTEP]
rw [mul_assoc, ← pow_succ', tsub_add_cancel_of_le this]
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A
inst✝⁴ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
⊢ IsField S
[PROOFSTEP]
letI := hR.toField
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A
inst✝⁴ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
this : Field R := IsField.toField hR
⊢ IsField S
[PROOFSTEP]
refine' ⟨⟨0, 1, zero_ne_one⟩, mul_comm, fun {x} hx => _⟩
[GOAL]
R✝ : Type u_1
A : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A
inst✝⁴ : IsScalarTower R✝ A B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
this : Field R := IsField.toField hR
x : S
hx : x ≠ 0
⊢ ∃ b, x * b = 1
[PROOFSTEP]
let A := Algebra.adjoin R ({ x } : Set S)
[GOAL]
R✝ : Type u_1
A✝ : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A✝
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A✝ B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A✝
inst✝⁴ : IsScalarTower R✝ A✝ B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
this : Field R := IsField.toField hR
x : S
hx : x ≠ 0
A : Subalgebra R S := adjoin R {x}
⊢ ∃ b, x * b = 1
[PROOFSTEP]
haveI : IsNoetherian R A :=
  isNoetherian_of_fg_of_noetherian (Subalgebra.toSubmodule A) (FG_adjoin_singleton_of_integral x (H x))
[GOAL]
R✝ : Type u_1
A✝ : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A✝
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A✝ B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A✝
inst✝⁴ : IsScalarTower R✝ A✝ B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
this✝ : Field R := IsField.toField hR
x : S
hx : x ≠ 0
A : Subalgebra R S := adjoin R {x}
this : IsNoetherian R { x // x ∈ A }
⊢ ∃ b, x * b = 1
[PROOFSTEP]
haveI : Module.Finite R A := Module.IsNoetherian.finite R A
[GOAL]
R✝ : Type u_1
A✝ : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A✝
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A✝ B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A✝
inst✝⁴ : IsScalarTower R✝ A✝ B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
this✝¹ : Field R := IsField.toField hR
x : S
hx : x ≠ 0
A : Subalgebra R S := adjoin R {x}
this✝ : IsNoetherian R { x // x ∈ A }
this : Module.Finite R { x // x ∈ A }
⊢ ∃ b, x * b = 1
[PROOFSTEP]
obtain ⟨y, hy⟩ :=
  LinearMap.surjective_of_injective
    (@LinearMap.mulLeft_injective R A _ _ _ _ ⟨x, subset_adjoin (Set.mem_singleton x)⟩ fun h =>
      hx (Subtype.ext_iff.mp h))
    1
[GOAL]
case intro
R✝ : Type u_1
A✝ : Type u_2
B : Type u_3
S✝ : Type u_4
T : Type u_5
inst✝¹² : CommRing R✝
inst✝¹¹ : CommRing A✝
inst✝¹⁰ : CommRing B
inst✝⁹ : CommRing S✝
inst✝⁸ : CommRing T
inst✝⁷ : Algebra A✝ B
inst✝⁶ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁵ : Algebra R✝ A✝
inst✝⁴ : IsScalarTower R✝ A✝ B
R : Type u_6
S : Type u_7
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hR : IsField R
this✝¹ : Field R := IsField.toField hR
x : S
hx : x ≠ 0
A : Subalgebra R S := adjoin R {x}
this✝ : IsNoetherian R { x // x ∈ A }
this : Module.Finite R { x // x ∈ A }
y : { x // x ∈ A }
hy : ↑(LinearMap.mulLeft R { val := x, property := (_ : x ∈ ↑(adjoin R {x})) }) y = 1
⊢ ∃ b, x * b = 1
[PROOFSTEP]
exact ⟨y, Subtype.ext_iff.mp hy⟩
