interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / train / omega-llm / tools / combined / experiment / Budget.lean

22 lines · 847 bytes Raw Blame History
1import Std
2
3-- measure.query admits a previously unused input exactly when fewer than eight
4-- answers have been recorded. A fallback and a regeneration use that same gate.
5def charge (used : Nat) (fresh : Bool) : Nat :=
6 if fresh && decide (used < 8) then used + 1 else used
7
8theorem charge_bounded (used : Nat) (fresh : Bool) (h : used ≤ 8) :
9 charge used fresh ≤ 8 := by
10 unfold charge
11 split <;> simp_all <;> omega
12
13theorem sequence_bounded (attempts : List Bool) (used : Nat) (h : used ≤ 8) :
14 attempts.foldl charge used ≤ 8 := by
15 induction attempts generalizing used with
16 | nil => exact h
17 | cons fresh rest ih => exact ih _ (charge_bounded used fresh h)
18
19theorem starting_with_four (attempts : List Bool) :
20 attempts.foldl charge 4 ≤ 8 := sequence_bounded attempts 4 (by decide)
21
22#print axioms starting_with_four