Theorem: NumberField.InfinitePlace.card_complex_embeddings
File: Mathlib/NumberTheory/NumberField/Embeddings.lean

tactic: suffices ∀ w : { w : InfinitePlace K // IsComplex w }, (Finset.univ.filter
    fun φ : { φ // ¬ ComplexEmbedding.IsReal φ } => mkComplex φ = w).card = 2 by
  rw [Fintype.card, Finset.card_eq_sum_ones, ← Finset.sum_fiberwise _ (fun φ => mkComplex φ)]
  simp_rw [Finset.sum_const, this, smul_eq_mul, mul_one, Fintype.card, Finset.card_eq_sum_ones,
    Finset.mul_sum, Finset.sum_const, smul_eq_mul, mul_one]
state_before: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
⊢ card { φ // ¬ComplexEmbedding.IsReal φ } = 2 * NrComplexPlaces K
state_after: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
⊢ ∀ (w : { w // w.IsComplex }), (Finset.filter (fun φ => mkComplex φ = w) Finset.univ).card = 2

tactic: rintro ⟨w, hw⟩
state_before: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
⊢ ∀ (w : { w // w.IsComplex }), (Finset.filter (fun φ => mkComplex φ = w) Finset.univ).card = 2
state_after: case mk
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ (Finset.filter (fun φ => mkComplex φ = ⟨w, hw⟩) Finset.univ).card = 2

tactic: convert card_filter_mk_eq w
state_before: case mk
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ (Finset.filter (fun φ => mkComplex φ = ⟨w, hw⟩) Finset.univ).card = 2
state_after: case h.e'_2
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ (Finset.filter (fun φ => mkComplex φ = ⟨w, hw⟩) Finset.univ).card =
    (Finset.filter (fun φ => mk φ = w) Finset.univ).card

case h.e'_3
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ 2 = w.mult

tactic: rw [Fintype.card, Finset.card_eq_sum_ones, ← Finset.sum_fiberwise _ (fun φ => mkComplex φ)]
state_before: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
this : ∀ (w : { w // w.IsComplex }), (Finset.filter (fun φ => mkComplex φ = w) Finset.univ).card = 2
⊢ card { φ // ¬ComplexEmbedding.IsReal φ } = 2 * NrComplexPlaces K
state_after: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
this : ∀ (w : { w // w.IsComplex }), (Finset.filter (fun φ => mkComplex φ = w) Finset.univ).card = 2
⊢ ∑ j : { w // w.IsComplex }, ∑ i ∈ Finset.filter (fun i => mkComplex i = j) Finset.univ, 1 = 2 * NrComplexPlaces K

tactic: simp_rw [Finset.sum_const, this, smul_eq_mul, mul_one, Fintype.card, Finset.card_eq_sum_ones,
  Finset.mul_sum, Finset.sum_const, smul_eq_mul, mul_one]
state_before: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
this : ∀ (w : { w // w.IsComplex }), (Finset.filter (fun φ => mkComplex φ = w) Finset.univ).card = 2
⊢ ∑ j : { w // w.IsComplex }, ∑ i ∈ Finset.filter (fun i => mkComplex i = j) Finset.univ, 1 = 2 * NrComplexPlaces K
state_after: no goals

tactic: rw [← Fintype.card_subtype, ← Fintype.card_subtype]
state_before: case h.e'_2
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ (Finset.filter (fun φ => mkComplex φ = ⟨w, hw⟩) Finset.univ).card =
    (Finset.filter (fun φ => mk φ = w) Finset.univ).card
state_after: case h.e'_2
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ card { x // mkComplex x = ⟨w, hw⟩ } = card { x // mk x = w }

tactic: refine Fintype.card_congr (Equiv.ofBijective ?_ ⟨fun _ _ h => ?_, fun ⟨φ, hφ⟩ => ?_⟩)
state_before: case h.e'_2
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ card { x // mkComplex x = ⟨w, hw⟩ } = card { x // mk x = w }
state_after: case h.e'_2.refine_1
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ { x // mkComplex x = ⟨w, hw⟩ } → { x // mk x = w }

case h.e'_2.refine_2
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝¹ x✝ : { x // mkComplex x = ⟨w, hw⟩ }
h : ?h.e'_2.refine_1 x✝¹ = ?h.e'_2.refine_1 x✝
⊢ x✝¹ = x✝

case h.e'_2.refine_3
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝ : { x // mk x = w }
φ : K →+* ℂ
hφ : mk φ = w
⊢ ∃ a, ?h.e'_2.refine_1 a = ⟨φ, hφ⟩

tactic: exact fun ⟨φ, hφ⟩ => ⟨φ.val, by rwa [Subtype.ext_iff] at hφ⟩
state_before: case h.e'_2.refine_1
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ { x // mkComplex x = ⟨w, hw⟩ } → { x // mk x = w }
state_after: no goals

tactic: rwa [Subtype.ext_iff] at hφ
state_before: k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝ : { x // mkComplex x = ⟨w, hw⟩ }
φ : { φ // ¬ComplexEmbedding.IsReal φ }
hφ : mkComplex φ = ⟨w, hw⟩
⊢ mk ↑φ = w
state_after: no goals

tactic: rwa [Subtype.mk_eq_mk, ← Subtype.ext_iff, ← Subtype.ext_iff] at h
state_before: case h.e'_2.refine_2
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝¹ x✝ : { x // mkComplex x = ⟨w, hw⟩ }
h :
  (match x✝¹ with
    | ⟨φ, hφ⟩ => ⟨↑φ, ⋯⟩) =
    match x✝ with
    | ⟨φ, hφ⟩ => ⟨↑φ, ⋯⟩
⊢ x✝¹ = x✝
state_after: no goals

tactic: refine ⟨⟨⟨φ, not_isReal_of_mk_isComplex (hφ.symm ▸ hw)⟩, ?_⟩, rfl⟩
state_before: case h.e'_2.refine_3
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝ : { x // mk x = w }
φ : K →+* ℂ
hφ : mk φ = w
⊢ ∃ a,
    (match a with
      | ⟨φ, hφ⟩ => ⟨↑φ, ⋯⟩) =
      ⟨φ, hφ⟩
state_after: case h.e'_2.refine_3
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝ : { x // mk x = w }
φ : K →+* ℂ
hφ : mk φ = w
⊢ mkComplex ⟨φ, ⋯⟩ = ⟨w, hw⟩

tactic: rwa [Subtype.ext_iff, mkComplex_coe]
state_before: case h.e'_2.refine_3
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
x✝ : { x // mk x = w }
φ : K →+* ℂ
hφ : mk φ = w
⊢ mkComplex ⟨φ, ⋯⟩ = ⟨w, hw⟩
state_after: no goals

tactic: simp_rw [mult, not_isReal_iff_isComplex.mpr hw, ite_false]
state_before: case h.e'_3
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
F : Type u_3
inst✝¹ : Field F
inst✝ : NumberField K
w : InfinitePlace K
hw : w.IsComplex
⊢ 2 = w.mult
state_after: no goals