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.
This commit is contained in:
andrew committed 2026-11-17 14:39:41 -05:00
1 parent efd1b323e7
commit 6cfdb13da1
3 files changed
+66 -99

No files matched your search

-75
View File
@@ -2047,56 +2047,6 @@ attribute [simp] normalizeCompleteResult_keys_ne
all_goals (try (exfalso; omega))
all_goals (try rfl)
@[simp] theorem tr_nonposRevReduced (r : RangeRead) (res : Result) (hne : res.keys ≠ []) :
FormalConflictRange.nonposRevReduced (toRefRead r) (toRefRes res) = toRefRead
(Statement.nonposRevReduced (r) (res)) := by
unfold FormalConflictRange.nonposRevReduced Statement.nonposRevReduced
simp [Statement.firstKey, Statement.lastKey, Statement.first, Statement.last,
Statement.afterFirst, Statement.afterLast, Statement.bottom, Statement.range,
Statement.forwardRead, Statement.reversedResult, Statement.crossedBegin,
Statement.completeClosedWith, Statement.closedFormOffsetOneWith, Statement.closedFormSplit,
Statement.residualE, Statement.residualT, Statement.residualB, Statement.residualD,
FormalConflictRange.compactSplit, FormalConflictRange.residualE,
FormalConflictRange.residualT, FormalConflictRange.residualB, FormalConflictRange.residualD,
FormalConflictRange.endOvershoot, FormalConflictRange.reportedAtEnd, hne]
all_goals (try rfl)
all_goals (try (intros; rfl))
all_goals (try (intros; exact Iff.rfl))
all_goals (try (intros; simp_all))
all_goals (try (split_ifs <;> simp_all))
all_goals (try (split <;> simp_all))
all_goals (try order)
all_goals (try omega)
all_goals (try contradiction)
all_goals (try (exfalso; order))
all_goals (try (exfalso; omega))
all_goals (try rfl)
@[simp] theorem tr_closedFormNonposRevTrunc (r : RangeRead) (res : Result) (hne : res.keys ≠ []) :
FormalConflictRange.closedFormNonposRevTrunc (toRefRead r) (toRefRes res) = toRefCR
(Statement.closedFormNonposRevTrunc (r) (res)) := by
unfold FormalConflictRange.closedFormNonposRevTrunc Statement.closedFormNonposRevTrunc
simp [Statement.firstKey, Statement.lastKey, Statement.first, Statement.last,
Statement.afterFirst, Statement.afterLast, Statement.bottom, Statement.range,
Statement.forwardRead, Statement.reversedResult, Statement.crossedBegin,
Statement.completeClosedWith, Statement.closedFormOffsetOneWith, Statement.closedFormSplit,
Statement.residualE, Statement.residualT, Statement.residualB, Statement.residualD,
FormalConflictRange.compactSplit, FormalConflictRange.residualE,
FormalConflictRange.residualT, FormalConflictRange.residualB, FormalConflictRange.residualD,
FormalConflictRange.endOvershoot, FormalConflictRange.reportedAtEnd, hne]
all_goals (try rfl)
all_goals (try (intros; rfl))
all_goals (try (intros; exact Iff.rfl))
all_goals (try (intros; simp_all))
all_goals (try (split_ifs <;> simp_all))
all_goals (try (split <;> simp_all))
all_goals (try order)
all_goals (try omega)
all_goals (try contradiction)
all_goals (try (exfalso; order))
all_goals (try (exfalso; omega))
all_goals (try rfl)
@[simp] theorem tr_closedFormZeroCrossEndOneLong (r : RangeRead) (res : Result) (hne : res.keys ≠
[]) :
FormalConflictRange.closedFormZeroCrossEndOneLong (toRefRead r) (toRefRes res) = toRefCR
@@ -2786,31 +2736,6 @@ attribute [simp] normalizeCompleteResult_keys_ne
all_goals (try (exfalso; omega))
all_goals (try rfl)
@[simp] theorem tr_closedFormClamped (r : RangeRead) (res : Result) (hne : res.keys ≠ []) :
FormalConflictRange.compactClamped (toRefRead r) (toRefRes res) = toRefCR
(Statement.closedFormClamped (r) (res)) := by
unfold FormalConflictRange.compactClamped Statement.closedFormClamped
simp [Statement.firstKey, Statement.lastKey, Statement.first, Statement.last,
Statement.afterFirst, Statement.afterLast, Statement.bottom, Statement.range,
Statement.forwardRead, Statement.reversedResult, Statement.crossedBegin,
Statement.completeClosedWith, Statement.closedFormOffsetOneWith, Statement.closedFormSplit,
Statement.residualE, Statement.residualT, Statement.residualB, Statement.residualD,
FormalConflictRange.compactSplit, FormalConflictRange.residualE,
FormalConflictRange.residualT, FormalConflictRange.residualB, FormalConflictRange.residualD,
FormalConflictRange.endOvershoot, FormalConflictRange.reportedAtEnd, hne]
all_goals (try rfl)
all_goals (try (intros; rfl))
all_goals (try (intros; exact Iff.rfl))
all_goals (try (intros; simp_all))
all_goals (try (split_ifs <;> simp_all))
all_goals (try (split <;> simp_all))
all_goals (try order)
all_goals (try omega)
all_goals (try contradiction)
all_goals (try (exfalso; order))
all_goals (try (exfalso; omega))
all_goals (try rfl)
@[simp] theorem tr_zeroCrossOvershootComplete (r : RangeRead) (res : Result) (hne : res.keys ≠ []) :
FormalConflictRange.zeroCrossOvershootComplete (toRefRead r) (toRefRes res) ↔
Statement.zeroCrossOvershootComplete (r) (res) := by