-- Mathlib/NumberTheory/NumberField/Embeddings.lean
lemma card_isUnramified [NumberField k] [IsGalois k K] :
    #{w : InfinitePlace K | w.IsUnramified k} =
      #{w : InfinitePlace k | w.IsUnramifiedIn K} * finrank k K

Proof state:
case e_s
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace K
hw : IsUnramifiedIn K (w.comap (algebraMap k K))
⊢ filter (fun a => a.comap (algebraMap k K) = (fun x => x.comap (algebraMap k K)) w)
      (filter (fun w => IsUnramified k w) univ) =
    (MulAction.orbit (K ≃ₐ[k] K) w).toFinset

Tactic:
ext w'

Result:
case e_s.h
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace K
hw : IsUnramifiedIn K (w.comap (algebraMap k K))
w' : InfinitePlace K
⊢ w' ∈
      filter (fun a => a.comap (algebraMap k K) = (fun x => x.comap (algebraMap k K)) w)
        (filter (fun w => IsUnramified k w) univ) ↔
    w' ∈ (MulAction.orbit (K ≃ₐ[k] K) w).toFinset

Proof state:
case e_s.h
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace K
hw : IsUnramifiedIn K (w.comap (algebraMap k K))
w' : InfinitePlace K
e : w.comap (algebraMap k K) = w'.comap (algebraMap k K)
⊢ IsUnramified k w'

Tactic:
rwa [← isUnramifiedIn_comap, ← e]

Result:
no goals

Proof state:
case e_s.h
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace K
hw : IsUnramifiedIn K (w.comap (algebraMap k K))
w' : InfinitePlace K
⊢ w.comap (algebraMap k K) = w'.comap (algebraMap k K) → IsUnramified k w'

Tactic:
intro e

Result:
case e_s.h
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace K
hw : IsUnramifiedIn K (w.comap (algebraMap k K))
w' : InfinitePlace K
e : w.comap (algebraMap k K) = w'.comap (algebraMap k K)
⊢ IsUnramified k w'

Proof state:
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace k
hw : w ∈ filter (fun w => IsUnramifiedIn K w) univ
⊢ #(filter (fun a => a.comap (algebraMap k K) = w) (filter (fun w => IsUnramified k w) univ)) = Fintype.card (K ≃ₐ[k] K)

Tactic:
obtain ⟨w, rfl⟩ := comap_surjective (K := K) w

Result:
case intro
k : Type u_1
inst✝⁵ : Field k
K : Type u_2
inst✝⁴ : Field K
inst✝³ : Algebra k K
inst✝² : NumberField K
inst✝¹ : NumberField k
inst✝ : IsGalois k K
this : Module.Finite k K := Finite.of_restrictScalars_finite ℚ k K
w : InfinitePlace K
hw : (fun x => x.comap (algebraMap k K)) w ∈ filter (fun w => IsUnramifiedIn K w) univ
⊢ #(filter (fun a => a.comap (algebraMap k K) = (fun x => x.comap (algebraMap k K)) w)
        (filter (fun w => IsUnramified k w) univ)) =
    Fintype.card (K ≃ₐ[k] K)