OAI/Combinatorics/ContingencyTables/Machines/PowerApproximationProgram.lean
10 declarations, 0 contain sorry, 0 declared as axioms
The executed power-of-two approximation used by the weight oracle
Both stages are concrete binary programs: compute the rounded signed power, then bisect using natural cross-products and shared denominators. The two allowance lists determine the precision parameters.
- abbrev
OAI.ContingencyTables.PowerApproximationProgram.Inputline 16 - def
OAI.ContingencyTables.PowerApproximationProgram.prepareline 18 - def
OAI.ContingencyTables.PowerApproximationProgram.prepareRealizerline 20 - lemma
OAI.ContingencyTables.PowerApproximationProgram.polynomial_prepareline 25 - def
OAI.ContingencyTables.PowerApproximationProgram.outputline 33 - def
OAI.ContingencyTables.PowerApproximationProgram.outputRealizerline 34 - theorem
OAI.ContingencyTables.PowerApproximationProgram.polynomial_outputline 36 - theorem
OAI.ContingencyTables.PowerApproximationProgram.output_valueline 39 - theorem
OAI.ContingencyTables.PowerApproximationProgram.output_approximateline 50Source documentation
The encoded output agrees exactly with the rational value used by the existing finite-word correction laws.
theorem output_approximate (p n d : ℕ) (degree depth : List Bool) (sigma : ℚ) (hdegree: degree.length=PowerOfTwoApproximation.rootDegree sigma) (hdepth: depth.length=PowerOfTwoApproximation.depth sigma) (hlo: -2≤((p:ℚ)-n)/d) (hhi: ((p:ℚ)-n)/d≤2) : TreeFraction.val (output (((p,n),d),(degree,depth)))= PowerOfTwoApproximation.approximate (((p:ℚ)-n)/d) sigma := by …Mentions: OAI.ContingencyTables.PowerOfTwoApproximation.rootDegree, OAI.ContingencyTables.PowerOfTwoApproximation.depth, OAI.ContingencyTables.PowerApproximationProgram.output, OAI.ContingencyTables.PowerOfTwoApproximation.approximate
- theorem
OAI.ContingencyTables.PowerApproximationProgram.output_errorline 59