l3lab/ntp-mathlib huggingface dataset:
/-- The non-trivial symmetric braiding, sending $a \otimes b$ to
$(-1)^{\deg a' \deg b} (b \otimes a)$. -/
def comm : (𝒜 ᵍ⊗[R] ℬ) ≃ₐ[R] (ℬ ᵍ⊗[R] 𝒜) :=
  AlgEquiv.ofLinearEquiv
    (auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R _ _ ≪≫ₗ (auxEquiv R ℬ 𝒜).symm)
    (by
      dsimp
      

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1142099
inst✝¹ : Ring C
inst✝ : Algebra R C
⊢ (LinearEquiv.symm (auxEquiv R ℬ 𝒜)) ((gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ((auxEquiv R 𝒜 ℬ) 1)) = 1

Next tactic:
simp_rw [auxEquiv_one, gradedComm_one, auxEquiv_symm_one]
/-- The non-trivial symmetric braiding, sending $a \otimes b$ to
$(-1)^{\deg a' \deg b} (b \otimes a)$. -/
def comm : (𝒜 ᵍ⊗[R] ℬ) ≃ₐ[R] (ℬ ᵍ⊗[R] 𝒜) :=
  AlgEquiv.ofLinearEquiv
    (auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R _ _ ≪≫ₗ (auxEquiv R ℬ 𝒜).symm)
    (by
      dsimp
      simp_rw [auxEquiv_one, gradedComm_one, auxEquiv_symm_one])
    (fun x y => by
      

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1142099
inst✝¹ : Ring C
inst✝ : Algebra R C
x y : 𝒜 ᵍ⊗[R] ℬ
⊢ ((auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ≪≫ₗ LinearEquiv.symm (auxEquiv R ℬ 𝒜)) (x * y) =
    ((auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ≪≫ₗ LinearEquiv.symm (auxEquiv R ℬ 𝒜)) x *
      ((auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ≪≫ₗ LinearEquiv.symm (auxEquiv R ℬ 𝒜)) y

Next tactic:
dsimp
/-- The non-trivial symmetric braiding, sending $a \otimes b$ to
$(-1)^{\deg a' \deg b} (b \otimes a)$. -/
def comm : (𝒜 ᵍ⊗[R] ℬ) ≃ₐ[R] (ℬ ᵍ⊗[R] 𝒜) :=
  AlgEquiv.ofLinearEquiv
    (auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R _ _ ≪≫ₗ (auxEquiv R ℬ 𝒜).symm)
    (by
      dsimp
      simp_rw [auxEquiv_one, gradedComm_one, auxEquiv_symm_one])
    (fun x y => by
      dsimp
      

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1142099
inst✝¹ : Ring C
inst✝ : Algebra R C
x y : 𝒜 ᵍ⊗[R] ℬ
⊢ (LinearEquiv.symm (auxEquiv R ℬ 𝒜)) ((gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ((auxEquiv R 𝒜 ℬ) (x * y))) =
    (LinearEquiv.symm (auxEquiv R ℬ 𝒜)) ((gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ((auxEquiv R 𝒜 ℬ) x)) *
      (LinearEquiv.symm (auxEquiv R ℬ 𝒜)) ((gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ((auxEquiv R 𝒜 ℬ) y))

Next tactic:
simp_rw [auxEquiv_mul, gradedComm_gradedMul, LinearEquiv.symm_apply_eq,
        ← gradedComm_gradedMul, auxEquiv_mul, LinearEquiv.apply_symm_apply, gradedComm_gradedMul]
@[simp] lemma comm_coe_tmul_coe {i j : ι} (a : 𝒜 i) (b : ℬ j) :
    comm 𝒜 ℬ (a ᵍ⊗ₜ b) = (-1 : ℤˣ)^(j * i) • (b ᵍ⊗ₜ a : ℬ ᵍ⊗[R] 𝒜) :=
  (auxEquiv R ℬ 𝒜).injective <| by
    

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1230722
inst✝¹ : Ring C
inst✝ : Algebra R C
i j : ι
a : ↥(𝒜 i)
b : ↥(ℬ j)
⊢ (auxEquiv R ℬ 𝒜) ((comm 𝒜 ℬ) (↑a ᵍ⊗ₜ[R] ↑b)) = (auxEquiv R ℬ 𝒜) ((-1) ^ (j * i) • ↑b ᵍ⊗ₜ[R] ↑a)

Next tactic:
simp_rw [auxEquiv_comm, auxEquiv_tmul, decompose_coe, ← lof_eq_of R, gradedComm_of_tmul_of,
      @Units.smul_def _ _ (_) (_), zsmul_eq_smul_cast R, map_smul, auxEquiv_tmul, decompose_coe,
      lof_eq_of]
theorem discr_ne_zero : discr K ≠ 0 := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
⊢ discr K ≠ 0

Next tactic:
rw [← (Int.cast_injective (α := ℚ)).ne_iff, coe_discr]
theorem discr_ne_zero : discr K ≠ 0 := by
  rw [← (Int.cast_injective (α := ℚ)).ne_iff, coe_discr]
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
⊢ Algebra.discr ℚ ⇑(integralBasis K) ≠ ↑0

Next tactic:
exact Algebra.discr_not_zero_of_basis ℚ (integralBasis K)
theorem discr_eq_discr {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι ℤ (𝓞 K)) :
    Algebra.discr ℤ b = discr K := by
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
ι : Type u_2
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
b : Basis ι ℤ ↥(𝓞 K)
⊢ Algebra.discr ℤ ⇑b = discr K

Next tactic:
let b₀ := Basis.reindex (RingOfIntegers.basis K) (Basis.indexEquiv (RingOfIntegers.basis K) b)
theorem discr_eq_discr {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι ℤ (𝓞 K)) :
    Algebra.discr ℤ b = discr K := by
  let b₀ := Basis.reindex (RingOfIntegers.basis K) (Basis.indexEquiv (RingOfIntegers.basis K) b)
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
ι : Type u_2
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
b : Basis ι ℤ ↥(𝓞 K)
b₀ : Basis ι ℤ ↥(𝓞 K) := Basis.reindex (RingOfIntegers.basis K) (Basis.indexEquiv (RingOfIntegers.basis K) b)
⊢ Algebra.discr ℤ ⇑b = discr K

Next tactic:
rw [Algebra.discr_eq_discr (𝓞 K) b b₀, Basis.coe_reindex, Algebra.discr_reindex]
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
⊢ discr K = discr L

Next tactic:
let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
⊢ discr K = discr L

Next tactic:
rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
⊢ Algebra.discr ℚ (⇑f ∘ ⇑(integralBasis K)) = ↑(Algebra.discr ℤ ⇑(Basis.map (RingOfIntegers.basis K) f₀))

Next tactic:
change _ = algebraMap ℤ ℚ _
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
  change _ = algebraMap ℤ ℚ _
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
⊢ Algebra.discr ℚ (⇑f ∘ ⇑(integralBasis K)) =
    (algebraMap ℤ ℚ) (Algebra.discr ℤ ⇑(Basis.map (RingOfIntegers.basis K) f₀))

Next tactic:
rw [← Algebra.discr_localizationLocalization ℤ (nonZeroDivisors ℤ) L]
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
  change _ = algebraMap ℤ ℚ _
  rw [← Algebra.discr_localizationLocalization ℤ (nonZeroDivisors ℤ) L]
  

Proof state:
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
⊢ Algebra.discr ℚ (⇑f ∘ ⇑(integralBasis K)) =
    Algebra.discr ℚ ⇑(Basis.localizationLocalization ℚ (nonZeroDivisors ℤ) L (Basis.map (RingOfIntegers.basis K) f₀))

Next tactic:
congr
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
  change _ = algebraMap ℤ ℚ _
  rw [← Algebra.discr_localizationLocalization ℤ (nonZeroDivisors ℤ) L]
  congr
  

Proof state:
case e_b
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
⊢ ⇑f ∘ ⇑(integralBasis K) =
    ⇑(Basis.localizationLocalization ℚ (nonZeroDivisors ℤ) L (Basis.map (RingOfIntegers.basis K) f₀))

Next tactic:
ext
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
  change _ = algebraMap ℤ ℚ _
  rw [← Algebra.discr_localizationLocalization ℤ (nonZeroDivisors ℤ) L]
  congr
  ext
  

Proof state:
case e_b.h
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
x✝ : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K)
⊢ (⇑f ∘ ⇑(integralBasis K)) x✝ =
    (Basis.localizationLocalization ℚ (nonZeroDivisors ℤ) L (Basis.map (RingOfIntegers.basis K) f₀)) x✝

Next tactic:
simp only [Function.comp_apply, integralBasis_apply, Basis.localizationLocalization_apply,
    Basis.map_apply]
theorem discr_eq_discr_of_algEquiv {L : Type*} [Field L] [NumberField L] (f : K ≃ₐ[ℚ] L) :
    discr K = discr L := by
  let f₀ : 𝓞 K ≃ₗ[ℤ] 𝓞 L := (f.restrictScalars ℤ).mapIntegralClosure.toLinearEquiv
  rw [← Rat.intCast_inj, coe_discr, Algebra.discr_eq_discr_of_algEquiv (integralBasis K) f,
    ← discr_eq_discr L ((RingOfIntegers.basis K).map f₀)]
  change _ = algebraMap ℤ ℚ _
  rw [← Algebra.discr_localizationLocalization ℤ (nonZeroDivisors ℤ) L]
  congr
  ext
  simp only [Function.comp_apply, integralBasis_apply, Basis.localizationLocalization_apply,
    Basis.map_apply]
  

Proof state:
case e_b.h
K : Type u_1
inst✝³ : Field K
inst✝² : NumberField K
L : Type u_2
inst✝¹ : Field L
inst✝ : NumberField L
f : K ≃ₐ[ℚ] L
f₀ : ↥(𝓞 K) ≃ₗ[ℤ] ↥(𝓞 L) := AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f))
x✝ : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K)
⊢ f ((algebraMap (↥(𝓞 K)) K) ((RingOfIntegers.basis K) x✝)) =
    (algebraMap (↥(𝓞 L)) L)
      ((AlgEquiv.toLinearEquiv (AlgEquiv.mapIntegralClosure (AlgEquiv.restrictScalars ℤ f)))
        ((RingOfIntegers.basis K) x✝))

Next tactic:
rfl
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) = 2⁻¹ ^ NrComplexPlaces K * ↑(sqrt ‖discr K‖₊)

Next tactic:
let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) ≃ (K →+* ℂ) :=
  Basis.indexEquiv (canonicalEmbedding.latticeBasis K) (Pi.basisFun ℂ (K →+* ℂ))
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) = 2⁻¹ ^ NrComplexPlaces K * ↑(sqrt ‖discr K‖₊)

Next tactic:
let e : (index K) ≃ Module.Free.ChooseBasisIndex ℤ (𝓞 K) := (indexEquiv K).trans f.symm
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
  let e : (index K) ≃ Module.Free.ChooseBasisIndex ℤ (𝓞 K) := (indexEquiv K).trans f.symm
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) ≃ (K →+* ℂ) :=
  Basis.indexEquiv (canonicalEmbedding.latticeBasis K) (Pi.basisFun ℂ (K →+* ℂ))
e : index K ≃ Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) := (indexEquiv K).trans f.symm
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) = 2⁻¹ ^ NrComplexPlaces K * ↑(sqrt ‖discr K‖₊)

Next tactic:
let M := (mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
  let e : (index K) ≃ Module.Free.ChooseBasisIndex ℤ (𝓞 K) := (indexEquiv K).trans f.symm
  let M := (mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) ≃ (K →+* ℂ) :=
  Basis.indexEquiv (canonicalEmbedding.latticeBasis K) (Pi.basisFun ℂ (K →+* ℂ))
e : index K ≃ Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) := (indexEquiv K).trans f.symm
M : Matrix (index K) (index K) ℝ := Basis.toMatrix (mixedEmbedding.stdBasis K) ⇑(Basis.reindex (latticeBasis K) e.symm)
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) = 2⁻¹ ^ NrComplexPlaces K * ↑(sqrt ‖discr K‖₊)

Next tactic:
let N := Algebra.embeddingsMatrixReindex ℚ ℂ (integralBasis K ∘ f.symm)
    RingHom.equivRatAlgHom
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
  let e : (index K) ≃ Module.Free.ChooseBasisIndex ℤ (𝓞 K) := (indexEquiv K).trans f.symm
  let M := (mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)
  let N := Algebra.embeddingsMatrixReindex ℚ ℂ (integralBasis K ∘ f.symm)
    RingHom.equivRatAlgHom
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) ≃ (K →+* ℂ) :=
  Basis.indexEquiv (canonicalEmbedding.latticeBasis K) (Pi.basisFun ℂ (K →+* ℂ))
e : index K ≃ Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) := (indexEquiv K).trans f.symm
M : Matrix (index K) (index K) ℝ := Basis.toMatrix (mixedEmbedding.stdBasis K) ⇑(Basis.reindex (latticeBasis K) e.symm)
N : Matrix (K →+* ℂ) (K →+* ℂ) ℂ :=
  Algebra.embeddingsMatrixReindex ℚ ℂ (⇑(integralBasis K) ∘ ⇑f.symm) RingHom.equivRatAlgHom
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) = 2⁻¹ ^ NrComplexPlaces K * ↑(sqrt ‖discr K‖₊)

Next tactic:
suffices M.map Complex.ofReal = (matrixToStdBasis K) *
      (Matrix.reindex (indexEquiv K).symm (indexEquiv K).symm N).transpose by
    calc volume (fundamentalDomain (latticeBasis K))
      _ = ‖((mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)).det‖₊ := by
        rw [← fundamentalDomain_reindex _ e.symm, ← norm_toNNReal, measure_fundamentalDomain
          ((latticeBasis K).reindex e.symm), volume_fundamentalDomain_stdBasis, mul_one]
        rfl
      _ = ‖(matrixToStdBasis K).det * N.det‖₊ := by
        rw [← nnnorm_real, ← ofReal_eq_coe, RingHom.map_det, RingHom.mapMatrix_apply, this,
          det_mul, det_transpose, det_reindex_self]
      _ = (2 : ℝ≥0∞)⁻¹ ^ Fintype.card {w : InfinitePlace K // IsComplex w} * sqrt ‖N.det ^ 2‖₊ := by
        have : ‖Complex.I‖₊ = 1 := by rw [← norm_toNNReal, norm_eq_abs, abs_I, Real.toNNReal_one]
        rw [det_matrixToStdBasis, nnnorm_mul, nnnorm_pow, nnnorm_mul, this, mul_one, nnnorm_inv,
          coe_mul, ENNReal.coe_pow, ← norm_toNNReal, IsROrC.norm_two, Real.toNNReal_ofNat,
          coe_inv two_ne_zero, coe_ofNat, nnnorm_pow, NNReal.sqrt_sq]
      _ = (2 : ℝ≥0∞)⁻¹ ^ Fintype.card { w // IsComplex w } * NNReal.sqrt ‖discr K‖₊ := by
        rw [← Algebra.discr_eq_det_embeddingsMatrixReindex_pow_two, Algebra.discr_reindex,
          ← coe_discr, map_intCast, ← Complex.nnnorm_int]
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
  let e : (index K) ≃ Module.Free.ChooseBasisIndex ℤ (𝓞 K) := (indexEquiv K).trans f.symm
  let M := (mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)
  let N := Algebra.embeddingsMatrixReindex ℚ ℂ (integralBasis K ∘ f.symm)
    RingHom.equivRatAlgHom
  suffices M.map Complex.ofReal = (matrixToStdBasis K) *
      (Matrix.reindex (indexEquiv K).symm (indexEquiv K).symm N).transpose by
    

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) ≃ (K →+* ℂ) :=
  Basis.indexEquiv (canonicalEmbedding.latticeBasis K) (Pi.basisFun ℂ (K →+* ℂ))
e : index K ≃ Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) := (indexEquiv K).trans f.symm
M : Matrix (index K) (index K) ℝ := Basis.toMatrix (mixedEmbedding.stdBasis K) ⇑(Basis.reindex (latticeBasis K) e.symm)
N : Matrix (K →+* ℂ) (K →+* ℂ) ℂ :=
  Algebra.embeddingsMatrixReindex ℚ ℂ (⇑(integralBasis K) ∘ ⇑f.symm) RingHom.equivRatAlgHom
this : Matrix.map M ⇑ofReal = matrixToStdBasis K * ((reindex (indexEquiv K).symm (indexEquiv K).symm) N)ᵀ
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) = 2⁻¹ ^ NrComplexPlaces K * ↑(sqrt ‖discr K‖₊)

Next tactic:
calc volume (fundamentalDomain (latticeBasis K))
      _ = ‖((mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)).det‖₊ := by
        rw [← fundamentalDomain_reindex _ e.symm, ← norm_toNNReal, measure_fundamentalDomain
          ((latticeBasis K).reindex e.symm), volume_fundamentalDomain_stdBasis, mul_one]
        rfl
      _ = ‖(matrixToStdBasis K).det * N.det‖₊ := by
        rw [← nnnorm_real, ← ofReal_eq_coe, RingHom.map_det, RingHom.mapMatrix_apply, this,
          det_mul, det_transpose, det_reindex_self]
      _ = (2 : ℝ≥0∞)⁻¹ ^ Fintype.card {w : InfinitePlace K // IsComplex w} * sqrt ‖N.det ^ 2‖₊ := by
        have : ‖Complex.I‖₊ = 1 := by rw [← norm_toNNReal, norm_eq_abs, abs_I, Real.toNNReal_one]
        rw [det_matrixToStdBasis, nnnorm_mul, nnnorm_pow, nnnorm_mul, this, mul_one, nnnorm_inv,
          coe_mul, ENNReal.coe_pow, ← norm_toNNReal, IsROrC.norm_two, Real.toNNReal_ofNat,
          coe_inv two_ne_zero, coe_ofNat, nnnorm_pow, NNReal.sqrt_sq]
      _ = (2 : ℝ≥0∞)⁻¹ ^ Fintype.card { w // IsComplex w } * NNReal.sqrt ‖discr K‖₊ := by
        rw [← Algebra.discr_eq_det_embeddingsMatrixReindex_pow_two, Algebra.discr_reindex,
          ← coe_discr, map_intCast, ← Complex.nnnorm_int]
theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊ := by
  let f : Module.Free.ChooseBasisIndex ℤ (𝓞 K) ≃ (K →+* ℂ) :=
    (canonicalEmbedding.latticeBasis K).indexEquiv (Pi.basisFun ℂ _)
  let e : (index K) ≃ Module.Free.ChooseBasisIndex ℤ (𝓞 K) := (indexEquiv K).trans f.symm
  let M := (mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)
  let N := Algebra.embeddingsMatrixReindex ℚ ℂ (integralBasis K ∘ f.symm)
    RingHom.equivRatAlgHom
  suffices M.map Complex.ofReal = (matrixToStdBasis K) *
      (Matrix.reindex (indexEquiv K).symm (indexEquiv K).symm N).transpose by
    calc volume (fundamentalDomain (latticeBasis K))
      _ = ‖((mixedEmbedding.stdBasis K).toMatrix ((latticeBasis K).reindex e.symm)).det‖₊ := by
        

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) ≃ (K →+* ℂ) :=
  Basis.indexEquiv (canonicalEmbedding.latticeBasis K) (Pi.basisFun ℂ (K →+* ℂ))
e : index K ≃ Module.Free.ChooseBasisIndex ℤ ↥(𝓞 K) := (indexEquiv K).trans f.symm
M : Matrix (index K) (index K) ℝ := Basis.toMatrix (mixedEmbedding.stdBasis K) ⇑(Basis.reindex (latticeBasis K) e.symm)
N : Matrix (K →+* ℂ) (K →+* ℂ) ℂ :=
  Algebra.embeddingsMatrixReindex ℚ ℂ (⇑(integralBasis K) ∘ ⇑f.symm) RingHom.equivRatAlgHom
this : Matrix.map M ⇑ofReal = matrixToStdBasis K * ((reindex (indexEquiv K).symm (indexEquiv K).symm) N)ᵀ
⊢ ↑↑volume (fundamentalDomain (latticeBasis K)) =
    ↑‖det (Basis.toMatrix (mixedEmbedding.stdBasis K) ⇑(Basis.reindex (latticeBasis K) e.symm))‖₊

Next tactic:
rw [← fundamentalDomain_reindex _ e.symm, ← norm_toNNReal, measure_fundamentalDomain
          ((latticeBasis K).reindex e.symm), volume_fundamentalDomain_stdBasis, mul_one]