pith. machine review for the scientific record. sign in
def

dot

definition
show as:
view math explainer →
module
IndisputableMonolith.Cost.Ndim.Core
domain
Cost
line
21 · github
papers citing
none yet

open explainer

Generate a durable explainer page for this declaration.

open lean source

IndisputableMonolith.Cost.Ndim.Core on GitHub at line 21.

browse module

All declarations in this module, on Recognition.

explainer page

Tracked in the explainer inventory; generation is lazy so crawlers do not trigger LLM jobs.

open explainer

depends on

used by

formal source

  18abbrev Vec (n : ℕ) := Fin n → ℝ
  19
  20/-- Weighted dot product used by the logarithmic aggregate. -/
  21def dot {n : ℕ} (α t : Vec n) : ℝ := ∑ i : Fin n, α i * t i
  22
  23/-- Componentwise logarithm. -/
  24noncomputable def logVec {n : ℕ} (x : Vec n) : Vec n := fun i => Real.log (x i)
  25
  26/-- Componentwise multiplication. -/
  27def hadamardMul {n : ℕ} (x y : Vec n) : Vec n := fun i => x i * y i
  28
  29/-- Componentwise inversion. -/
  30noncomputable def hadamardInv {n : ℕ} (x : Vec n) : Vec n := fun i => (x i)⁻¹
  31
  32/-- Componentwise division. -/
  33noncomputable def hadamardDiv {n : ℕ} (x y : Vec n) : Vec n := fun i => x i / y i
  34
  35/-- Exponential aggregate `R(x) = exp(∑ αᵢ log xᵢ)`. -/
  36noncomputable def aggregate {n : ℕ} (α x : Vec n) : ℝ :=
  37  Real.exp (dot α (logVec x))
  38
  39/-- Log-coordinate `n`-dimensional cost. -/
  40noncomputable def JlogN {n : ℕ} (α t : Vec n) : ℝ :=
  41  Jcost (Real.exp (dot α t))
  42
  43/-- Original positive-coordinate `n`-dimensional cost. -/
  44noncomputable def JcostN {n : ℕ} (α x : Vec n) : ℝ :=
  45  JlogN α (logVec x)
  46
  47@[simp] theorem aggregate_pos {n : ℕ} (α x : Vec n) : 0 < aggregate α x := by
  48  unfold aggregate
  49  exact Real.exp_pos _
  50
  51@[simp] theorem JcostN_eq_Jcost_aggregate {n : ℕ} (α x : Vec n) :