Commit Graph
4 Commits
Author SHA1 Message Date
andrew 6559cc582b Simplify the closed-form statement
Collapse duplicated cells and share their conditions:

- Merge the crossed complete clamp cells.  They all fall through to
  `end_.key`, and only the bottom / infinite / head-bottom / last-ge cells
  conflict with the long nonpositive cell, so test `negCrossClampNonposLastGe`
  explicitly and let the rest share the fall-through.
- Allow `r.end_.offset ≤ 1` in the crossed truncated nonpositive cell and
  merge it with the old `...Small` cell into `negCrossTruncRevCrossedLow`.
- Use `overshoot r res` in `negCrossOvershoot` and
  `negCrossTruncRevBelowEnd` instead of spelling out the same key bound.
- Drop the `r.begin.key ≤ r.end_.key` shortcut in `emptyValue`; the
  cardinality branch below already returns `bottom..end_.key` in that case.
- Inline the single-use helpers: `...TruncRevBelowEnd`,
  `...TruncRevCrossedNonposLarge`, `...ResidualFiniteUnder`,
  `...ResidualTopLargeSentinel`, `...TruncRevUnder` and
  `...TruncTopTopEq`.

`Bridge.lean` follows the removed cells, keeping the deleted reference
predicate as a private legacy abbreviation for the bridge proof.
`lake build` is clean.
2026-11-17 16:05:43 -05:00
andrew 6cfdb13da1 Fold the clamped branch into the positive rule
On a clamped nonpositive begin the reference clamped rule `compactClamped` and
the positive rule `compactPositive` coincide: the begin offset is nonpositive,
so `residualB = 0`, and the reversed-truncated rule collapses to its no-skip
case.

So `closedForm` now dispatches on `1 ≤ r.begin.offset ∨ clampedNonpos r res`
and drops `closedFormClamped`, `closedFormNonposRevTrunc` and
`nonposRevReduced`, together with their bridges.  `closedForm_eq` splits
explicitly on the positive and clamped regions, using the new reference lemmas
`ref_closedFormNonposRevTrunc_eq` and `ref_compactClamped_eq_compactPositive`.

The headlines, their statements and the comparator inputs are unchanged.
2026-11-17 14:39:41 -05:00
andrew efd1b323e7 Prove minimality is unique and add it to the headlines
- Define `ConflictRange.toSet`, the set of keys lying in a range
- Add the headline `MinimalUnique`: any two minimal sound ranges for the
  same read and result denote the same set of keys
- Transport `FormalConflictRange.Minimal.toSet_eq` across the bridge; the
  statement is unconditional, since `Minimal` already carries soundness
- State `Statement.minimalUnique` in the challenge and add it to the
  comparator's `theorem_names`

`lake build` is warning-free and `lake comparator` accepts both headlines.
2026-11-17 11:39:52 -05:00
andrew 7a0826e873 Add statement of conflict-range minimality and license 2026-11-16 15:24:39 -05:00