/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import Mathlib.Algebra.MvPolynomial.Equiv public import Mathlib.Analysis.Polynomial.MahlerMeasure public import Mathlib.MeasureTheory.Constructions.Pi public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic@[expose] public section

Multivariable logarithmic Mahler measure

Given $P \in \mathbb{C}[X_0, \dots, X_{n-1}]$, its logarithmic Mahler measure integrates $\log |P|$ over the unit $n$-torus $\mathbb{T}^n \subseteq \mathbb{C}^n$. For $n = 1$, this agrees with Polynomial.logMahlerMeasure under MvPolynomial.uniqueAlgEquiv.

References:

namespace MvPolynomialopen MeasureTheory

Torus map $\theta \mapsto (e^{2\pi i \theta_0}, \dots, e^{2\pi i \theta_{n-1}})$ sending $[0, 1]^n$ onto $\mathbb{T}^n \subseteq \mathbb{C}^n$.

noncomputable def torusPoint {n : ℕ} (θ : Fin n → ℝ) : Fin n → ℂ := fun j ↦ Complex.exp (2 * Real.pi * θ j * Complex.I)

Multivariable logarithmic Mahler integral $m(P) = \int_{[0, 1]^n} \log |P(e^{2\pi i \theta})| , d\theta$ for $P \in \mathbb{C}[X_0, \dots, X_{n-1}]$.

noncomputable def logMahlerMeasure {n : ℕ} (P : MvPolynomial (Fin n) ℂ) : ℝ := ∫ θ in Set.Icc (0 : Fin n → ℝ) 1, Real.log ‖eval (torusPoint θ) P‖@[simp] theorem norm_torusPoint {n : ℕ} (θ : Fin n → ℝ) (j : Fin n) : ‖torusPoint θ j‖ = 1 := n:ℕθ:Fin n → ℝj:Fin n⊢ ‖torusPoint θ j‖ = 1 n:ℕθ:Fin n → ℝj:Fin n⊢ ‖Complex.exp (2 * ↑Real.pi * ↑(θ j) * Complex.I)‖ = 1 n:ℕθ:Fin n → ℝj:Fin nh:‖Complex.exp (↑(2 * Real.pi * θ j) * Complex.I)‖ = 1⊢ ‖Complex.exp (2 * ↑Real.pi * ↑(θ j) * Complex.I)‖ = 1 n:ℕθ:Fin n → ℝj:Fin nh:‖Complex.exp (2 * ↑Real.pi * ↑(θ j) * Complex.I)‖ = 1⊢ ‖Complex.exp (2 * ↑Real.pi * ↑(θ j) * Complex.I)‖ = 1 All goals completed! 🐙@[simp] theorem logMahlerMeasure_C {n : ℕ} (c : ℂ) : logMahlerMeasure (C c : MvPolynomial (Fin n) ℂ) = Real.log ‖c‖ := n:ℕc:ℂ⊢ (C c).logMahlerMeasure = Real.log ‖c‖ n:ℕc:ℂ⊢ ∫ (θ : Fin n → ℝ) in Set.Icc 0 1, Real.log ‖(eval (torusPoint θ)) (C c)‖ = Real.log ‖c‖ n:ℕc:ℂh01:0 ≤ 1⊢ ∫ (θ : Fin n → ℝ) in Set.Icc 0 1, Real.log ‖(eval (torusPoint θ)) (C c)‖ = Real.log ‖c‖ All goals completed! 🐙n:ℕd:Fin n →₀ ℕhnorm:∀ (θ : Fin n → ℝ), ‖(eval (torusPoint θ)) ((monomial d) 1)‖ = 1⊢ ∫ (θ : Fin n → ℝ) in Set.Icc 0 1, Real.log ‖(eval (torusPoint θ)) ((monomial d) 1)‖ = 0 All goals completed! 🐙z:ℂf:MvPolynomial (Fin 1) ℂi:Fin 1ih:Polynomial.eval z ((uniqueAlgEquiv ℂ (Fin 1)) f) = (eval fun x ↦ z) f⊢ Polynomial.eval z ((uniqueAlgEquiv ℂ (Fin 1)) (f * X 0)) = (eval fun x ↦ z) (f * X 0) All goals completed! 🐙

In one variable (Fin 1), MvPolynomial.logMahlerMeasure agrees with Mathlib's Polynomial.logMahlerMeasure under MvPolynomial.uniqueAlgEquiv.

P:MvPolynomial (Fin 1) ℂp:Polynomial ℂ := (uniqueAlgEquiv ℂ (Fin 1)) Pg:ℝ → ℝ := fun x ↦ Real.log ‖Polynomial.eval (circleMap 0 1 x) p‖hpre:⇑(MeasurableEquiv.funUnique (Fin 1) ℝ) ⁻¹' Set.Icc 0 1 = Set.Icc 0 1hfun:∀ (θ : Fin 1 → ℝ), Real.log ‖(eval (torusPoint θ)) P‖ = g (2 * Real.pi * (MeasurableEquiv.funUnique (Fin 1) ℝ) θ)⊢ (2 * Real.pi)⁻¹ • ∫ (x : ℝ) in 2 * Real.pi * 0..2 * Real.pi * 1, g x = p.logMahlerMeasure All goals completed! 🐙All goals completed! 🐙end MvPolynomial