l3lab/ntp-mathlib huggingface dataset:
/-- For the equality, see `cthickening_thickening`. -/
@[simp]
theorem cthickening_thickening_subset (hε : 0 ≤ ε) (δ : ℝ) (s : Set α) :
    cthickening ε (thickening δ s) ⊆ cthickening (ε + δ) s := by
  obtain hδ | hδ := le_total δ 0
  · simp only [thickening_of_nonpos hδ, cthickening_empty, empty_subset]
  

Proof state:
case inr
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ✝ ε : ℝ
s✝ t : Set α
x : α
hε : 0 ≤ ε
δ : ℝ
s : Set α
hδ : 0 ≤ δ
⊢ cthickening ε (thickening δ s) ⊆ cthickening (ε + δ) s

Next tactic:
intro x
/-- For the equality, see `cthickening_thickening`. -/
@[simp]
theorem cthickening_thickening_subset (hε : 0 ≤ ε) (δ : ℝ) (s : Set α) :
    cthickening ε (thickening δ s) ⊆ cthickening (ε + δ) s := by
  obtain hδ | hδ := le_total δ 0
  · simp only [thickening_of_nonpos hδ, cthickening_empty, empty_subset]
  intro x
  

Proof state:
case inr
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ✝ ε : ℝ
s✝ t : Set α
x✝ : α
hε : 0 ≤ ε
δ : ℝ
s : Set α
hδ : 0 ≤ δ
x : α
⊢ x ∈ cthickening ε (thickening δ s) → x ∈ cthickening (ε + δ) s

Next tactic:
simp_rw [mem_cthickening_iff, ENNReal.ofReal_add hε hδ]
/-- For the equality, see `cthickening_thickening`. -/
@[simp]
theorem cthickening_thickening_subset (hε : 0 ≤ ε) (δ : ℝ) (s : Set α) :
    cthickening ε (thickening δ s) ⊆ cthickening (ε + δ) s := by
  obtain hδ | hδ := le_total δ 0
  · simp only [thickening_of_nonpos hδ, cthickening_empty, empty_subset]
  intro x
  simp_rw [mem_cthickening_iff, ENNReal.ofReal_add hε hδ]
  

Proof state:
case inr
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ✝ ε : ℝ
s✝ t : Set α
x✝ : α
hε : 0 ≤ ε
δ : ℝ
s : Set α
hδ : 0 ≤ δ
x : α
⊢ infEdist x (thickening δ s) ≤ ENNReal.ofReal ε → infEdist x s ≤ ENNReal.ofReal ε + ENNReal.ofReal δ

Next tactic:
exact fun hx => infEdist_le_infEdist_thickening_add.trans (add_le_add_right hx _)
/-- For the equality, see `cthickening_cthickening`. -/
@[simp]
theorem cthickening_cthickening_subset (hε : 0 ≤ ε) (hδ : 0 ≤ δ) (s : Set α) :
    cthickening ε (cthickening δ s) ⊆ cthickening (ε + δ) s := by
  

Proof state:
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ ε : ℝ
s✝ t : Set α
x : α
hε : 0 ≤ ε
hδ : 0 ≤ δ
s : Set α
⊢ cthickening ε (cthickening δ s) ⊆ cthickening (ε + δ) s

Next tactic:
intro x
/-- For the equality, see `cthickening_cthickening`. -/
@[simp]
theorem cthickening_cthickening_subset (hε : 0 ≤ ε) (hδ : 0 ≤ δ) (s : Set α) :
    cthickening ε (cthickening δ s) ⊆ cthickening (ε + δ) s := by
  intro x
  

Proof state:
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ ε : ℝ
s✝ t : Set α
x✝ : α
hε : 0 ≤ ε
hδ : 0 ≤ δ
s : Set α
x : α
⊢ x ∈ cthickening ε (cthickening δ s) → x ∈ cthickening (ε + δ) s

Next tactic:
simp_rw [mem_cthickening_iff, ENNReal.ofReal_add hε hδ]
/-- For the equality, see `cthickening_cthickening`. -/
@[simp]
theorem cthickening_cthickening_subset (hε : 0 ≤ ε) (hδ : 0 ≤ δ) (s : Set α) :
    cthickening ε (cthickening δ s) ⊆ cthickening (ε + δ) s := by
  intro x
  simp_rw [mem_cthickening_iff, ENNReal.ofReal_add hε hδ]
  

Proof state:
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ ε : ℝ
s✝ t : Set α
x✝ : α
hε : 0 ≤ ε
hδ : 0 ≤ δ
s : Set α
x : α
⊢ infEdist x (cthickening δ s) ≤ ENNReal.ofReal ε → infEdist x s ≤ ENNReal.ofReal ε + ENNReal.ofReal δ

Next tactic:
exact fun hx => infEdist_le_infEdist_cthickening_add.trans (add_le_add_right hx _)
theorem frontier_cthickening_disjoint (A : Set α) :
    Pairwise (Disjoint on fun r : ℝ≥0 => frontier (cthickening r A)) := fun r₁ r₂ hr =>
  ((disjoint_singleton.2 <| by 

Proof state:
ι : Sort u_1
α : Type u
β : Type v
inst✝ : PseudoEMetricSpace α
δ ε : ℝ
s t : Set α
x : α
A : Set α
r₁ r₂ : ℝ≥0
hr : r₁ ≠ r₂
⊢ ENNReal.ofReal ↑r₁ ≠ ENNReal.ofReal ↑r₂

Next tactic:
simpa
theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E}
    (hα : IsIntegral F α) (h_sep : (minpoly F α).Separable)
    (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) :
    Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯ := by
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
inst✝ : FiniteDimensional F E
α : E
hα : IsIntegral F α
h_sep : Polynomial.Separable (minpoly F α)
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
⊢ Fintype.card (↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯) = finrank F ↥F⟮α⟯

Next tactic:
letI : Fintype (F⟮α⟯ →ₐ[F] F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E}
    (hα : IsIntegral F α) (h_sep : (minpoly F α).Separable)
    (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) :
    Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯ := by
  letI : Fintype (F⟮α⟯ →ₐ[F] F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
inst✝ : FiniteDimensional F E
α : E
hα : IsIntegral F α
h_sep : Polynomial.Separable (minpoly F α)
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
this : Fintype (↥F⟮α⟯ →ₐ[F] ↥F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
⊢ Fintype.card (↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯) = finrank F ↥F⟮α⟯

Next tactic:
rw [IntermediateField.adjoin.finrank hα]
theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E}
    (hα : IsIntegral F α) (h_sep : (minpoly F α).Separable)
    (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) :
    Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯ := by
  letI : Fintype (F⟮α⟯ →ₐ[F] F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
  rw [IntermediateField.adjoin.finrank hα]
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
inst✝ : FiniteDimensional F E
α : E
hα : IsIntegral F α
h_sep : Polynomial.Separable (minpoly F α)
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
this : Fintype (↥F⟮α⟯ →ₐ[F] ↥F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
⊢ Fintype.card (↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯) = Polynomial.natDegree (minpoly F α)

Next tactic:
rw [← IntermediateField.card_algHom_adjoin_integral F hα h_sep h_splits]
theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E}
    (hα : IsIntegral F α) (h_sep : (minpoly F α).Separable)
    (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) :
    Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯ := by
  letI : Fintype (F⟮α⟯ →ₐ[F] F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
  rw [IntermediateField.adjoin.finrank hα]
  rw [← IntermediateField.card_algHom_adjoin_integral F hα h_sep h_splits]
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
inst✝ : FiniteDimensional F E
α : E
hα : IsIntegral F α
h_sep : Polynomial.Separable (minpoly F α)
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
this : Fintype (↥F⟮α⟯ →ₐ[F] ↥F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα
⊢ Fintype.card (↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯) = Fintype.card (↥F⟮α⟯ →ₐ[F] ↥F⟮α⟯)

Next tactic:
exact Fintype.card_congr (algEquivEquivAlgHom F F⟮α⟯)
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E := by
  

Proof state:
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
inst✝¹ : FiniteDimensional F E
inst✝ : IsGalois F E
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

Next tactic:
cases' Field.exists_primitive_element F E with α hα
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E := by
  cases' Field.exists_primitive_element F E with α hα
  

Proof state:
case intro
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
inst✝¹ : FiniteDimensional F E
inst✝ : IsGalois F E
α : E
hα : F⟮α⟯ = ⊤
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

Next tactic:
let iso : F⟮α⟯ ≃ₐ[F] E :=
    { toFun := fun e => e.val
      invFun := fun e => ⟨e, by rw [hα]; exact IntermediateField.mem_top⟩
      left_inv := fun _ => by ext; rfl
      right_inv := fun _ => rfl
      map_mul' := fun _ _ => rfl
      map_add' := fun _ _ => rfl
      commutes' := fun _ => rfl }
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E := by
  cases' Field.exists_primitive_element F E with α hα
  let iso : F⟮α⟯ ≃ₐ[F] E :=
    { toFun := fun e => e.val
      invFun := fun e => ⟨e, by 

Proof state:
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
inst✝¹ : FiniteDimensional F E
inst✝ : IsGalois F E
α : E
hα : F⟮α⟯ = ⊤
e : E
⊢ e ∈ F⟮α⟯

Next tactic:
rw [hα]
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E := by
  cases' Field.exists_primitive_element F E with α hα
  let iso : F⟮α⟯ ≃ₐ[F] E :=
    { toFun := fun e => e.val
      invFun := fun e => ⟨e, by rw [hα]; 

Proof state:
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
inst✝¹ : FiniteDimensional F E
inst✝ : IsGalois F E
α : E
hα : F⟮α⟯ = ⊤
e : E
⊢ e ∈ ⊤

Next tactic:
exact IntermediateField.mem_top
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E := by
  cases' Field.exists_primitive_element F E with α hα
  let iso : F⟮α⟯ ≃ₐ[F] E :=
    { toFun := fun e => e.val
      invFun := fun e => ⟨e, by rw [hα]; exact IntermediateField.mem_top⟩
      left_inv := fun _ => by 

Proof state:
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
inst✝¹ : FiniteDimensional F E
inst✝ : IsGalois F E
α : E
hα : F⟮α⟯ = ⊤
x✝ : ↥F⟮α⟯
⊢ (fun e => { val := e, property := (_ : e ∈ F⟮α⟯) }) ((fun e => ↑e) x✝) = x✝

Next tactic:
ext
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E := by
  cases' Field.exists_primitive_element F E with α hα
  let iso : F⟮α⟯ ≃ₐ[F] E :=
    { toFun := fun e => e.val
      invFun := fun e => ⟨e, by rw [hα]; exact IntermediateField.mem_top⟩
      left_inv := fun _ => by ext; 

Proof state:
case a
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
inst✝¹ : FiniteDimensional F E
inst✝ : IsGalois F E
α : E
hα : F⟮α⟯ = ⊤
x✝ : ↥F⟮α⟯
⊢ ↑((fun e => { val := e, property := (_ : e ∈ F⟮α⟯) }) ((fun e => ↑e) x✝)) = ↑x✝

Next tactic:
rfl
theorem isGalois_iff_isGalois_bot : IsGalois (⊥ : IntermediateField F E) E ↔ IsGalois F E := by
  

Proof state:
F : Type u_1
K : Type u_2
E : Type u_3
inst✝⁸ : Field F
inst✝⁷ : Field K
inst✝⁶ : Field E
E' : Type u_4
inst✝⁵ : Field E'
inst✝⁴ : Algebra F E'
inst✝³ : Algebra F K
inst✝² : Algebra F E
inst✝¹ : Algebra K E
inst✝ : IsScalarTower F K E
⊢ IsGalois (↥⊥) E ↔ IsGalois F E

Next tactic:
constructor
theorem isGalois_iff_isGalois_bot : IsGalois (⊥ : IntermediateField F E) E ↔ IsGalois F E := by
  constructor
  · 

Proof state:
case mp
F : Type u_1
K : Type u_2
E : Type u_3
inst✝⁸ : Field F
inst✝⁷ : Field K
inst✝⁶ : Field E
E' : Type u_4
inst✝⁵ : Field E'
inst✝⁴ : Algebra F E'
inst✝³ : Algebra F K
inst✝² : Algebra F E
inst✝¹ : Algebra K E
inst✝ : IsScalarTower F K E
⊢ IsGalois (↥⊥) E → IsGalois F E

Next tactic:
intro h
theorem isGalois_iff_isGalois_bot : IsGalois (⊥ : IntermediateField F E) E ↔ IsGalois F E := by
  constructor
  · intro h
    

Proof state:
case mp
F : Type u_1
K : Type u_2
E : Type u_3
inst✝⁸ : Field F
inst✝⁷ : Field K
inst✝⁶ : Field E
E' : Type u_4
inst✝⁵ : Field E'
inst✝⁴ : Algebra F E'
inst✝³ : Algebra F K
inst✝² : Algebra F E
inst✝¹ : Algebra K E
inst✝ : IsScalarTower F K E
h : IsGalois (↥⊥) E
⊢ IsGalois F E

Next tactic:
exact IsGalois.tower_top_of_isGalois (⊥ : IntermediateField F E) F E
theorem isGalois_iff_isGalois_bot : IsGalois (⊥ : IntermediateField F E) E ↔ IsGalois F E := by
  constructor
  · intro h
    exact IsGalois.tower_top_of_isGalois (⊥ : IntermediateField F E) F E
  · 

Proof state:
case mpr
F : Type u_1
K : Type u_2
E : Type u_3
inst✝⁸ : Field F
inst✝⁷ : Field K
inst✝⁶ : Field E
E' : Type u_4
inst✝⁵ : Field E'
inst✝⁴ : Algebra F E'
inst✝³ : Algebra F K
inst✝² : Algebra F E
inst✝¹ : Algebra K E
inst✝ : IsScalarTower F K E
⊢ IsGalois F E → IsGalois (↥⊥) E

Next tactic:
intro h
theorem isGalois_iff_isGalois_bot : IsGalois (⊥ : IntermediateField F E) E ↔ IsGalois F E := by
  constructor
  · intro h
    exact IsGalois.tower_top_of_isGalois (⊥ : IntermediateField F E) F E
  · intro h; 

Proof state:
case mpr
F : Type u_1
K : Type u_2
E : Type u_3
inst✝⁸ : Field F
inst✝⁷ : Field K
inst✝⁶ : Field E
E' : Type u_4
inst✝⁵ : Field E'
inst✝⁴ : Algebra F E'
inst✝³ : Algebra F K
inst✝² : Algebra F E
inst✝¹ : Algebra K E
inst✝ : IsScalarTower F K E
h : IsGalois F E
⊢ IsGalois (↥⊥) E

Next tactic:
infer_instance
/-- The intermediate field of fixed points fixed by a monoid action that commutes with the
`F`-action on `E`. -/
def FixedPoints.intermediateField (M : Type*) [Monoid M] [MulSemiringAction M E]
    [SMulCommClass M F E] : IntermediateField F E :=
  { FixedPoints.subfield M E with
    carrier := MulAction.fixedPoints M E
    algebraMap_mem' := fun a g => by 

Proof state:
F : Type u_1
inst✝⁵ : Field F
E : Type u_2
inst✝⁴ : Field E
inst✝³ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
M : Type u_3
inst✝² : Monoid M
inst✝¹ : MulSemiringAction M E
inst✝ : SMulCommClass M F E
src✝ : Subfield E := subfield M E
a : F
g : M
⊢ g • (algebraMap F E) a = (algebraMap F E) a

Next tactic:
rw [Algebra.algebraMap_eq_smul_one, smul_comm, smul_one]
/-- The fixing subgroup of `K : IntermediateField F E` is isomorphic to `E ≃ₐ[K] E` -/
def fixingSubgroupEquiv : fixingSubgroup K ≃* E ≃ₐ[K] E where
  toFun ϕ := { AlgEquiv.toRingEquiv (ϕ : E ≃ₐ[F] E) with commutes' := ϕ.mem }
  invFun ϕ := ⟨ϕ.restrictScalars _, ϕ.commutes⟩
  left_inv _ := by 

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
x✝ : ↥(fixingSubgroup K)
⊢ (fun ϕ =>
        { val := AlgEquiv.restrictScalars F ϕ,
          property := (_ : ∀ (r : ↥K), ϕ ((algebraMap (↥K) E) r) = (algebraMap (↥K) E) r) })
      ((fun ϕ =>
          let src := toRingEquiv ↑ϕ;
          { toEquiv := src.toEquiv,
            map_mul' :=
              (_ :
                ∀ (x y : E), Equiv.toFun src.toEquiv (x * y) = Equiv.toFun src.toEquiv x * Equiv.toFun src.toEquiv y),
            map_add' :=
              (_ :
                ∀ (x y : E), Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y),
            commutes' := (_ : ↑ϕ ∈ ↑(fixingSubgroup K)) })
        x✝) =
    x✝

Next tactic:
ext
/-- The fixing subgroup of `K : IntermediateField F E` is isomorphic to `E ≃ₐ[K] E` -/
def fixingSubgroupEquiv : fixingSubgroup K ≃* E ≃ₐ[K] E where
  toFun ϕ := { AlgEquiv.toRingEquiv (ϕ : E ≃ₐ[F] E) with commutes' := ϕ.mem }
  invFun ϕ := ⟨ϕ.restrictScalars _, ϕ.commutes⟩
  left_inv _ := by ext; 

Proof state:
case a.h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
x✝ : ↥(fixingSubgroup K)
a✝ : E
⊢ ↑((fun ϕ =>
            { val := AlgEquiv.restrictScalars F ϕ,
              property := (_ : ∀ (r : ↥K), ϕ ((algebraMap (↥K) E) r) = (algebraMap (↥K) E) r) })
          ((fun ϕ =>
              let src := toRingEquiv ↑ϕ;
              { toEquiv := src.toEquiv,
                map_mul' :=
                  (_ :
                    ∀ (x y : E),
                      Equiv.toFun src.toEquiv (x * y) = Equiv.toFun src.toEquiv x * Equiv.toFun src.toEquiv y),
                map_add' :=
                  (_ :
                    ∀ (x y : E),
                      Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y),
                commutes' := (_ : ↑ϕ ∈ ↑(fixingSubgroup K)) })
            x✝))
      a✝ =
    ↑x✝ a✝

Next tactic:
rfl
/-- The fixing subgroup of `K : IntermediateField F E` is isomorphic to `E ≃ₐ[K] E` -/
def fixingSubgroupEquiv : fixingSubgroup K ≃* E ≃ₐ[K] E where
  toFun ϕ := { AlgEquiv.toRingEquiv (ϕ : E ≃ₐ[F] E) with commutes' := ϕ.mem }
  invFun ϕ := ⟨ϕ.restrictScalars _, ϕ.commutes⟩
  left_inv _ := by ext; rfl
  right_inv _ := by 

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
x✝ : E ≃ₐ[↥K] E
⊢ (fun ϕ =>
        let src := toRingEquiv ↑ϕ;
        { toEquiv := src.toEquiv,
          map_mul' :=
            (_ : ∀ (x y : E), Equiv.toFun src.toEquiv (x * y) = Equiv.toFun src.toEquiv x * Equiv.toFun src.toEquiv y),
          map_add' :=
            (_ : ∀ (x y : E), Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y),
          commutes' := (_ : ↑ϕ ∈ ↑(fixingSubgroup K)) })
      ((fun ϕ =>
          { val := AlgEquiv.restrictScalars F ϕ,
            property := (_ : ∀ (r : ↥K), ϕ ((algebraMap (↥K) E) r) = (algebraMap (↥K) E) r) })
        x✝) =
    x✝

Next tactic:
ext
/-- The fixing subgroup of `K : IntermediateField F E` is isomorphic to `E ≃ₐ[K] E` -/
def fixingSubgroupEquiv : fixingSubgroup K ≃* E ≃ₐ[K] E where
  toFun ϕ := { AlgEquiv.toRingEquiv (ϕ : E ≃ₐ[F] E) with commutes' := ϕ.mem }
  invFun ϕ := ⟨ϕ.restrictScalars _, ϕ.commutes⟩
  left_inv _ := by ext; rfl
  right_inv _ := by ext; 

Proof state:
case h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
x✝ : E ≃ₐ[↥K] E
a✝ : E
⊢ ((fun ϕ =>
          let src := toRingEquiv ↑ϕ;
          { toEquiv := src.toEquiv,
            map_mul' :=
              (_ :
                ∀ (x y : E), Equiv.toFun src.toEquiv (x * y) = Equiv.toFun src.toEquiv x * Equiv.toFun src.toEquiv y),
            map_add' :=
              (_ :
                ∀ (x y : E), Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y),
            commutes' := (_ : ↑ϕ ∈ ↑(fixingSubgroup K)) })
        ((fun ϕ =>
            { val := AlgEquiv.restrictScalars F ϕ,
              property := (_ : ∀ (r : ↥K), ϕ ((algebraMap (↥K) E) r) = (algebraMap (↥K) E) r) })
          x✝))
      a✝ =
    x✝ a✝

Next tactic:
rfl
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
⊢ fixingSubgroup (fixedField H) = H

Next tactic:
have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
H_le : H ≤ fixingSubgroup (fixedField H)
⊢ fixingSubgroup (fixedField H) = H

Next tactic:
classical
  suffices Fintype.card H = Fintype.card (fixingSubgroup (fixedField H)) by
    exact SetLike.coe_injective (Set.eq_of_inclusion_surjective
      ((Fintype.bijective_iff_injective_and_card (Set.inclusion H_le)).mpr
        ⟨Set.inclusion_injective H_le, this⟩).2).symm
  apply Fintype.card_congr
  refine' (FixedPoints.toAlgHomEquiv H E).trans _
  refine' (algEquivEquivAlgHom (fixedField H) E).toEquiv.symm.trans _
  exact (fixingSubgroupEquiv (fixedField H)).toEquiv.symm
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
  classical
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
H_le : H ≤ fixingSubgroup (fixedField H)
⊢ fixingSubgroup (fixedField H) = H

Next tactic:
suffices Fintype.card H = Fintype.card (fixingSubgroup (fixedField H)) by
    exact SetLike.coe_injective (Set.eq_of_inclusion_surjective
      ((Fintype.bijective_iff_injective_and_card (Set.inclusion H_le)).mpr
        ⟨Set.inclusion_injective H_le, this⟩).2).symm
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
  classical
  suffices Fintype.card H = Fintype.card (fixingSubgroup (fixedField H)) by
    

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
H_le : H ≤ fixingSubgroup (fixedField H)
this : Fintype.card ↥H = Fintype.card ↥(fixingSubgroup (fixedField H))
⊢ fixingSubgroup (fixedField H) = H

Next tactic:
exact SetLike.coe_injective (Set.eq_of_inclusion_surjective
      ((Fintype.bijective_iff_injective_and_card (Set.inclusion H_le)).mpr
        ⟨Set.inclusion_injective H_le, this⟩).2).symm
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
  classical
  suffices Fintype.card H = Fintype.card (fixingSubgroup (fixedField H)) by
    exact SetLike.coe_injective (Set.eq_of_inclusion_surjective
      ((Fintype.bijective_iff_injective_and_card (Set.inclusion H_le)).mpr
        ⟨Set.inclusion_injective H_le, this⟩).2).symm
  

Proof state:
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
H_le : H ≤ fixingSubgroup (fixedField H)
⊢ Fintype.card ↥H = Fintype.card ↥(fixingSubgroup (fixedField H))

Next tactic:
apply Fintype.card_congr
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
  classical
  suffices Fintype.card H = Fintype.card (fixingSubgroup (fixedField H)) by
    exact SetLike.coe_injective (Set.eq_of_inclusion_surjective
      ((Fintype.bijective_iff_injective_and_card (Set.inclusion H_le)).mpr
        ⟨Set.inclusion_injective H_le, this⟩).2).symm
  apply Fintype.card_congr
  

Proof state:
case f
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
H_le : H ≤ fixingSubgroup (fixedField H)
⊢ ↥H ≃ ↥(fixingSubgroup (fixedField H))

Next tactic:
refine' (FixedPoints.toAlgHomEquiv H E).trans _
theorem fixingSubgroup_fixedField [FiniteDimensional F E] : fixingSubgroup (fixedField H) = H := by
  have H_le : H ≤ fixingSubgroup (fixedField H) := (le_iff_le _ _).mp le_rfl
  classical
  suffices Fintype.card H = Fintype.card (fixingSubgroup (fixedField H)) by
    exact SetLike.coe_injective (Set.eq_of_inclusion_surjective
      ((Fintype.bijective_iff_injective_and_card (Set.inclusion H_le)).mpr
        ⟨Set.inclusion_injective H_le, this⟩).2).symm
  apply Fintype.card_congr
  refine' (FixedPoints.toAlgHomEquiv H E).trans _
  

Proof state:
case f
F : Type u_1
inst✝³ : Field F
E : Type u_2
inst✝² : Field E
inst✝¹ : Algebra F E
H : Subgroup (E ≃ₐ[F] E)
K : IntermediateField F E
inst✝ : FiniteDimensional F E
H_le : H ≤ fixingSubgroup (fixedField H)
⊢ (E →ₐ[↥(FixedPoints.subfield (↥H) E)] E) ≃ ↥(fixingSubgroup (fixedField H))

Next tactic:
refine' (algEquivEquivAlgHom (fixedField H) E).toEquiv.symm.trans _