Theorem: Field.sepDegree_eq_of_isPurelyInseparable_of_isSeparable
File: Mathlib/FieldTheory/PurelyInseparable.lean

tactic: let S := separableClosure F K
state_before: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
⊢ sepDegree F K = Module.rank E K
state_after: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
⊢ sepDegree F K = Module.rank E K

tactic: have h := S.adjoin_rank_le_of_isAlgebraic_right E
state_before: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
⊢ sepDegree F K = Module.rank E K
state_after: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E ↥(adjoin E ↑S) ≤ Module.rank F ↥S
⊢ sepDegree F K = Module.rank E K

tactic: rw [separableClosure.adjoin_eq_of_isAlgebraic_of_isSeparable K, rank_top'] at h
state_before: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E ↥(adjoin E ↑S) ≤ Module.rank F ↥S
⊢ sepDegree F K = Module.rank E K
state_after: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E K ≤ Module.rank F ↥S
⊢ sepDegree F K = Module.rank E K

tactic: obtain ⟨ι, ⟨b⟩⟩ := Basis.exists_basis F S
state_before: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E K ≤ Module.rank F ↥S
⊢ sepDegree F K = Module.rank E K
state_after: case intro.intro
F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E K ≤ Module.rank F ↥S
ι : Set ↥S
b : Basis (↑ι) F ↥S
⊢ sepDegree F K = Module.rank E K

tactic: exact h.antisymm' (b.mk_eq_rank'' ▸ (b.linearIndependent.map' S.val.toLinearMap
  (LinearMap.ker_eq_bot_of_injective S.val.injective) |>.map_of_isPurelyInseparable_of_separable E
    (fun i ↦ by simpa only [minpoly_eq] using IsSeparable.separable F (b i)) |>.cardinal_le_rank))
state_before: case intro.intro
F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E K ≤ Module.rank F ↥S
ι : Set ↥S
b : Basis (↑ι) F ↥S
⊢ sepDegree F K = Module.rank E K
state_after: no goals

tactic: simpa only [minpoly_eq] using IsSeparable.separable F (b i)
state_before: F : Type u
E : Type v
inst✝⁸ : Field F
inst✝⁷ : Field E
inst✝⁶ : Algebra F E
K : Type w
inst✝⁵ : Field K
inst✝⁴ : Algebra F K
inst✝³ : Algebra E K
inst✝² : IsScalarTower F E K
inst✝¹ : IsPurelyInseparable F E
inst✝ : IsSeparable E K
S : IntermediateField F K := separableClosure F K
h : Module.rank E K ≤ Module.rank F ↥S
ι : Set ↥S
b : Basis (↑ι) F ↥S
i : ↑ι
⊢ (minpoly F ((⇑S.val.toLinearMap ∘ ⇑b) i)).Separable
state_after: no goals