-- Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean
theorem mem_span_latticeBasis [NumberField K] {x : (K →+* ℂ) → ℂ} :
    x ∈ Submodule.span ℤ (Set.range (latticeBasis K)) ↔
      x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ Set.range ⇑(latticeBasis K) = ⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap '' Set.range ⇑(integralBasis K)

Tactic:
rw [← Set.range_comp]

Result:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ Set.range ⇑(latticeBasis K) = Set.range (⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap ∘ ⇑(integralBasis K))

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ (∃ x_1 ∈ (algebraMap (𝓞 K) K).range, (canonicalEmbedding K).toIntAlgHom.toLinearMap x_1 = x) ↔
    ∃ x_1 ∈ (algebraMap (𝓞 K) K).range, (canonicalEmbedding K) x_1 = x

Tactic:
rfl

Result:
no goals

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ x ∈ Submodule.span ℤ (Set.range ⇑(latticeBasis K)) ↔ x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range

Tactic:
rw [show Set.range (latticeBasis K) =
    (canonicalEmbedding K).toIntAlgHom.toLinearMap '' (Set.range (integralBasis K)) by
  rw [← Set.range_comp]; exact congrArg Set.range (funext (fun i => latticeBasis_apply K i))]

Result:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ x ∈ Submodule.span ℤ (⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap '' Set.range ⇑(integralBasis K)) ↔
    x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ x ∈ ⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap '' ↑(Submodule.span ℤ (Set.range ⇑(integralBasis K))) ↔
    x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range

Tactic:
rw [← RingHom.map_range, Subring.mem_map, Set.mem_image]

Result:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ (∃ x_1 ∈ ↑(Submodule.span ℤ (Set.range ⇑(integralBasis K))), (canonicalEmbedding K).toIntAlgHom.toLinearMap x_1 = x) ↔
    ∃ x_1 ∈ (algebraMap (𝓞 K) K).range, (canonicalEmbedding K) x_1 = x

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ Set.range ⇑(latticeBasis K) = Set.range (⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap ∘ ⇑(integralBasis K))

Tactic:
exact congrArg Set.range (funext (fun i => latticeBasis_apply K i))

Result:
no goals

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ (∃ x_1 ∈ ↑(Submodule.span ℤ (Set.range ⇑(integralBasis K))), (canonicalEmbedding K).toIntAlgHom.toLinearMap x_1 = x) ↔
    ∃ x_1 ∈ (algebraMap (𝓞 K) K).range, (canonicalEmbedding K) x_1 = x

Tactic:
simp only [SetLike.mem_coe, mem_span_integralBasis K]

Result:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ (∃ x_1 ∈ (algebraMap (𝓞 K) K).range, (canonicalEmbedding K).toIntAlgHom.toLinearMap x_1 = x) ↔
    ∃ x_1 ∈ (algebraMap (𝓞 K) K).range, (canonicalEmbedding K) x_1 = x

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ x ∈ Submodule.span ℤ (⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap '' Set.range ⇑(integralBasis K)) ↔
    x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range

Tactic:
rw [← Submodule.map_span, ← SetLike.mem_coe, Submodule.map_coe]

Result:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
⊢ x ∈ ⇑(canonicalEmbedding K).toIntAlgHom.toLinearMap '' ↑(Submodule.span ℤ (Set.range ⇑(integralBasis K))) ↔
    x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range