Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fixed-point sine and cosine evaluation bounds

Proved
ArbEcon.taylor_fixed

by Johan Mercedes · Oct 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

arda-rh65k-transfernumber-theoryriemann-zeta

Let P,K,m,τP,K,m,\tauP,K,m,τ be nonnegative integers, Q=2PQ=2^PQ=2P, and 16m≤13Q16m\le13Q16m≤13Q. Let BK=(13/16)2K+2(2K+3)/((2K+2)!(2K+2))B_K=(13/16)^{2K+2}(2K+3)/((2K+2)!(2K+2))BK​=(13/16)2K+2(2K+3)/((2K+2)!(2K+2)) and assume QBK≤τQB_K\le\tauQBK​≤τ. Put w=⌊m2/Q⌋w=\lfloor m^2/Q\rfloorw=⌊m2/Q⌋. Let H(Q,w,D,h)H(Q,w,D,h)H(Q,w,D,h) be the defined integer Horner evaluator, and let DcD_cDc​ and DsD_sDs​ be the respective descending divisor lists Q(2j−1)(2j)Q(2j-1)(2j)Q(2j−1)(2j) and Q(2j)(2j+1)Q(2j)(2j+1)Q(2j)(2j+1) for j=K,…,1j=K,\ldots,1j=K,…,1. Define

C=H(Q,w,Dc,Q),S=⌊mH(Q,w,Ds,Q)Q⌋.C=H(Q,w,D_c,Q),\qquad S=\left\lfloor\frac{mH(Q,w,D_s,Q)}{Q}\right\rfloor.C=H(Q,w,Dc​,Q),S=⌊QmH(Q,w,Ds​,Q)​⌋.

Then

∣C−Qcos⁡(m/Q)∣≤3+τ,∣S−Qsin⁡(m/Q)∣≤4+τ,C≤Q,S≤Q.|C-Q\cos(m/Q)|\le3+\tau,\quad |S-Q\sin(m/Q)|\le4+\tau,\quad C\le Q,\quad S\le Q.∣C−Qcos(m/Q)∣≤3+τ,∣S−Qsin(m/Q)∣≤4+τ,C≤Q,S≤Q.

This verifies the fixed-point Taylor core used by the trigonometric checker.

Preamble
import Definitions.Def_ArdaRH65K_Probes_ArbEconomics_Sound
import Definitions.Def_ArdaRS_Arithmetic
import Mathlib.Analysis.Complex.Exponential
import Mathlib.Analysis.Real.Pi.Bounds
import Mathlib.Analysis.SpecialFunctions.Log.Deriv
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds
import Mathlib.Tactic.IntervalCases
import Theorems.Thm_ArbEcon_cos_sin_taylor
import Theorems.Thm_ArbEcon_horner_err
/-  Probes/ArbEconomics_Sound.lean -- soundness of the Nat-only zeta evaluator (ArbEconomics_Eval).

    Every function of `ArbEconomics_Eval` is shown to produce a TRUE enclosure:
      * `logInc`   : `S <= (log m - log (m-1)) 2^P <= S + K + T`
                     (Mathlib `Real.hasSum_pow_div_log_of_abs_lt_one`, `abs_log_sub_add_sum_range_le`);
      * `termOf`   : `Rlo <= 2^P / sqrt m <= Rhi` for ANY Newton iterate (two-sided validation);
      * `trig`     : cos/sin balls of `theta` from the (pi/2)-reduction, the Horner scheme
                     (Mathlib `Complex.exp_bound`) and the quadrant rotation;
      * `step`/`run` : the loop invariant `Inv` (log bracket + Re/Im balls of the partial zeta sum).

    The main theorem `run_sound` turns a kernel-checked chunk equation
    `St.beq (run cfg L s) s' = true` into `Inv n s -> Inv (n + L) s'`.

    conjecture1_proved = False.  Finite interval arithmetic; nothing here is about RH.
-/










open Real Finset

section
namespace ArbEcon
end ArbEcon
open ArbEcon

/-! ## A. floor division / shifts, cast to ℝ -/











/-! The evaluator calls the kernel primitives directly; these `rfl` lemmas translate them back to
    notation for the proofs. -/










/-! ## B. the log increment -/











/-! ## C. the square-root bracket -/



/-! ## D. the theta interval -/



/-! ## E. Horner: real recursion, closed form, fixed-point error -/


















/-! ## F. Taylor remainders for cos / sin through `Complex.exp_bound` -/





/-! ## G. cos / sin of theta: reduction, Taylor core, rotation -/














Formal statement

theorem ArbEcon.taylor_fixed (P K mag tau : ℕ) (hmag : mag * 16 ≤ 13 * 2 ^ P)
    (htau : (2 : ℝ) ^ P * taylorBnd K ≤ tau) :
    let one := 2 ^ P
    let w := Nat.shiftRight (Nat.mul mag mag) P
    let C := horner one w ((divList fcos K).map (fun d : ℕ => one * d)) one
    let S0 := Nat.shiftRight (Nat.mul mag (horner one w ((divList fsin K).map (fun d : ℕ => one * d)) one)) P
    |(C : ℝ) - 2 ^ P * Real.cos ((mag : ℝ) / 2 ^ P)| ≤ 3 + tau ∧
    |(S0 : ℝ) - 2 ^ P * Real.sin ((mag : ℝ) / 2 ^ P)| ≤ 4 + tau ∧ C ≤ one ∧ S0 ≤ one := by sorry
Source
https://github.com/DrMurphyIsIn/Arda/blob/af4fde8972eb6d4e78c7d9a95933b18b81adf52d/telperion/examples/zeta_reflection/lean/Probes/ArbEconomics_Sound.lean#L584-L683

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me