def
definition
aggregate
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 36.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
aggregate_pos -
dot_log_hadamardDiv -
dot_log_hadamardMul -
hadamardDiv -
JcostN_eq_Jcost_aggregate -
JcostN_nonneg -
JcostN_unit -
Vec -
aggregate_eq_one_iff -
zero_cost_iff_aggregate_one -
zero_cost_iff_dot_zero -
FactorsThrough -
forced_of_factorization -
forced_of_scalar_uniqueness -
det_xHessianMatrix2_formula -
det_xHessianMatrix2_ne_zero_of_generic -
det_xHessianMatrix2_zero_cost -
vec2 -
xHessianEntry -
xHessianEntry_diag -
xHessianEntry_offDiag -
xHessianEntry_zero_cost -
xHessianMatrix2 -
xHessianMatrix2OfR -
cmin_pos -
erdos_straus_residual_from_prime_phase_box_distribution
formal source
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) :
52 JcostN α x = Jcost (aggregate α x) := by
53 rfl
54
55theorem JlogN_eq_cosh_sub_one {n : ℕ} (α t : Vec n) :
56 JlogN α t = Real.cosh (dot α t) - 1 := by
57 simpa [JlogN] using (Jcost_exp_cosh (dot α t))
58
59theorem JcostN_eq_cosh_logsum {n : ℕ} (α x : Vec n) :
60 JcostN α x = Real.cosh (dot α (logVec x)) - 1 := by
61 simpa [JcostN, JlogN] using (Jcost_exp_cosh (dot α (logVec x)))
62
63/-- Normalization at the identity vector. -/
64theorem JcostN_unit {n : ℕ} (α : Vec n) :
65 JcostN α (fun _ => 1) = 0 := by
66 simp [JcostN, JlogN, dot, logVec, Jcost_unit0]