-- Module: Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne
Goal:
K : Type u_1
inst : Field K
inst_1 : NumberField K
rw :
  |(LinearMap.det : (a : (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ) → ℝ)
        (↑(↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) :
              (InfinitePlace K → ℝ) →L[ℝ] realSpace K) :
          (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ)| =
    (↑(finrank ℚ K) : ℝ) * regulator K
rw₁ :
  |Matrix.det.{0, u_1} (n := InfinitePlace K)
        ((LinearMap.toMatrix (completeBasis K) (completeBasis K) :
            (a : realSpace K →ₗ[ℝ] realSpace K) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
          (↑(↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) :
                (InfinitePlace K → ℝ) →L[ℝ] realSpace K) :
            (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ))| =
    (↑(finrank ℚ K) : ℝ) * regulator K
rw₂ :
  |Matrix.det.{0, u_1} (n := InfinitePlace K)
        (Matrix.transpose
          ((LinearMap.toMatrix (completeBasis K) (completeBasis K) :
              (a : realSpace K →ₗ[ℝ] realSpace K) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
            (↑(↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) :
                  (InfinitePlace K → ℝ) →L[ℝ] realSpace K) :
              (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ)))| =
    (↑(finrank ℚ K) : ℝ) * regulator K
rw₃ :
  |Matrix.det.{0, u_1} (n := InfinitePlace K)
        (Matrix.transpose
          ((LinearMap.toMatrix (completeBasis K) (completeBasis K) :
              (a : realSpace K →ₗ[ℝ] realSpace K) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
            (↑(↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) :
                  (InfinitePlace K → ℝ) →L[ℝ] realSpace K) :
              (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ)))| =
    (↑(finrank ℚ K) : ℝ) * regOfFamily (fundSystem K)
rw₄ rw₅ rw₆ :
  Eq (α := ℝ)
    |Matrix.det.{0, u_1} (n := InfinitePlace K)
        (Matrix.transpose
          ((LinearMap.toMatrix (completeBasis K) (completeBasis K) :
              (a : realSpace K →ₗ[ℝ] realSpace K) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
            (↑(↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) :
                  (InfinitePlace K → ℝ) →L[ℝ] realSpace K) :
              (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ)))|
    |Matrix.det (n := InfinitePlace K)
        ((Matrix.of : (a : InfinitePlace K → InfinitePlace K → ℝ) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
            fun (i w : InfinitePlace K) ↦
            if h : i = w₀ then (↑w.mult : ℝ)
            else
              (↑w.mult : ℝ) *
                Real.log
                  ((w : (a : K) → ℝ)
                    ((algebraMap (𝓞 K) K : (a : 𝓞 K) → K)
                        (↑(fundSystem K
                              (((Equiv.symm equivFinRank : { w : InfinitePlace K // w ≠ w₀ } ≃ Fin (rank K)) :
                                  (a : { w : InfinitePlace K // w ≠ w₀ }) → Fin (rank K))
                                (Subtype.mk (p := fun (w : InfinitePlace K) ↦ w ≠ w₀) i h))) :
                          𝓞 K) :
                      K)) :
          Matrix (InfinitePlace K) (InfinitePlace K) ℝ)|
e_a :
  ∀ (w i : InfinitePlace K),
    Eq (α := ℝ)
      (Matrix.transpose
          ((LinearMap.toMatrix (completeBasis K) (completeBasis K) :
              (a : realSpace K →ₗ[ℝ] realSpace K) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
            (↑(↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) :
                  (InfinitePlace K → ℝ) →L[ℝ] realSpace K) :
              (InfinitePlace K → ℝ) →ₗ[ℝ] InfinitePlace K → ℝ))
          w i :
        ℝ)
      ((Matrix.of : (a : InfinitePlace K → InfinitePlace K → ℝ) → Matrix (InfinitePlace K) (InfinitePlace K) ℝ)
          (fun (i w : InfinitePlace K) ↦
            if h : i = w₀ then (↑w.mult : ℝ)
            else
              (↑w.mult : ℝ) *
                Real.log
                  ((w : (a : K) → ℝ)
                    ((algebraMap (𝓞 K) K : (a : 𝓞 K) → K)
                        (↑(fundSystem K
                              (((Equiv.symm equivFinRank : { w : InfinitePlace K // w ≠ w₀ } ≃ Fin (rank K)) :
                                  (a : { w : InfinitePlace K // w ≠ w₀ }) → Fin (rank K))
                                (Subtype.mk (p := fun (w : InfinitePlace K) ↦ w ≠ w₀) i h))) :
                          𝓞 K) :
                      K)))
          w i :
        ℝ)
e_a₁ :
  ∀ (w i : InfinitePlace K),
    Eq (α := ℝ) ((completeBasis K : (a : InfinitePlace K) → realSpace K) w i)
      (if h : w = w₀ then (↑i.mult : ℝ)
      else
        (↑i.mult : ℝ) *
          Real.log
            ((i : (a : K) → ℝ)
              ((algebraMap (𝓞 K) K : (a : 𝓞 K) → K)
                  (↑(fundSystem K
                        (((Equiv.symm equivFinRank : { w : InfinitePlace K // w ≠ w₀ } ≃ Fin (rank K)) :
                            (a : { w : InfinitePlace K // w ≠ w₀ }) → Fin (rank K))
                          (Subtype.mk (p := fun (w : InfinitePlace K) ↦ w ≠ w₀) w h))) :
                    𝓞 K) :
                K)))
pos :
  ∀ (w i : InfinitePlace K) (hw : w = w₀),
    Eq (α := ℝ) ((completeBasis K : (a : InfinitePlace K) → realSpace K) w i) (↑i.mult : ℝ)
neg neg₁ :
  ∀ (w i : InfinitePlace K) (hw : ¬w = w₀),
    (completeBasis K : (a : InfinitePlace K) → realSpace K) w i =
      (↑i.mult : ℝ) *
        Real.log
          ((i : (a : K) → ℝ)
            ((algebraMap (𝓞 K) K : (a : 𝓞 K) → K)
                (↑(fundSystem K
                      (((Equiv.symm equivFinRank : { w : InfinitePlace K // w ≠ w₀ } ≃ Fin (rank K)) :
                          (a : { w : InfinitePlace K // w ≠ w₀ }) → Fin (rank K))
                        (Subtype.mk (p := fun (w : InfinitePlace K) ↦ w ≠ w₀) w hw))) :
                  𝓞 K) :
              K))
⊢ |ContinuousLinearMap.det (M := InfinitePlace K → ℝ)
        (↑(ContinuousLinearEquiv.symm (Basis.equivFunL (completeBasis K))) : (InfinitePlace K → ℝ) →L[ℝ] realSpace K)| =
    (↑(finrank ℚ K) : ℝ) * regulator K

Tactic:
classical
  rw [ContinuousLinearMap.det, ← LinearMap.det_toMatrix (completeBasis K), ← Matrix.det_transpose,
    regulator_eq_regOfFamily_fundSystem, finrank_mul_regOfFamily_eq_det _ w₀ equivFinRank.symm]
  congr 2 with w i
  rw [Matrix.transpose_apply, LinearMap.toMatrix_apply, Matrix.of_apply, ← Basis.equivFunL_apply,
    ContinuousLinearMap.coe_coe, ContinuousLinearEquiv.coe_apply,
    (completeBasis K).equivFunL.apply_symm_apply]
  split_ifs with hw
  · rw [hw, completeBasis_apply_of_eq]
  · simp_rw [completeBasis_apply_of_ne K ⟨w, hw⟩, expMap_symm_apply, normAtAllPlaces_mixedEmbedding]

Premises used: Matrix.det_transpose, ContinuousLinearEquiv.apply_symm_apply, Module.Basis.equivFunL, NumberField.Units.finrank_mul_regOfFamily_eq_det, NumberField.mixedEmbedding.fundamentalCone.equivFinRank, NumberField.mixedEmbedding.fundamentalCone.completeBasis_apply_of_eq, ContinuousLinearMap.det, ContinuousLinearMap.coe_coe, Module.Basis.equivFunL_apply, Matrix.of_apply, NumberField.mixedEmbedding.fundamentalCone.expMap_symm_apply, NumberField.mixedEmbedding.normAtAllPlaces_mixedEmbedding, NumberField.Units.dirichletUnitTheorem.w₀, ContinuousLinearEquiv.coe_apply, NumberField.Units.regulator_eq_regOfFamily_fundSystem, Equiv.symm, Matrix.transpose_apply, LinearMap.toMatrix_apply, NumberField.mixedEmbedding.fundamentalCone.completeBasis