-- Lean 4 proof step from Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic (hypothesis)
Goal:
K : Type u_1
inst : Field K
inst_1 : NumberField K
x : K
i_1 : ChooseBasisIndex ℤ (𝓞 K)
f : K →ₗ[ℚ]
  ↥(Submodule.span ℚ
      (Set.range (ι := ChooseBasisIndex ℤ (𝓞 K))
        (⇑(latticeBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℝ (mixedSpace K)) :
          (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))) :=
  LinearMap.codRestrict
    (Submodule.span ℚ
      (Set.range (ι := ChooseBasisIndex ℤ (𝓞 K))
        (⇑(latticeBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℝ (mixedSpace K)) :
          (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K)))
    (AlgHom.toLinearMap (RingHom.toRatAlgHom (mixedEmbedding K))) ⋯
i : ChooseBasisIndex ℤ (𝓞 K)
⊢ Eq (α := ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ)
    ((((↑(Basis.repr (Basis.restrictScalars ℚ (latticeBasis K))) :
                ↥(Submodule.span ℚ
                      (Set.range (⇑(latticeBasis K) : (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))) →ₗ[ℚ]
                  ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ) ∘ₗ
              f :
            K →ₗ[ℚ] ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ) :
          (a : K) → ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ)
        (((integralBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℚ K) : (a : ChooseBasisIndex ℤ (𝓞 K)) → K) i : K) :
      ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ)
    ((((↑(Basis.repr (integralBasis K)) : K →ₗ[ℚ] ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ) :
            K →ₗ[ℚ] ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ) :
          (a : K) → ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ)
        (((integralBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℚ K) : (a : ChooseBasisIndex ℤ (𝓞 K)) → K) i : K) :
      ChooseBasisIndex ℤ (𝓞 K) →₀ ℚ)
have this : Eq (α :=
  ↥(Submodule.span ℚ
      (Set.range (ι := ChooseBasisIndex ℤ (𝓞 K))
        (⇑(latticeBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℝ (mixedSpace K)) :
          (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))))
  ((f : (a : K) → ↥(Submodule.span ℚ (Set.range (⇑(latticeBasis K) : (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))))
      (((integralBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℚ K) : (a : ChooseBasisIndex ℤ (𝓞 K)) → K) i) :
    ↥(Submodule.span ℚ
        (Set.range (ι := ChooseBasisIndex ℤ (𝓞 K))
          (⇑(latticeBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℝ (mixedSpace K)) :
            (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))))
  (((Basis.restrictScalars ℚ (latticeBasis K) :
          Basis (ChooseBasisIndex ℤ (𝓞 K)) ℚ
            ↥(Submodule.span ℚ
                (Set.range (ι := ChooseBasisIndex ℤ (𝓞 K))
                  (⇑(latticeBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℝ (mixedSpace K)) :
                    (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K)))) :
        (a : ChooseBasisIndex ℤ (𝓞 K)) →
          ↥(Submodule.span ℚ (Set.range (⇑(latticeBasis K) : (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))))
      i :
    ↥(Submodule.span ℚ
        (Set.range (ι := ChooseBasisIndex ℤ (𝓞 K))
          (⇑(latticeBasis K : Basis (ChooseBasisIndex ℤ (𝓞 K)) ℝ (mixedSpace K)) :
            (a : ChooseBasisIndex ℤ (𝓞 K)) → mixedSpace K))))
Tactic: have : f (integralBasis K i) = ((latticeBasis K).restrictScalars ℚ) i := by
    apply Subtype.val_injective
    rw [LinearMap.codRestrict_apply, AlgHom.toLinearMap_apply, Basis.restrictScalars_apply,
      latticeBasis_apply]
    rfl