Imports
/- Copyright (c) 2026 Google LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -/ module public import Cryptids.Riemann104
@[expose] public sectionnamespace ConjectureMachines.Riemann95.Algorithmopen ConjectureMachines.Riemann120 (quarterClock)

Destructive clock evaluation with one saturated decrement on each unwind.

def residual : Nat → Nat → Nat | 0, f => f | n+1, f => residual (n/4) (f/2) - 1 termination_by n _ => n decreasing_by All goals completed! 🐙theorem residual_eq (j f : Nat) : residual j f = f / 2 ^ quarterClock j - quarterClock j := j:ℕf:ℕ⊢ residual j f = f / 2 ^ quarterClock j - quarterClock j induction j using Nat.strong_induction_on generalizing f with j:ℕih:∀ m < j, ∀ (f : ℕ), residual m f = f / 2 ^ quarterClock m - quarterClock mf:ℕ⊢ residual j f = f / 2 ^ quarterClock j - quarterClock j cases j with f:ℕih:∀ m < 0, ∀ (f : ℕ), residual m f = f / 2 ^ quarterClock m - quarterClock m⊢ residual 0 f = f / 2 ^ quarterClock 0 - quarterClock 0 All goals completed! 🐙 f:ℕn:ℕih:∀ m < n + 1, ∀ (f : ℕ), residual m f = f / 2 ^ quarterClock m - quarterClock m⊢ residual (n + 1) f = f / 2 ^ quarterClock (n + 1) - quarterClock (n + 1) f:ℕn:ℕih:∀ m < n + 1, ∀ (f : ℕ), residual m f = f / 2 ^ quarterClock m - quarterClock m⊢ f / (2 * 2 ^ quarterClock (n / 4)) - (quarterClock (n / 4) + 1) = f / (2 * 2 ^ quarterClock (n / 4)) - (1 + quarterClock (n / 4)) All goals completed! 🐙end ConjectureMachines.Riemann95.Algorithm