Theorem: IntermediateField.sup_toSubalgebra
File: Mathlib/FieldTheory/Adjoin.lean

tactic: let S1 := E1.toSubalgebra
state_before: K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
⊢ (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra

tactic: let S2 := E2.toSubalgebra
state_before: K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
⊢ (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra

tactic: refine'
  le_antisymm
    (show _ ≤ (S1 ⊔ S2).toIntermediateField _ from
      sup_le (show S1 ≤ _ from le_sup_left) (show S2 ≤ _ from le_sup_right))
    (le_sup_toSubalgebra E1 E2)
state_before: K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
⊢ (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra

tactic: exact
  isField_of_isIntegral_of_isField'
    (isIntegral_sup.mpr ⟨Algebra.isIntegral_of_finite K E1, Algebra.isIntegral_of_finite K E2⟩)
    (Field.toIsField K)
state_before: K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
⊢ IsField { x // x ∈ S1 ⊔ S2 }

tactic: intro x hx
state_before: K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
this : IsField { x // x ∈ S1 ⊔ S2 }
⊢ ∀ (x : L), x ∈ S1 ⊔ S2 → x⁻¹ ∈ S1 ⊔ S2

tactic: by_cases hx' : (⟨x, hx⟩ : (S1 ⊔ S2 : Subalgebra K L)) = 0
state_before: K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
this : IsField { x // x ∈ S1 ⊔ S2 }
x : L
hx : x ∈ S1 ⊔ S2
⊢ x⁻¹ ∈ S1 ⊔ S2

tactic: rw [← Subtype.coe_mk x, hx', Subalgebra.coe_zero, inv_zero]
state_before: case pos
K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
this : IsField { x // x ∈ S1 ⊔ S2 }
x : L
hx : x ∈ S1 ⊔ S2
hx' : { val := x, property := hx } = 0
⊢ x⁻¹ ∈ S1 ⊔ S2

tactic: exact (S1 ⊔ S2).zero_mem
state_before: case pos
K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
this : IsField { x // x ∈ S1 ⊔ S2 }
x : L
hx : x ∈ S1 ⊔ S2
hx' : { val := x, property := hx } = 0
⊢ 0 ∈ S1 ⊔ S2

tactic: obtain ⟨y, h⟩ := this.mul_inv_cancel hx'
state_before: case neg
K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
E1 E2 : IntermediateField K L
h1 : FiniteDimensional K { x // x ∈ E1 }
h2 : FiniteDimensional K { x // x ∈ E2 }
S1 : Subalgebra K L := E1.toSubalgebra
S2 : Subalgebra K L := E2.toSubalgebra
this : IsField { x // x ∈ S1 ⊔ S2 }
x : L
hx : x ∈ S1 ⊔ S2
hx' : ¬{ val := x, property := hx } = 0
⊢ x⁻¹ ∈ S1 ⊔ S2