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
omega-mv / train / omega-llm / tools / combined / experiment / Budget.lean
| 1 | import 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. |
| 5 | def charge (used : Nat) (fresh : Bool) : Nat := |
| 6 | if fresh && decide (used < 8) then used + 1 else used |
| 7 | |
| 8 | theorem charge_bounded (used : Nat) (fresh : Bool) (h : used ≤ 8) : |
| 9 | charge used fresh ≤ 8 := by |
| 10 | unfold charge |
| 11 | split <;> simp_all <;> omega |
| 12 | |
| 13 | theorem 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 | |
| 19 | theorem 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 |