-- Maclain Hunter: Loop Halting Guarantee -- Exact authored source SHA-256: 9bca977c1c264cbc7b860f19a086650304fa6c7c8495d1566b6cafb552eba3dd -- Machine formalization by Replit Agent; authority below Logic/Logos/God. import Lean namespace HunterAuthored def iterations {α : Type} (step : α → Option α) : Nat → α → Nat | 0, _ => 0 | n + 1, s => match step s with | none => 0 | some t => iterations step n t + 1 theorem fuel_iteration_bound {α : Type} (step : α → Option α) (fuel : Nat) (s : α) : iterations step fuel s ≤ fuel := by induction fuel generalizing s with | zero => exact Nat.le_refl 0 | succ n ih => cases h : step s with | none => unfold iterations rw [h] exact Nat.zero_le (n + 1) | some t => unfold iterations rw [h] exact Nat.succ_le_succ (ih t) #print axioms fuel_iteration_bound end HunterAuthored