OAI/Combinatorics/EditApproximation/Coarse/CoarseBinaryWeight.lean
5 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.EditApproximation.BinaryFraction.coarseBinaryChildrenWeightline 10Source documentation
Sum the weights of exactly those child calls made by the binary loop.
def coarseBinaryChildrenWeight {B d : ℕ} {α : Type*} (q L : ℕ) (weight : CoarseSourceTree B α d → CoarseThresholdDraws B d → BinaryFraction → ℕ) (allowance : BinaryFraction) : List (CoarseSourceTree B α d × Fin B × CoarseThresholdDraws B d) → ℕ | [] => 0 | (child, draw, below) :: rest => weight child below (coarseChildAllowanceWithWork L (coarseChildThresholdWithWork B q allowance draw).1).1 + coarseBinaryChildrenWeight q L weight allowance rest /-- One array unit per expanded child shift and one unit per visited node. This counter follows the executed pruning and threshold branches. -/Mentions: OAI.EditApproximation.CoarseSourceTree, OAI.EditApproximation.CoarseThresholdDraws, OAI.EditApproximation.BinaryFraction, OAI.EditApproximation.BinaryFraction.coarseChildAllowanceWithWork, OAI.EditApproximation.BinaryFraction.coarseChildThresholdWithWork, OAI.EditApproximation.BinaryFraction.one
- def
OAI.EditApproximation.BinaryFraction.coarseBinaryWeightline 22Source documentation
One array unit per expanded child shift and one unit per visited node. This counter follows the executed pruning and threshold branches.
def coarseBinaryWeight {B : ℕ} {α : Type*} (k q L : ℕ) : {d : ℕ} → CoarseSourceTree B α d → CoarseThresholdDraws B d → BinaryFraction → ℕ | _, tree, draws, allowance => if (leWithWork (nat tree.word.length) allowance).1 then 1 else match tree, draws with | .leaf _, _ => B * (2 * k + 1) + 1 | .branch children, (draws, below) => B * (2 * k + 1) + 1 + coarseBinaryChildrenWeight q L (fun child => coarseBinaryWeight k q L child) allowance (List.ofFn fun i => (children i, draws i, below i))Mentions: OAI.EditApproximation.CoarseSourceTree, OAI.EditApproximation.CoarseThresholdDraws, OAI.EditApproximation.BinaryFraction, OAI.EditApproximation.BinaryFraction.leWithWork, OAI.EditApproximation.BinaryFraction.nat, OAI.EditApproximation.BinaryFraction.coarseBinaryChildrenWeight
- def
OAI.EditApproximation.BinaryFraction.coarseChildrenSpanline 32 - theorem
OAI.EditApproximation.BinaryFraction.coarseChildrenSpan_eqline 37 - theorem
OAI.EditApproximation.BinaryFraction.coarseChildrenSpan_ofFnline 45