Commit a94ee81
authored
## Summary
- Discharges the two round-trip lemmas deferred in
`src/abi/EchidnaABI/TacticRecord.idr`:
- `natToFinToNat : (n : Nat) -> (0 _ : LT n (S MaxConfidence)) ->
finToNat (natToFinLT n) = n`
- `clampRoundtripInRange: (n : Nat) -> (prf : LT n (S MaxConfidence)) ->
finToNat (clampConfidence n) = n`
- Polymorphic helper `finToNatNatToFinLT` sidesteps the unification trap
the original deferral comment misidentified as missing weakening: with
`m` left implicit the recursive call's upper bound shrinks structurally
and the `LTESucc` pattern unpacks without `lteSuccRight` glue. The
specific-`S MaxConfidence` instance specialises in one line.
`clampRoundtripInRange` `with`-abstracts on the same `isLT n (S
MaxConfidence)` that `clampConfidence` inspects: `Yes` reduces and
discharges via `natToFinToNat`; `No` is contradicted by the hypothesis
via `absurd`.
- Constraint preserved: zero `believe_me`, zero `postulate`, zero
`admit`, zero `assert_total`. All three new lemmas verified `total` by
Idris2 0.8.0 REPL `:total`.
## Test plan
- [x] `idris2 --check EchidnaABI/TacticRecord.idr` → `1/1: Building
EchidnaABI.TacticRecord` (clean, zero warnings)
- [x] `:total natToFinToNat` → total
- [x] `:total clampRoundtripInRange` → total
- [x] `:total finToNatNatToFinLT` → total
- [x] Pre-existing comparison-order lemmas (`compareByConfidenceRefl`,
`compareByConfidenceAntiSym`) still total — no regression
- [x] `grep -nE
'believe_me|assert_total|postulate|admit|sorry|Admitted'` against the
file returns only doc-comment occurrences (`||| NO ...`)
Closes #152.
1 parent 598487c commit a94ee81
1 file changed
Lines changed: 44 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
94 | 120 | | |
95 | 121 | | |
96 | 122 | | |
| |||
188 | 214 | | |
189 | 215 | | |
190 | 216 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
0 commit comments