switch_vk
def
For natural numbers k and x, switch_vk k x is defined as Nat.findGreatest (fun d => switch_qk k d ≤ x) x, the greatest natural number d ≤ x such that switch_qk k d ≤ x.
Statement
def switch_vk (k x : ℕ) : ℕ- Defined in
- arXiv:2611.28727 Fig. 9
- Verified
- 29 Nov 2026
- Axioms
- none listed
- Built on 1
- switch_qkThe function switch_qk maps natural numbers k and d to a natural number, defined recursively by cases: if d ≤ k then d + 1; else if d < (3…
- Used by 1
- switch_vk_zeroFor every natural number k, switch_vk k 0 equals 0.
Read back from the Lean
switch_vk defines a function of two natural numbers k and x that returns the greatest natural number d ≤ x such that switch_qk k d ≤ x, or 0 if no such d exists (via Nat.findGreatest).
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The threshold inverse v_k(x) = max {d : Q_k(d) ≤ x}. -/ def switch_vk (k x : ℕ) : ℕ := Nat.findGreatest (fun d => switch_qk k d ≤ x) x