Polish release docs and add CI checks
- Correct stale references and headline-path wording in READMEs and Lean docstrings - Document build steps, comparator requirements, sweep scope, and coverage - Unify Apache headers across Lean and C++ sources - Add a bwrap-free axiom audit for the headline theorems - Add a Gitea workflow running lake build, the axiom audit, C++ tests, and coverage - Match LLVM coverage tool versions to the compiler and recreate stale build dirs
This commit is contained in:
1 parent
73e371fb40
commit
273ad72f0c
34 files changed
+431
-133
No files matched your search
@@ -16,18 +16,25 @@ The conflict-range inference has two layers.
|
||||
(unconditional) empty-result theory of `FormalConflictRange.Empty` and
|
||||
`FormalConflictRange.Nonpos`: a result with no keys is answered by the empty-result
|
||||
value `emptyValue`, and the remaining certified offset cases are handled as in
|
||||
`FormalConflictRange.Sound`. **This is the object of record**: the correctness
|
||||
statement is `conflictRangePartial_spec`, and the open frontier is exactly the
|
||||
set of inputs on which it returns `none`. When that set is empty the algorithm is
|
||||
total and is promoted to the `ConflictRange`-valued algorithm.
|
||||
`FormalConflictRange.Sound`. The correctness statement is
|
||||
`conflictRangePartial_spec`: wherever the function returns `some cr`, that range
|
||||
is minimal. The inputs on which it returns `none` are the cases this case-analysis
|
||||
route did not certify. The headline theorem is proved independently in
|
||||
`Proof.lean` through the closed-form development
|
||||
(`FormalConflictRange.ClosedFormAll`). This module also supplies that
|
||||
development's empty-result theory — `emptyValue`, `EmptyInferenceWitness`,
|
||||
and `minimal_emptyValue_of_emptyInference` — so the partial-algorithm
|
||||
sections below are a record of the case analysis, while the empty-result
|
||||
declarations are shared with the final proof.
|
||||
* The provisional totalization `conflictRangeVal`, assembled by *reduction to the
|
||||
empty reads* rather than case analysis. It is the every-input wrapper used to
|
||||
*state* the general reduction: it dispatches on emptiness, truncation, and
|
||||
traversal and returns a `ConflictRange` on the certified regions. Off them its
|
||||
value is a placeholder whose hull fallback is not sound in general (see
|
||||
`FormalConflictRange.Counterexample`), and its `_spec` theorems are relative to
|
||||
the open `EmptyTheoryComplete`. It is kept only until `conflictRangePartial` is
|
||||
total, at which point it is replaced. It dispatches as follows:
|
||||
value is a placeholder whose hull fallback is not sound in general (a complete
|
||||
read whose reported keys are not the endpoint keys of the hull gives a
|
||||
counterexample), and its `_spec` theorems are relative to the conditional
|
||||
`EmptyTheoryComplete`. It is kept only as the intermediate reduction interface.
|
||||
It dispatches as follows:
|
||||
|
||||
- an empty result is answered by the empty theory's value `emptyValue`;
|
||||
- a forward truncated result is `[w, keyAfter kₙ)`: the begin selector's empty
|
||||
@@ -54,15 +61,15 @@ The conflict-range inference has two layers.
|
||||
stretched to the complete value's endpoints (`BoundaryNecessity`), the content the
|
||||
empty inference supplies as `ψ` at the two boundary reads. Hull soundness is derived
|
||||
from `EmptyInference` for all bridge factors except the bracket (`BracketFactor`),
|
||||
which is the notes' observability residue. The complete branch is then
|
||||
which is the bracket-observability residue. The complete branch is then
|
||||
`minimal_completeRange_of_factors`/`_rev`, with the interior derived rather than
|
||||
assumed; `GeneralObligation` adds only the two truncated dispatch values. Its
|
||||
conditional correctness statement is `conflictRangeVal_spec` (relative to
|
||||
`EmptyTheoryComplete`); the algorithm of record remains `conflictRangePartial`. In the
|
||||
canonical region (`begin.offset = 1`, `end.offset ≤ 1`, canonical endpoints) the complete
|
||||
branch is unconditional
|
||||
`EmptyTheoryComplete`); the certified algorithm in this module remains
|
||||
`conflictRangePartial`. In the canonical region (`begin.offset = 1`,
|
||||
`end.offset ≤ 1`, canonical endpoints) the complete branch is unconditional
|
||||
(`minimal_completeRange_canonical`), needing neither boundary hypothesis. There are
|
||||
no `sorry`s: the open content appears only as those explicit hypotheses.
|
||||
no `sorry`s: the uncertified content appears only as those explicit hypotheses.
|
||||
|
||||
The reduction identity itself is `necessaryRange_completeRange_of_reported`: the
|
||||
complete value's necessary range is the lower boundary, the reported interval, and the
|
||||
@@ -77,11 +84,10 @@ The conflict-range inference has two layers.
|
||||
`EmptyInferenceWitness` records the empty theory in the witness-exposing form the graft
|
||||
consumes and implies `EmptyInference` (`emptyInference_of_witness`). The one genuine
|
||||
extraction — turning an abstract `Minimal` for a boundary read into a full-compatible
|
||||
witness database — remains the length-sensitive joint-base graft; it is the reason the
|
||||
boundary content is a hypothesis and not a consequence of `EmptyInference` alone. (It is
|
||||
in fact *false*, not merely unproved:
|
||||
`FormalConflictRange.Counterexample.cw_notBoundaryJointBases` refutes `BoundaryJointBases`
|
||||
on the `cwRead`/`cwRes` witness.)
|
||||
witness database — is the length-sensitive joint-base graft; it is the reason the
|
||||
boundary content is a hypothesis and not a consequence of `EmptyInference` alone. It is
|
||||
in fact *false*, not merely unproved: a two-key witness makes the hull endpoints differ
|
||||
from the reported interval's, so `BoundaryJointBases` fails for it.
|
||||
|
||||
The pushed-down interface makes the confinement of offsets explicit. The complete
|
||||
branch's nonempty content is `CompleteObligation`, whose fields are the generic graft
|
||||
@@ -94,17 +100,17 @@ The conflict-range inference has two layers.
|
||||
the witness-exposing empty oracle, the generic graft, the bracket gap split, and the
|
||||
truncated one-sided graft. From it, `conflictRangeVal_spec_complete` proves the general
|
||||
algorithm correct with `Readable` the only other hypothesis, and
|
||||
`exists_minimal_conflict_range_of_complete` gives the existence conjecture. The graft
|
||||
fields (`joint`, `truncated`) are guarded by `Readable`: a bridge database exists only
|
||||
when the reported keys are the complete keys of some database, so for an unrealizable
|
||||
pair `BoundaryJointBases`/`GeneralObligation` are outright false (a duplicate reported
|
||||
key can never satisfy `midEq`). The unconditional headline claim is *not* proved here: it
|
||||
is stated with explicit `sorry`s in `FormalConflictRange.Open` (which is built but
|
||||
deliberately not imported by this module). All three non-witness fields of
|
||||
`exists_minimal_conflict_range_of_complete` gives existence from the same hypotheses.
|
||||
The graft fields (`joint`, `truncated`) are guarded by `Readable`: a bridge database
|
||||
exists only when the reported keys are the complete keys of some database, so for an
|
||||
unrealizable pair `BoundaryJointBases`/`GeneralObligation` are outright false (a
|
||||
duplicate reported key can never satisfy `midEq`). This conditional route is not the
|
||||
headline proof: the unconditional statement is proved in `Proof.lean`, where the closed
|
||||
form is established directly for the reference development. All three non-witness
|
||||
fields of
|
||||
`EmptyTheoryComplete` are in fact *refuted* — `bracket` and `truncated` as before, and
|
||||
`joint` (`BoundaryJointBases`) by the same `cwRead`/`cwRes` witness that refutes the hull
|
||||
(`FormalConflictRange.Counterexample.cw_notBoundaryJointBases`), so the reduction is
|
||||
uninhabited rather than merely unproved.
|
||||
`joint` (`BoundaryJointBases`) by the two-key witness that also refutes the hull — so
|
||||
the reduction is uninhabited rather than merely unproved.
|
||||
|
||||
On the empty theory itself, the witness-exposing oracle is proved at
|
||||
`begin.offset = 1` (`emptyWitness_beginOne`), throughout the whole `end.offset ≤ 1`
|
||||
@@ -137,14 +143,16 @@ The conflict-range inference has two layers.
|
||||
`EmptyInferenceWitnessResidual` is therefore vacuous: the whole oracle is
|
||||
`emptyInferenceWitness`, unconditionally, and `emptyInference : EmptyInference` follows.
|
||||
What remains of the empty theory is only the graft and gap-split fields of
|
||||
`EmptyTheoryComplete`, packaged by `emptyTheoryComplete_of_witness`; those fields are the
|
||||
open `sorry`s of `FormalConflictRange.Open`. The gap-split field `BracketFactor` is in
|
||||
fact *false* as stated on the old hull, by the kernel-checked witness in
|
||||
`FormalConflictRange.Counterexample`; `completeValue` routes the canonical region
|
||||
`1 ≤ begin.offset ∧ end.offset ≤ 1` around the hull precisely so that this pair is
|
||||
answered correctly without it.
|
||||
`EmptyTheoryComplete`, packaged by `emptyTheoryComplete_of_witness`. The gap-split field
|
||||
`BracketFactor` is in fact *false* as stated on the hull: a compatible database can
|
||||
satisfy the boundary conditions while the bracket fails. `completeValue` routes the
|
||||
canonical region `1 ≤ begin.offset ∧ end.offset ≤ 1` around the hull precisely so that
|
||||
this pair is answered correctly without it.
|
||||
|
||||
The reduction is the subject of section 7 of `notes/main.tex`.
|
||||
The reduction described here was the working route to the closed form; the final
|
||||
argument in `Proof.lean` uses the closed-form theorems instead. The empty-result
|
||||
part of this module (`emptyValue`, `EmptyInference`, and
|
||||
`minimal_emptyValue_of_emptyInference`) is shared with that development.
|
||||
-/
|
||||
|
||||
namespace FormalConflictRange
|
||||
@@ -152,8 +160,8 @@ namespace FormalConflictRange
|
||||
/-!
|
||||
## A partial algorithm: the certified cases
|
||||
|
||||
The general existence conjecture is open, but the theorems above certify a region
|
||||
of reads. Package them into one computable `Option`-valued function,
|
||||
The theorems above certify a region of reads. Package them into one computable
|
||||
`Option`-valued function,
|
||||
`conflictRangePartial`, returning `some` range exactly where a certificate exists
|
||||
and `none` otherwise. This is the honest encoding of "proved only for certain
|
||||
cases": it is total in type but makes absence explicit, and `none` carries no
|
||||
@@ -393,7 +401,7 @@ abbrev zeroCrossCompleteRev (r : RangeRead) (res : Result) : Prop :=
|
||||
## The empty-result value and its inference
|
||||
|
||||
The empty-result value `emptyValue` and the standing hypothesis `EmptyInference` are
|
||||
declared here, before `conflictRangePartial`, because the algorithm of record consults
|
||||
declared here, before `conflictRangePartial`, because the certified algorithm consults
|
||||
them directly: an empty result is answered by `emptyValue r`, and the certified branch
|
||||
of the partial algorithm is exactly the empty-result inference. The witness oracle and
|
||||
the unconditional proof of `EmptyInference` live later in this file, so the inference is
|
||||
@@ -523,9 +531,10 @@ def conflictRangePartial (r : RangeRead) (res : Result) : Option ConflictRange :
|
||||
-- (`minimal_canonicalRange_of_end_offset_le_one_general`). A truncated
|
||||
-- (`more = true`) forward result now has it too
|
||||
-- (`minimal_canonicalRange_of_truncated_end_offset_nonpos`): FoundationDB's bare
|
||||
-- successor `[begin.key, keyAfter (last reported))` is *unsound* there
|
||||
-- (`FormalConflictRange.Counterexample.tr_notSound`) because the resolved end
|
||||
-- clamps below `end_.key`, but the canonical upper end `end_.key` is correct. A
|
||||
-- successor `[begin.key, keyAfter (last reported))` is *unsound* there: a
|
||||
-- compatible database with a nonpositive end offset realises the failure,
|
||||
-- because the resolved end clamps below `end_.key`, but the canonical upper
|
||||
-- end `end_.key` is correct. A
|
||||
-- truncated *reversed* result has the reversed truncated range
|
||||
-- `[last reported, end_.key)` (`minimal_truncatedRangeRev_of_end_offset_nonpos`):
|
||||
-- the top `(1 - end_.offset)` canonical keys are dropped, but filtering at or
|
||||
@@ -544,10 +553,11 @@ def conflictRangePartial (r : RangeRead) (res : Result) : Option ConflictRange :
|
||||
-- (`getRangeFinished`, `NativeAPI.actor.cpp:4770-4785`). Left uncertified:
|
||||
-- an `end_.offset ≥ 2` can run past the data even when a reported key lies at
|
||||
-- or above `end_.key`, so the end anchor is not always observable and the
|
||||
-- candidate need not be sound. The cell has no single shape: the `cwMin` value
|
||||
-- (bare successor of the greatest reported key) is minimal at `end.offset = 2`
|
||||
-- but fails for larger slack, where the window runs past the reported last
|
||||
-- (`FormalConflictRange.Counterexample.ns_cand_notSound`, true value the top).
|
||||
-- candidate need not be sound. The cell has no single shape: the
|
||||
-- bare-successor value (of the greatest reported key) is minimal at
|
||||
-- `end.offset = 2`
|
||||
-- but fails for larger slack, where the window runs past the reported last (a
|
||||
-- compatible witness realises this; the true value is the top).
|
||||
none /- end offset at least two but not overshooting: no certificate -/
|
||||
else if _h : 1 ≤ r.begin.offset then
|
||||
-- A nonempty result at `begin.offset ≥ 1` (here `begin.offset ≠ 1`, so at least two)
|
||||
@@ -592,9 +602,10 @@ def conflictRangePartial (r : RangeRead) (res : Result) : Option ConflictRange :
|
||||
some (truncatedRange r (res.keys.getLastD ([] : Key)))
|
||||
else
|
||||
-- Truncated *reversed* at `begin.offset ≠ 1`, `end_.offset ≥ 2`, overshooting: the
|
||||
-- reversed value `topOfLast` is unsound here (`Counterexample.ev_topOfLast_notSound`),
|
||||
-- because the begin selector skips keys below the reported last that the candidate
|
||||
-- cannot see. The minimal value is instead the unbounded top from `begin.key`,
|
||||
-- reversed value `topOfLast` is unsound here (a compatible witness realises
|
||||
-- this), because the begin selector skips keys below the reported last that
|
||||
-- the candidate cannot see. The minimal value is instead the unbounded top
|
||||
-- from `begin.key`,
|
||||
-- `[begin.key, ⊤)` (`minimal_topRange_of_end_offset_ge_two_rev_more`): the begin
|
||||
-- key is necessary, and convexity through the reported keys with
|
||||
-- `necessary_of_end_offset_ge_two_rev` above the head forces the whole interval.
|
||||
@@ -706,7 +717,7 @@ least. The two `rangeBegin`/`rangeEnd` clamp steps mirror the
|
||||
`NativeAPI.actor.cpp:4739-4794`), parameterized by the `readToBegin` and
|
||||
`readThroughEnd` flags. A `true` flag replaces the corresponding endpoint by
|
||||
`⊥`/`⊤`. This records FoundationDB's choice; the formal development does not
|
||||
assert it minimal on the open branches (see the section note above), except for
|
||||
assert it minimal on the uncertified branches (see the module docstring), except for
|
||||
`minimal_canonicalRange_of_underEnd_empty_conj` on the empty `underEnd` case. -/
|
||||
def fdbRange (r : RangeRead) (res : Result) (readToBegin readThroughEnd : Bool) :
|
||||
ConflictRange :=
|
||||
@@ -1129,8 +1140,8 @@ def BoundaryNecessity (r : RangeRead) (res : Result) : Prop :=
|
||||
|
||||
/-- **The bracket-observability residue.** Agreement on the complete value fixes the
|
||||
bracketing predicate, i.e. whether the resolved endpoints straddle the reported span.
|
||||
This is the notes' equation~(obs): the one bridge factor that the emptiness and interval
|
||||
equality factors do not imply. It is discharged by the empty theory's gap split at
|
||||
This is the bracket-observability equation: the one bridge factor that the emptiness
|
||||
and interval equality factors do not imply. It is discharged by the empty theory's gap split at
|
||||
positive offsets (the stored counts in `[begin.key, k₀)` and `[end.key, kₙ)`), which is
|
||||
why the pins `resolve begin = k₀` / `resolve end_ = keyAfter kₙ` do not by themselves
|
||||
remove it. -/
|
||||
@@ -1168,11 +1179,11 @@ merely open:
|
||||
nonempty key): there the hull need not be minimal;
|
||||
* the `begin.offset ≠ 1` cell at an overshooting-free end, where the resolved begin may
|
||||
clamp to `⊤` on one side of an agreement and to a stored key on the other, so the hull
|
||||
is *unsound* (`FormalConflictRange.Counterexample.cw_notSound`). That cell has no
|
||||
single minimal shape either: the `cwMin` value (the bare successor of the greatest
|
||||
is *unsound* (a compatible witness refutes it). That cell has no
|
||||
single minimal shape either: the bare-successor value (the successor of the greatest
|
||||
reported key) at `end.offset = 2` fails once the end selector's slack runs the window
|
||||
past the reported last, as `Counterexample.ns_cand_notSound` records, with every key
|
||||
necessary (`ns_top_minimal`) and the true value the unbounded top (`ns_top_sound`).
|
||||
past the reported last, as a compatible witness shows, with every key necessary and
|
||||
the true value the unbounded top.
|
||||
|
||||
`conflictRangePartial` returns `none` on both, so `completeValue` is a totalization
|
||||
whose hull fallback is not correct off the canonical and overshoot regions. -/
|
||||
@@ -1196,17 +1207,15 @@ result is dispatched on emptiness, truncation, and traversal:
|
||||
The low and high contributions are the empty boundary reads' minimal ranges, each the
|
||||
empty range when its read is trivially empty; the definition is computable.
|
||||
|
||||
**This is a provisional totalization, not the object of record.** The
|
||||
**This is a provisional totalization, not the headline algorithm.** The
|
||||
certified algorithm is `conflictRangePartial`; `conflictRangeVal` is the
|
||||
every-input `ConflictRange`-valued wrapper, and its branches off the certified
|
||||
region (the truncated dispatch and the `completeValue` hull fallback) are *not*
|
||||
sound in general — the kernel-checked `FormalConflictRange.Counterexample`
|
||||
(`cw_notSound`, and the truncated-branch violations) record this. Its correctness
|
||||
sound in general — explicit counterexamples in the complete hull and in the
|
||||
truncated branches record this. Its correctness
|
||||
theorems (`conflictRangeVal_spec`, `_spec_of_witness`, `_spec_complete`) are stated
|
||||
relative to the open `EmptyTheoryComplete` and are consequently vacuous, not the
|
||||
headline claim. Once `conflictRangePartial` is proved total it becomes the
|
||||
`ConflictRange`-valued algorithm and this definition is subsumed by it; the naming
|
||||
change is deferred until then. -/
|
||||
relative to the conditional `EmptyTheoryComplete` and are consequently vacuous, not
|
||||
the headline claim. The unconditional statement is proved in `Proof.lean`. -/
|
||||
def conflictRangeVal (r : RangeRead) (res : Result) : ConflictRange :=
|
||||
if res.keys = [] then
|
||||
emptyValue r
|
||||
@@ -1219,7 +1228,7 @@ def conflictRangeVal (r : RangeRead) (res : Result) : ConflictRange :=
|
||||
/-!
|
||||
## The complete branch: the assembled hull
|
||||
|
||||
The complete branch is the section-7 reduction: the hull of the two boundary reads'
|
||||
The complete branch is the reduction: the hull of the two boundary reads'
|
||||
minimal ranges and the reported interval, necessary on the two boundary ranges
|
||||
(`BoundaryNecessity`) and the derived interior, and sound from `EmptyInference` once the
|
||||
bracket residue is supplied. -/
|
||||
@@ -1711,9 +1720,9 @@ theorem minimal_completeRange_of_jointBasesEmptyRev {r : RangeRead} {res : Resul
|
||||
ranges of `BoundaryNecessity`, obtained from the empty theory's flip witnesses, in
|
||||
whichever traversal order the read uses. This is the exact input the complete branch
|
||||
extracts from the empty theory beyond `EmptyInference`; the extraction itself is the
|
||||
length-sensitive graft recorded in the notes. It is *false* — the endpoints are those of the
|
||||
length-sensitive graft described above. It is *false* — the endpoints are those of the
|
||||
(unsound) hull, and `BoundaryNecessity` on them can demand keys that no sound range need
|
||||
contain (`FormalConflictRange.Counterexample.cw_notBoundaryJointBases`). -/
|
||||
contain (a two-key witness refutes it). -/
|
||||
def BoundaryJointBases (r : RangeRead) (res : Result) : Prop :=
|
||||
if r.reverse then
|
||||
LowerJointBaseRangeRev r res.keys (completeRange r res).begin
|
||||
@@ -1760,7 +1769,7 @@ theorem minimal_completeRange_of_factors_joint_rev {r : RangeRead} {res : Result
|
||||
/-- **The complete branch, from `EmptyInferenceWitness` and the joint bases.** The
|
||||
witness-exposing oracle supplies soundness (`EmptyInference` via
|
||||
`emptyInference_of_witness`); the joint bases remain the one extraction hypothesis (false in
|
||||
general: `FormalConflictRange.Counterexample.cw_notBoundaryJointBases`). This
|
||||
general: a two-key witness refutes it). This
|
||||
is the sharpest form of the reduction available: the reported keys and their convex hull
|
||||
are derived, and the boundary necessity is stated at the witness level rather than as the
|
||||
finished `BoundaryNecessity`. -/
|
||||
@@ -2055,16 +2064,17 @@ The forward/reverse truncated values are the lower/upper boundary contribution's
|
||||
begin/end glued to the reported interval. The offset-one certificates above are the
|
||||
same statement via `emptyValue`; the general statement is the same reduction as the
|
||||
complete branch, with the far boundary read replaced by the reported interval. Those
|
||||
reductions are the remaining obligations of the truncated branches and are stated in
|
||||
the notes.
|
||||
reductions are the remaining obligations of the truncated branches and are stated
|
||||
separately.
|
||||
-/
|
||||
|
||||
/-!
|
||||
## The empty branch
|
||||
|
||||
The empty result is answered by `emptyValue`, reading off the empty theory's cases.
|
||||
The offset-one underEnd case is certified below; the remaining offsets are the open
|
||||
empty theory.
|
||||
The offset-one underEnd case is certified below; the remaining offsets are handled
|
||||
by the separate empty-theory development (`FormalConflictRange.Empty`,
|
||||
`FormalConflictRange.Nonpos`).
|
||||
-/
|
||||
|
||||
/-- **The empty branch, `begin.offset = 1`, `end.offset ≤ 1`.** A non-trivially-empty
|
||||
@@ -2103,7 +2113,7 @@ theorem minimal_emptyValue_underEnd (r : RangeRead) (hbegin : r.begin.offset = 1
|
||||
Traversal is invisible to the empty inference, and `emptyValue` never mentions
|
||||
`reverse`, so `EmptyInference` reduces to its non-reversed instance; and the
|
||||
`begin.offset = 1` instance splits by the end offset into the three empty cases already
|
||||
in the library. This pins the open empty-theory content to `begin.offset ≠ 1`.
|
||||
in the library. This pins the uncertified empty-theory content to `begin.offset ≠ 1`.
|
||||
-/
|
||||
|
||||
/-- `AlwaysEmpty` is invariant under flipping the traversal. -/
|
||||
@@ -2473,7 +2483,7 @@ theorem conflictRangeVal_spec_of_witness {r : RangeRead} {res : Result}
|
||||
exact minimal_completeRange_of_witness_joint_rev hempty ⟨db, hcomp⟩ hr hm hkeys hp hlim
|
||||
hc.joint hbr
|
||||
|
||||
/-- The existence conjecture follows from the witness-exposing empty oracle and the two
|
||||
/-- Existence follows from the witness-exposing empty oracle and the two
|
||||
nonempty obligations: the value witnesses a minimal sound range, with all offset handling
|
||||
confined to the empty theory. -/
|
||||
theorem conjecture_exists_minimal_conflict_range_of_witness {r : RangeRead} {res : Result}
|
||||
@@ -2524,7 +2534,7 @@ theorem conflictRangeVal_spec {r : RangeRead} {res : Result}
|
||||
exact minimal_completeRange_of_factors hempty hread (by simpa using hr) hm hkeys
|
||||
hψ hbr
|
||||
|
||||
/-- The existence conjecture follows from the empty inference, the boundary `ψ`, the
|
||||
/-- Existence follows from the empty inference, the boundary `ψ`, the
|
||||
bracket factor, and the truncated obligation: the value witnesses a minimal sound
|
||||
range. -/
|
||||
theorem conjecture_exists_minimal_conflict_range {r : RangeRead} {res : Result}
|
||||
@@ -2548,12 +2558,11 @@ empty theory's analysis at the boundary reads; none is an offset analysis of the
|
||||
read. With them the general case is the offset-free assembly.
|
||||
|
||||
`EmptyTheoryComplete` implies the abstract `EmptyInference` (`EmptyTheoryComplete.emptyInference`)
|
||||
and the conjecture (`exists_minimal_conflict_range_of_complete`). It is the exact form of
|
||||
"the empty theory is finished": there is nothing else to prove. In fact it is *refuted*:
|
||||
all three of `joint`, `bracket`, and `truncated` are false, independently
|
||||
(`FormalConflictRange.Counterexample.cw_emptyTheoryComplete_false`,
|
||||
`ce_emptyTheoryComplete_false`, `tr_emptyTheoryComplete_false`), so the structure is
|
||||
uninhabited and the reduction is not a route to the headline. -/
|
||||
and the existence statement (`exists_minimal_conflict_range_of_complete`). It is the exact
|
||||
form of "the empty theory is finished": there is nothing else to prove. In fact it is
|
||||
*refuted*: each of `joint`, `bracket`, and `truncated` has an explicit compatible
|
||||
counterexample, so the structure is uninhabited and the reduction is not a route to the
|
||||
headline. -/
|
||||
|
||||
/-- **A complete empty theory, in reduction form.** The empty-result theory together with
|
||||
the generic graft, the bracket gap split, and the truncated one-sided graft. Every field
|
||||
@@ -2616,7 +2625,7 @@ theorem conflictRangeVal_spec_complete (H : EmptyTheoryComplete) {r : RangeRead}
|
||||
conflictRangeVal_spec_of_witness H.witness (H.truncated r res hread)
|
||||
(H.completeObligation r res hread) hread
|
||||
|
||||
/-- **The existence conjecture from a complete empty theory.** -/
|
||||
/-- **Existence from a complete empty theory.** -/
|
||||
theorem exists_minimal_conflict_range_of_complete (H : EmptyTheoryComplete) {r : RangeRead}
|
||||
{res : Result} (hread : Readable r res) :
|
||||
∃ cr : ConflictRange, Minimal r res cr :=
|
||||
@@ -3102,8 +3111,7 @@ With `begin.offset ≤ 0`, `end.offset = 1` and `begin.key ≤ end.key`, `emptyV
|
||||
bottom range `[⊥, end.key)`, and every key below `end.key` has the singleton flip witness:
|
||||
the empty database is compatible (`compatible_emptyDB_emptyRes`) and toggling `k` gives
|
||||
`{k}`, whose complete keys are nonempty (`not_compatible_singleton_self`). This is the
|
||||
witness-exposing companion of `minimal_bottomRange_of_nonpos_end_one`, and it is the part
|
||||
of issue #19's item 1 that the single-key witness still separates. -/
|
||||
witness-exposing companion of `minimal_bottomRange_of_nonpos_end_one`. -/
|
||||
theorem emptyWitness_nonpos_end_one_crossFree (r : RangeRead) (hbegin : r.begin.offset ≤ 0)
|
||||
(hend : r.end_.offset = 1) (hle : r.begin.key ≤ r.end_.key)
|
||||
(_hread : Readable r { keys := [], more := false }) :
|
||||
@@ -4133,11 +4141,11 @@ range on every realizable read/result pair. This section makes the objective pre
|
||||
locates it relative to the existence headline. As a *function*, the objective is not
|
||||
stronger than the headline: given the headline, `Classical.choice` turns the pointwise
|
||||
existentials into a total `ConflictRange`-valued function, and `conflictRangeTotal` below
|
||||
refines the algorithm of record `conflictRangePartial` — it agrees with it on every
|
||||
refines the certified algorithm `conflictRangePartial` — it agrees with it on every
|
||||
certified `some` value, and on the uncertified `none` branches returns the chosen minimal
|
||||
range. What would be strictly stronger is a *computable* total algorithm, i.e. branch
|
||||
completeness of `conflictRangePartial`, which is blocked on exactly the regions where no
|
||||
offset-formula candidate exists (`cwMin` versus the unbounded top).
|
||||
offset-formula candidate exists (the bare successor versus the unbounded top).
|
||||
-/
|
||||
|
||||
/-- The desired outcome, as a proposition: a total `ConflictRange`-valued algorithm that
|
||||
@@ -4169,7 +4177,7 @@ theorem totalMinimalAlgorithm_iff :
|
||||
rw [dite_eq_left hh]
|
||||
exact Classical.choose_spec hh
|
||||
|
||||
/-- **A totalization of the algorithm of record.** Given the headline, `conflictRangePartial`
|
||||
/-- **A totalization of the certified algorithm.** Given the headline, `conflictRangePartial`
|
||||
extends to a total algorithm that is minimal on every realizable pair: it keeps the certified
|
||||
value where `conflictRangePartial` returns `some`, and on the uncertified `none` branches
|
||||
returns the (classically chosen) minimal range. Making it *computable* — filling the `none`
|
||||
@@ -4200,7 +4208,7 @@ theorem conflictRangeTotal_spec
|
||||
rw [dite_eq_left hh]
|
||||
exact Classical.choose_spec hh
|
||||
|
||||
/-- `conflictRangeTotal` agrees with the algorithm of record on every certified `some`
|
||||
/-- `conflictRangeTotal` agrees with the certified algorithm on every certified `some`
|
||||
value. -/
|
||||
theorem conflictRangeTotal_eq_partial
|
||||
(h : ∀ r res, Readable r res → ∃ cr : ConflictRange, Minimal r res cr)
|
||||
|
||||
Reference in new issue
Block a user