-- Mathlib/FieldTheory/Galois/Basic.lean
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E

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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

Tactic:
rw [← LinearEquiv.finrank_eq iso.toLinearEquiv]

Result:
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F ↥F⟮α⟯

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

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 }

Result:
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

Tactic:
have H : IsIntegral F α := IsGalois.integral F α

Result:
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

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 ∈ ⊤

Tactic:
exact IntermediateField.mem_top

Result:
no goals

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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F E) (minpoly F α)
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

Tactic:
replace h_splits : Polynomial.Splits (algebraMap F F⟮α⟯) (minpoly F α) := by
  simpa using
    Polynomial.splits_comp_of_splits (algebraMap F E) iso.symm.toAlgHom.toRingHom h_splits

Result:
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
⊢ Fintype.card (E ≃ₐ[F] E) = finrank F E

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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
⊢ Fintype.card (E ≃ₐ[F] E) = Fintype.card (↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯)

Tactic:
apply Fintype.card_congr

Result:
case intro.f
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
⊢ (E ≃ₐ[F] E) ≃ ↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯

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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F E) (minpoly F α)
⊢ Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)

Tactic:
simpa using
  Polynomial.splits_comp_of_splits (algebraMap F E) iso.symm.toAlgHom.toRingHom h_splits

Result:
no goals

Proof state:
case intro.f.left_inv
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
ϕ : E ≃ₐ[F] E
⊢ (fun ϕ => iso.symm.trans (ϕ.trans iso)) ((fun ϕ => iso.trans (ϕ.trans iso.symm)) ϕ) = ϕ

Tactic:
ext1

Result:
case intro.f.left_inv.h
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⟮α⟯ = ⊤
iso : ↥F⟮α⟯ ≃ₐ[F] E :=
  { toFun := fun e => ↑e, invFun := fun e => ⟨e, ⋯⟩, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯,
    commutes' := ⋯ }
H : IsIntegral F α
h_sep : IsSeparable F α
h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α)
ϕ : E ≃ₐ[F] E
a✝ : E
⊢ ((fun ϕ => iso.symm.trans (ϕ.trans iso)) ((fun ϕ => iso.trans (ϕ.trans iso.symm)) ϕ)) a✝ = ϕ a✝