-- Mathlib/RingTheory/Adjoin/Field.lean
theorem Polynomial.lift_of_splits {F K L : Type*} [Field F] [Field K] [Field L] [Algebra F K]
    [Algebra F L] (s : Finset K) : (∀ x ∈ s, IsIntegral F x ∧
      Splits (algebraMap F L) (minpoly F x)) → Nonempty (Algebra.adjoin F (s : Set K) →ₐ[F] L)

Proof state:
case refine_2.intro.intro.intro
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this : FiniteDimensional F ↥Ks
⊢ Nonempty (↥(Subalgebra.restrictScalars F (Algebra.adjoin ↥Ks {a})) →ₐ[F] L)

Tactic:
letI := fieldOfFiniteDimensional F Ks

Result:
case refine_2.intro.intro.intro
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this✝ : FiniteDimensional F ↥Ks
this : Field ↥Ks := fieldOfFiniteDimensional F ↥Ks
⊢ Nonempty (↥(Subalgebra.restrictScalars F (Algebra.adjoin ↥Ks {a})) →ₐ[F] L)

Proof state:
case refine_1
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this✝¹ : FiniteDimensional F ↥Ks
this✝ : Field ↥Ks := fieldOfFiniteDimensional F ↥Ks
this : Algebra (↥Ks) L := (↑f).toAlgebra
H5 : IsIntegral (↥Ks) a
⊢ Splits (algebraMap F L) (minpoly F a)

Tactic:
exact H2

Result:
no goals

Proof state:
case refine_2.intro.intro.intro
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥(Algebra.adjoin F ↑s) →ₐ[F] L)
H3 : ∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
f : ↥(Algebra.adjoin F ↑s) →ₐ[F] L
⊢ Nonempty (↥(Algebra.adjoin F ↑(insert a s)) →ₐ[F] L)

Tactic:
choose H3 _ using H3

Result:
case refine_2.intro.intro.intro
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥(Algebra.adjoin F ↑s) →ₐ[F] L)
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
f : ↥(Algebra.adjoin F ↑s) →ₐ[F] L
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
⊢ Nonempty (↥(Algebra.adjoin F ↑(insert a s)) →ₐ[F] L)

Proof state:
case refine_2.intro.intro.intro.intro
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this✝¹ : FiniteDimensional F ↥Ks
this✝ : Field ↥Ks := fieldOfFiniteDimensional F ↥Ks
this : Algebra (↥Ks) L := (↑f).toAlgebra
H5 : IsIntegral (↥Ks) a
H6 : Splits (algebraMap (↥Ks) L) (minpoly (↥Ks) a)
y : L
hy : eval₂ (algebraMap (↥Ks) L) y (minpoly (↥Ks) a) = 0
⊢ Nonempty (↥(Subalgebra.restrictScalars F (Algebra.adjoin ↥Ks {a})) →ₐ[F] L)

Tactic:
exact ⟨Subalgebra.ofRestrictScalars F _ <| Algebra.adjoin.liftSingleton Ks a y hy⟩

Result:
no goals

Proof state:
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this✝¹ : FiniteDimensional F ↥Ks
this✝ : Field ↥Ks := fieldOfFiniteDimensional F ↥Ks
this : Algebra (↥Ks) L := (↑f).toAlgebra
H5 : IsIntegral (↥Ks) a
⊢ Splits (algebraMap (↥Ks) L) (minpoly (↥Ks) a)

Tactic:
refine splits_of_splits_of_dvd _ ((minpoly.monic H1).map (algebraMap F Ks)).ne_zero
  ((splits_map_iff _ _).2 ?_) (minpoly.dvd _ _ ?_)

Result:
case refine_1
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this✝¹ : FiniteDimensional F ↥Ks
this✝ : Field ↥Ks := fieldOfFiniteDimensional F ↥Ks
this : Algebra (↥Ks) L := (↑f).toAlgebra
H5 : IsIntegral (↥Ks) a
⊢ Splits ((algebraMap (↥Ks) L).comp (algebraMap F ↥Ks)) (minpoly F a)

case refine_2
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s✝ : Finset K
a : K
s : Finset K
x✝ : a ∉ s
H1 : IsIntegral F a
H2 : Splits (algebraMap F L) (minpoly F a)
H3 : ∀ x ∈ s, IsIntegral F x
a✝ : ∀ x ∈ s, Splits (algebraMap F L) (minpoly F x)
Ks : Subalgebra F K := Algebra.adjoin F ↑s
ih : (∀ x ∈ s, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)) → Nonempty (↥Ks →ₐ[F] L)
f : ↥Ks →ₐ[F] L
this✝¹ : FiniteDimensional F ↥Ks
this✝ : Field ↥Ks := fieldOfFiniteDimensional F ↥Ks
this : Algebra (↥Ks) L := (↑f).toAlgebra
H5 : IsIntegral (↥Ks) a
⊢ (aeval a) (map (algebraMap F ↥Ks) (minpoly F a)) = 0

Proof state:
case refine_1
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s : Finset K
x✝ : ∀ x ∈ ∅, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)
⊢ Nonempty (↥(Algebra.adjoin F ↑∅) →ₐ[F] L)

Tactic:
rw [coe_empty, Algebra.adjoin_empty]

Result:
case refine_1
F : Type u_2
K : Type u_3
L : Type u_4
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
s : Finset K
x✝ : ∀ x ∈ ∅, IsIntegral F x ∧ Splits (algebraMap F L) (minpoly F x)
⊢ Nonempty (↥⊥ →ₐ[F] L)