def
definition
dot
show as:
view math explainer →
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
depends on
used by
-
compensatory_nonneg_of_sqNorm_le_one -
dot_sq_le_sqNorm_mul -
multiplicative_le_additive_of_sqNorm_le_one -
multiplicativeQuadratic -
sqNorm -
sqNorm_uniform -
uniform_sqNorm_one -
aggregate -
dot_log_hadamardDiv -
dot_log_hadamardInv -
dot_log_hadamardMul -
JcostN_eq_cosh_logsum -
JcostN_eq_zero_iff -
JcostN_unit -
JlogN -
JlogN_eq_cosh_sub_one -
Vec -
JcostN_dAlembert -
applyHessian_eq_direction -
applyHessian_of_dot_zero -
gradientEntry -
hessianAt_factor -
hessianEntry -
hessianEntry_zero -
quadraticHessian -
quadraticHessian_eq -
metricEntry_zero -
aggregate_eq_one_iff -
zero_cost_iff_dot_zero -
AApply -
AApply_add -
AApply_smul -
AApply_sq -
dot_AApply -
mu -
add_mem_Radical -
affineShift_mem_LevelSet -
dot_affineShift -
LevelSet -
mem_LevelSet_iff
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) :