@lapxo/obligations 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +4 -0
- package/TARGET.bound +90 -10
- package/contracts/m0-allocation.json +6 -0
- package/contracts/m0-finite-grid.json +6 -0
- package/contracts/m0-limit-diag.json +6 -0
- package/contracts/m0-limit-offdiag.json +6 -0
- package/contracts/m0-pair-coincidence.json +6 -0
- package/dist/measures/cofailure-pairs.d.ts +113 -0
- package/dist/measures/cofailure-pairs.js +129 -0
- package/dist/measures/index.d.ts +4 -0
- package/dist/measures/index.js +2 -0
- package/dist/measures/marginal-information.d.ts +78 -0
- package/dist/measures/marginal-information.js +71 -0
- package/docs/contracts/m0-allocation.md +1 -0
- package/docs/contracts/m0-finite-grid.md +1 -0
- package/docs/contracts/m0-limit-diag.md +1 -0
- package/docs/contracts/m0-limit-offdiag.md +1 -0
- package/docs/contracts/m0-pair-coincidence.md +1 -0
- package/docs/measures.md +16 -0
- package/docs/paper.md +2 -2
- package/docs/proofs/floor-limit-diag.proof.json +29 -0
- package/docs/reference.md +6 -1
- package/package.json +1 -1
- package/proofs/cofailure-pairs.json +26 -0
- package/proofs/coordination.json +27 -0
- package/proofs/helly-comb.json +17 -0
- package/proofs/lean/Obligations/Cell.lean +159 -0
- package/proofs/lean/Obligations/HellyComb.lean +19 -0
- package/proofs/lineage-ceiling.json +41 -0
- package/proofs/m0-045/Obligations045/ConsensusGrid.lean +72 -0
- package/proofs/m0-045/Obligations045/M0Coincidence.lean +39 -0
- package/proofs/m0-045/Obligations045/M0Diagonal.lean +18 -0
- package/proofs/m0-045/Obligations045/M0Limit.lean +134 -0
- package/proofs/m0-045/Obligations045/M0Offdiag.lean +171 -0
- package/proofs/m0-045/Obligations045.lean +5 -0
- package/proofs/m0-045/lake-manifest.json +116 -0
- package/proofs/m0-045/lakefile.toml +9 -0
- package/proofs/m0-045/lean-toolchain +1 -0
- package/proofs/marginal-information.json +30 -0
- package/proofs/resolution-encounters.json +23 -0
- package/receipts.bound +613 -288
- package/samples/laws/cofailure-pairs/no/sample.json +1 -0
- package/samples/laws/cofailure-pairs/yes/sample.json +20 -0
- package/samples/laws/linage-rest/no/sample.json +19 -0
- package/samples/laws/linage-rest/yes/sample.json +100 -0
- package/samples/laws/lineage-ceiling/no/sample.json +8 -0
- package/samples/laws/lineage-ceiling/yes/sample.json +30 -0
- package/samples/laws/m0-allocation/no/sample.json +5 -0
- package/samples/laws/m0-allocation/yes/sample.json +7 -0
- package/samples/laws/m0-finite-grid/no/sample.json +5 -0
- package/samples/laws/m0-finite-grid/yes/sample.json +7 -0
- package/samples/laws/m0-limit-diag/no/sample.json +5 -0
- package/samples/laws/m0-limit-diag/yes/sample.json +7 -0
- package/samples/laws/m0-limit-offdiag/no/sample.json +5 -0
- package/samples/laws/m0-limit-offdiag/yes/sample.json +7 -0
- package/samples/laws/m0-pair-coincidence/no/sample.json +5 -0
- package/samples/laws/m0-pair-coincidence/yes/sample.json +7 -0
- package/samples/laws/marginal-information/no/sample.json +17 -0
- package/samples/laws/marginal-information/yes/sample.json +459 -0
- package/samples/laws/semilattice/no/sample.json +18 -0
- package/samples/laws/semilattice/yes/sample.json +29 -0
- package/samples/no/H1-uncertainty.json +24 -0
- package/samples/no/installed-artifact.json +24 -26
- package/samples/yes/H1-uncertainty.json +25 -0
- package/samples/yes/installed-artifact.json +23 -25
- package/vectors/laws/cofailure-pairs.json +2580 -0
- package/vectors/laws/cofailure-pairs.native.json +267 -0
- package/vectors/laws/coordination.json +386 -0
- package/vectors/laws/f1/finite-arithmetic.json +66 -0
- package/vectors/laws/f1/path-witness.json +242 -0
- package/vectors/laws/helly-comb.json +95 -0
- package/vectors/laws/helly-comb.lean.json +94 -0
- package/vectors/laws/linage-rest.native.json +335 -0
- package/vectors/laws/lineage-ceiling.json +790 -0
- package/vectors/laws/lineage-ceiling.native.json +291 -0
- package/vectors/laws/m0-allocation.lean.json +150 -0
- package/vectors/laws/m0-allocation.native.json +104 -0
- package/vectors/laws/m0-finite-grid.lean.json +144 -0
- package/vectors/laws/m0-finite-grid.native.json +104 -0
- package/vectors/laws/m0-limit-diag.lean.json +141 -0
- package/vectors/laws/m0-limit-diag.native.json +108 -0
- package/vectors/laws/m0-limit-offdiag.lean.json +143 -0
- package/vectors/laws/m0-limit-offdiag.native.json +104 -0
- package/vectors/laws/m0-pair-coincidence.lean.json +139 -0
- package/vectors/laws/m0-pair-coincidence.native.json +104 -0
- package/vectors/laws/marginal-information.json +868 -0
- package/vectors/laws/marginal-information.native.json +259 -0
- package/vectors/laws/meet-semilattice.json +244 -0
- package/vectors/laws/meet-semilattice.native.json +265 -0
- package/vectors/laws/resolution-encounters.json +171 -0
- package/vectors/measures/installed-artifact.cli.json +8 -12
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id":"cofailure-pairs/two-declared-observables",
|
|
3
|
+
"classification":"two descriptive measures with declared models; finite counterexamples, not a law identifying causes",
|
|
4
|
+
"oracle":{"score":"number of complete cells with Y_i=Y_j!=truth divided by declared T","reference":"Published coincidenceExcess supplies this pair rate and its independent-uniform-wrong baseline, with handed or truth-estimated error marginals. The graph uses the raw false rate, not the excess.","thetaUnit":"false-coincidence probability"},
|
|
5
|
+
"withoutTruth":{"score":"number of complete cells with Y_i=Y_j divided by T, minus sum_v q_i(v)*q_j(v)","reference":"independent-categorical@1 with fixed, normalized, handed per-origin categorical marginals over the named alphabet. No truth or estimated error marginal is read.","thetaUnit":"excess probability, in [-1,1]","absentReference":"unmeasured; never silently estimate a null from this batch","Head":"This is the candidate observable available without truth; no Head or Bound change is made, and no causal interpretation is supplied."},
|
|
6
|
+
"existingBoundary":"The published coincidenceExcess itself requires truth. Its no-truth reading stays unmeasured. This candidate is a different observable, not a relabel of that API.",
|
|
7
|
+
"frame":"T and theta are explicit and mandatory: absence is unmeasured. T counts distinct complete selected events. Missing cells are unmeasured; identical redelivery is idempotent; conflicting event/origin values refuse by name. Budget is checked before indexing rows.",
|
|
8
|
+
"graph":"An edge is score>theta. Connected components are a descriptive projection; a path of above-threshold edges does not establish a common cause or a clique.",
|
|
9
|
+
"populationRecovery":"For a handed target partition, require max score_outside < theta < min score_inside over every pair. A threshold between the two means is insufficient. The partition itself and population scores are not inferred by this rule.",
|
|
10
|
+
"finiteUncertainty":{
|
|
11
|
+
"sampling":"Optional iid-cells@1, with epsilon in (0,1], fixed frame, selected origins, epsilon and (for the non-oracle observable) null marginals fixed before observing the batch. The caller supplies these premises; the instrument does not verify them.",
|
|
12
|
+
"chain":["For each pair's Bernoulli event, Var(mean)<=1/(4T) under the declared independent cells.","Chebyshev gives P(|observed-population|>=epsilon)<=min(1,1/(4*T*epsilon^2)). Subtracting a fixed handed baseline preserves the deviation.","The existing unionBoundConfidence combines these failures for all M=m(m-1)/2 pairs; no independence between pairs is required.","Exact rational intervals score+-epsilon are clipped to their probability support. Resolve an edge only if the whole interval is strictly above or below theta. Unresolved intervals and trivial bounds stay visible.","This bounds simultaneous threshold decisions under the handed model. Causal recovery requires the separate population partition and strict gap premises."],
|
|
13
|
+
"arithmetic":"rational, no logarithmic or directed-rounding approximation; conservative Chebyshev bound, not an optimal interval",
|
|
14
|
+
"reference":"https://theory.stanford.edu/~blynn/pr/markov.html"
|
|
15
|
+
},
|
|
16
|
+
"counterexamples":[
|
|
17
|
+
{"id":"truth-relabel","claimRefuted":"the no-truth statistic identifies which coincidences are wrong","witness":"Identical response rows, truth all zero versus truth copied from a: observational output is unchanged but oracle edges differ."},
|
|
18
|
+
{"id":"shared-question","claimRefuted":"positive categorical excess proves shared error lineage","witness":"All sources answer a balanced binary question correctly. Oracle false rate is zero; a handed marginal 1/2 reference gives observed agreement 1 and excess 1/2. Conditional errors are degenerate zero, while the shared question drives unconditional agreement."},
|
|
19
|
+
{"id":"between-means","claimRefuted":"threshold between mean within and outside rates suffices","witness":"Within rates 0.8 and 0.2; outside 0.21,0.21,0,0. Theta=0.15 lies between means 0.5 and 0.105 but merges the handed groups; max outside exceeds min inside."},
|
|
20
|
+
{"id":"c-e-finite-confusion","claimRefuted":"finite exact subgroup recovery whenever shared c is comparable to private e","witness":"With c=e=1/4, the all-correct T=4 batch has probability [(3/4)^5]^4>0; it has no above-threshold oracle edges. Its confidence bound is trivial, not a certificate of no common factor."}
|
|
21
|
+
],
|
|
22
|
+
"alreadyKnown":"Cooccurrence relative to a declared null, Chebyshev concentration and union bounds are standard. The published package already has truth-conditioned coincidenceExcess and exact unionBoundConfidence.",
|
|
23
|
+
"addsHere":"The oracle-free observable and its explicit null, pair graph with threshold units, and model-separating fixtures. No c is identified, no M/3-M/4 hypothesis changes, and no algebraic act or wire field is introduced.",
|
|
24
|
+
"publication":"new candidate module only; existing signed public exports, TARGET, receipts and derived docs remain unchanged",
|
|
25
|
+
"open":["Choice of an adequate observable-context reference for Head; this marginal null can be confounded by shared questions.","No causal subgroup identification from these statistics alone.","No iid certificate, population-margin estimate, or guarantee without the declared sampling premises."]
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "coordination@1",
|
|
3
|
+
"policy": "vectors/laws/policy.json",
|
|
4
|
+
"classification": "measure with declared conditional model and exact finite enumeration",
|
|
5
|
+
"statement": "For all L selected sources under a shared activation of probability f, active outputs equal one named wrong value. Otherwise source errors are jointly independent conditional on truth with rate e, uniform among n-1 wrong labels. Then U_L=f+(1-f)*((1-e)^L+e^L/(n-1)^(L-1)), and wrong unanimity W_L=f+(1-f)*e^L/(n-1)^(L-1).",
|
|
6
|
+
"hypotheses": [
|
|
7
|
+
"n>=2, L>=1, declared f and e, fixed truth for wrong-label enumeration; symmetry permits uniform truth extension.",
|
|
8
|
+
"Activation affects every selected source, no other unmodeled activation or observation channel.",
|
|
9
|
+
"Joint conditional independence is a model declaration for inactive draws, not inferred from pairwise statistics.",
|
|
10
|
+
"If n>2 and 0<e<=1, or n=2 and 0<e<1, both private unanimity terms tend to zero, giving limit f; finite values generally exceed f."
|
|
11
|
+
],
|
|
12
|
+
"existing": "U_L is exactly the published fitUnanimityModel single-dominant-factor curve, not a new algebraic law or identification method.",
|
|
13
|
+
"adds": "Explicit equivalence of scheduled coordinated outputs and a shared-cause output distribution under this specified mixture, exact small-L enumeration, wrong-unanimity distinction and named invalid readings.",
|
|
14
|
+
"nonIdentification": "The activation schedule is itself a common variable in the joint distribution. No inference about a shared physical process, intent or causal origin follows from the same curve; c_total is a compatible model parameter, not model-free truth.",
|
|
15
|
+
"negative": [
|
|
16
|
+
"At e=0 all outputs are unanimously correct when inactive: U_L=1 for every L, so U does not identify f. W_L still equals f.",
|
|
17
|
+
"Two disjoint groups independently activated at rate f/2 do not obey the all-source single-activation curve with mass f.",
|
|
18
|
+
"Marginal error rate e without joint conditional independence does not determine private unanimity; n=2, e=1/2, identical private errors give U=1 while iid predicts 2^(1-L)."
|
|
19
|
+
],
|
|
20
|
+
"status": "declared-model measure; finite vectors, no causal identification",
|
|
21
|
+
"unmeasured": "Missing joint-independence declaration refuses curve interpretation by name; unknown mechanism remains unmeasured.",
|
|
22
|
+
"references": [
|
|
23
|
+
"https://www.stat.berkeley.edu/~aldous/206-Exch/"
|
|
24
|
+
],
|
|
25
|
+
"signatures": 0,
|
|
26
|
+
"admission": false
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "helly-comb@1",
|
|
3
|
+
"policy": "vectors/laws/policy.json",
|
|
4
|
+
"classification": "law by finite counterexample, Lean kernel checked",
|
|
5
|
+
"statement": "Pairwise intersection does not imply joint intersection for arbitrary finite nonconvex subsets (combs).",
|
|
6
|
+
"domain": "Finite carrier {0,1,2}; A={0,1}, B={1,2}, C={0,2}. Witnesses AB=1, AC=0, BC=2; ABC empty.",
|
|
7
|
+
"hypotheses": "No convexity/interval assumption. C has a hole. Does not refute the interval-only T38.",
|
|
8
|
+
"negative": "Reject promoting pairwise compatibility of these combs to a global witness.",
|
|
9
|
+
"existing": "Classical Helly theory needs convexity; finite intervals on a line are 2-Helly. The elementary nonconvex counterexample is not a new discovery.",
|
|
10
|
+
"adds": "Exact finite subset witness and compiled Lean certificate tied to Obligations candidate bytes; no new form or wire encoding.",
|
|
11
|
+
"references": [
|
|
12
|
+
"https://www.math.ucdavis.edu/~deloera/TEACHING/MATH114/convexitythy.pdf"
|
|
13
|
+
],
|
|
14
|
+
"status": "finite witness checked; no generalized theorem",
|
|
15
|
+
"signatures": 0,
|
|
16
|
+
"admission": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import Mathlib.Order.Interval.Set.Basic
|
|
2
|
+
|
|
3
|
+
/-!
|
|
4
|
+
The endpoint operation of `src/lattice/forms.ts`, not a replacement algebra.
|
|
5
|
+
`apiLeq` preserves its empty-interval convention. It is a preorder on raw
|
|
6
|
+
endpoint pairs, not an antisymmetric order. The observable semilattice below
|
|
7
|
+
identifies exactly equal interval meanings; no TypeScript representation changes.
|
|
8
|
+
|
|
9
|
+
The numerical bridge is restricted to values with a total order (in the executable
|
|
10
|
+
vector: finite integers). This does not assert a LinearOrder on IEEE-754 NaN.
|
|
11
|
+
-/
|
|
12
|
+
namespace Obligations
|
|
13
|
+
|
|
14
|
+
structure Cell (α : Type*) where
|
|
15
|
+
lo : α
|
|
16
|
+
hi : α
|
|
17
|
+
deriving DecidableEq
|
|
18
|
+
|
|
19
|
+
namespace Cell
|
|
20
|
+
variable {α : Type*} [LinearOrder α]
|
|
21
|
+
|
|
22
|
+
def meet (a b : Cell α) : Cell α := ⟨max a.lo b.lo, min a.hi b.hi⟩
|
|
23
|
+
|
|
24
|
+
theorem meet_comm (a b : Cell α) : meet a b = meet b a := by
|
|
25
|
+
cases a; cases b
|
|
26
|
+
simp [meet, max_comm, min_comm]
|
|
27
|
+
|
|
28
|
+
theorem meet_assoc (a b c : Cell α) : meet (meet a b) c = meet a (meet b c) := by
|
|
29
|
+
cases a; cases b; cases c
|
|
30
|
+
simp [meet, max_assoc, min_assoc]
|
|
31
|
+
|
|
32
|
+
theorem meet_idem (a : Cell α) : meet a a = a := by
|
|
33
|
+
cases a
|
|
34
|
+
simp [meet]
|
|
35
|
+
|
|
36
|
+
instance : Min (Cell α) := ⟨meet⟩
|
|
37
|
+
|
|
38
|
+
/-- Its induced endpoint order is not the API's empty-interval preorder. -/
|
|
39
|
+
def endpointSemilattice : SemilatticeInf (Cell α) :=
|
|
40
|
+
SemilatticeInf.mk' meet_comm meet_assoc meet_idem
|
|
41
|
+
|
|
42
|
+
/-- Literal branch order of the existing interval `leq`. -/
|
|
43
|
+
def apiLeq (a b : Cell α) : Prop :=
|
|
44
|
+
if a.hi < a.lo then True
|
|
45
|
+
else if b.hi < b.lo then False
|
|
46
|
+
else b.lo ≤ a.lo ∧ a.hi ≤ b.hi
|
|
47
|
+
|
|
48
|
+
instance (a b : Cell α) : Decidable (apiLeq a b) := by
|
|
49
|
+
unfold apiLeq
|
|
50
|
+
infer_instance
|
|
51
|
+
|
|
52
|
+
def meaning (a : Cell α) : Set α := Set.Icc a.lo a.hi
|
|
53
|
+
|
|
54
|
+
theorem meaning_meet (a b : Cell α) :
|
|
55
|
+
meaning (meet a b) = meaning a ∩ meaning b := by
|
|
56
|
+
apply Set.ext
|
|
57
|
+
intro x
|
|
58
|
+
simp only [meaning, meet, Set.mem_Icc, Set.mem_inter_iff]
|
|
59
|
+
constructor
|
|
60
|
+
· intro h
|
|
61
|
+
exact ⟨⟨le_trans (le_max_left _ _) h.1, le_trans h.2 (min_le_left _ _)⟩,
|
|
62
|
+
⟨le_trans (le_max_right _ _) h.1, le_trans h.2 (min_le_right _ _)⟩⟩
|
|
63
|
+
· intro h
|
|
64
|
+
exact ⟨max_le h.1.1 h.2.1, le_min h.1.2 h.2.2⟩
|
|
65
|
+
|
|
66
|
+
theorem apiLeq_iff_subset (a b : Cell α) :
|
|
67
|
+
apiLeq a b ↔ meaning a ⊆ meaning b := by
|
|
68
|
+
by_cases ha : a.hi < a.lo
|
|
69
|
+
· simp [apiLeq, ha, meaning, Set.Icc_eq_empty_of_lt ha]
|
|
70
|
+
· have hab : a.lo ≤ a.hi := le_of_not_gt ha
|
|
71
|
+
by_cases hb : b.hi < b.lo
|
|
72
|
+
· simp only [apiLeq, ha, hb, if_false, if_true]
|
|
73
|
+
constructor
|
|
74
|
+
· intro h; exact False.elim h
|
|
75
|
+
· intro h
|
|
76
|
+
have hx := h (show a.lo ∈ meaning a from ⟨le_rfl, hab⟩)
|
|
77
|
+
exact (not_le_of_gt hb) (le_trans hx.1 hx.2)
|
|
78
|
+
· simpa [apiLeq, ha, hb, meaning] using
|
|
79
|
+
(Set.Icc_subset_Icc_iff hab).symm
|
|
80
|
+
|
|
81
|
+
theorem meet_narrows_left (a b : Cell α) : apiLeq (meet a b) a := by
|
|
82
|
+
rw [apiLeq_iff_subset, meaning_meet]
|
|
83
|
+
exact Set.inter_subset_left
|
|
84
|
+
|
|
85
|
+
theorem meet_narrows_right (a b : Cell α) : apiLeq (meet a b) b := by
|
|
86
|
+
rw [apiLeq_iff_subset, meaning_meet]
|
|
87
|
+
exact Set.inter_subset_right
|
|
88
|
+
|
|
89
|
+
theorem apiLeq_refl (a : Cell α) : apiLeq a a :=
|
|
90
|
+
(apiLeq_iff_subset a a).mpr (Set.Subset.refl _)
|
|
91
|
+
|
|
92
|
+
theorem apiLeq_trans {a b c : Cell α} (hab : apiLeq a b) (hbc : apiLeq b c) :
|
|
93
|
+
apiLeq a c :=
|
|
94
|
+
(apiLeq_iff_subset a c).mpr
|
|
95
|
+
(Set.Subset.trans ((apiLeq_iff_subset a b).mp hab) ((apiLeq_iff_subset b c).mp hbc))
|
|
96
|
+
|
|
97
|
+
theorem mutually_narrows_iff (a b : Cell α) :
|
|
98
|
+
(apiLeq a b ∧ apiLeq b a) ↔ meaning a = meaning b := by
|
|
99
|
+
rw [apiLeq_iff_subset, apiLeq_iff_subset]
|
|
100
|
+
exact ⟨fun h => Set.Subset.antisymm h.1 h.2, fun h => ⟨h.subset, h.symm.subset⟩⟩
|
|
101
|
+
|
|
102
|
+
/-- Observable interval classes, represented by their meaning, not new stored cells. -/
|
|
103
|
+
def SemanticCell (α : Type*) [LinearOrder α] :=
|
|
104
|
+
{s : Set α // ∃ c : Cell α, meaning c = s}
|
|
105
|
+
|
|
106
|
+
instance : Min (SemanticCell α) where
|
|
107
|
+
min a b := ⟨a.val ∩ b.val, by
|
|
108
|
+
rcases a.property with ⟨ca, hca⟩
|
|
109
|
+
rcases b.property with ⟨cb, hcb⟩
|
|
110
|
+
exact ⟨meet ca cb, by rw [meaning_meet, hca, hcb]⟩⟩
|
|
111
|
+
|
|
112
|
+
instance : SemilatticeInf (SemanticCell α) :=
|
|
113
|
+
Function.Injective.semilatticeInf Subtype.val Subtype.val_injective (fun _ _ => rfl)
|
|
114
|
+
|
|
115
|
+
def observe (a : Cell α) : SemanticCell α := ⟨meaning a, a, rfl⟩
|
|
116
|
+
|
|
117
|
+
theorem observe_meet (a b : Cell α) :
|
|
118
|
+
observe (meet a b) = observe a ⊓ observe b :=
|
|
119
|
+
Subtype.ext (meaning_meet a b)
|
|
120
|
+
|
|
121
|
+
theorem observe_order (a b : Cell α) : observe a ≤ observe b ↔ apiLeq a b :=
|
|
122
|
+
(apiLeq_iff_subset a b).symm
|
|
123
|
+
|
|
124
|
+
/-- Distinct raw empty intervals are equivalent in the published API. -/
|
|
125
|
+
theorem crossed_pairs_not_antisymmetric :
|
|
126
|
+
let a : Cell Int := ⟨5, 3⟩
|
|
127
|
+
let b : Cell Int := ⟨8, 6⟩
|
|
128
|
+
apiLeq a b ∧ apiLeq b a ∧ a ≠ b := by decide
|
|
129
|
+
|
|
130
|
+
/-- A duplicate accumulated restriction does not change a merge result. -/
|
|
131
|
+
theorem duplicate_delivery (a b : Cell α) : meet (meet a b) b = meet a b := by
|
|
132
|
+
rw [meet_assoc, meet_idem]
|
|
133
|
+
|
|
134
|
+
/-- Replay order of three accumulated restrictions does not change the result. -/
|
|
135
|
+
theorem reordered_delivery (a b c : Cell α) :
|
|
136
|
+
meet (meet a b) c = meet (meet c a) b := by
|
|
137
|
+
rw [meet_assoc, meet_comm b c, ← meet_assoc, meet_comm a c]
|
|
138
|
+
|
|
139
|
+
def fold (seed : Cell α) (claims : List (Cell α)) : Cell α :=
|
|
140
|
+
claims.foldl meet seed
|
|
141
|
+
|
|
142
|
+
/-- Any finite replay permutation agrees, under the same starting restriction. -/
|
|
143
|
+
theorem permutation_invariant {xs ys : List (Cell α)} (h : xs.Perm ys)
|
|
144
|
+
(seed : Cell α) : fold seed xs = fold seed ys := by
|
|
145
|
+
induction h generalizing seed with
|
|
146
|
+
| nil => rfl
|
|
147
|
+
| cons a h ih => exact ih (meet seed a)
|
|
148
|
+
| swap a b xs =>
|
|
149
|
+
have hc : meet (meet seed b) a = meet (meet seed a) b := by
|
|
150
|
+
rw [meet_assoc, meet_comm b a, ← meet_assoc]
|
|
151
|
+
simp only [fold, List.foldl_cons, hc]
|
|
152
|
+
| trans h₁ h₂ ih₁ ih₂ => exact (ih₁ seed).trans (ih₂ seed)
|
|
153
|
+
|
|
154
|
+
theorem duplicate_in_replay (seed a : Cell α) (xs : List (Cell α)) :
|
|
155
|
+
fold seed (a :: a :: xs) = fold seed (a :: xs) := by
|
|
156
|
+
simp only [fold, List.foldl_cons, duplicate_delivery]
|
|
157
|
+
|
|
158
|
+
end Cell
|
|
159
|
+
end Obligations
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/- Finite nonconvex subsets, using only Lean's kernel and core lists.
|
|
2
|
+
No change to the interval theorem T38 or to the algebra's representation. -/
|
|
3
|
+
namespace Obligations.HellyComb
|
|
4
|
+
|
|
5
|
+
def a : List Nat := [0, 1]
|
|
6
|
+
def b : List Nat := [1, 2]
|
|
7
|
+
def c : List Nat := [0, 2]
|
|
8
|
+
def inter (s t : List Nat) : List Nat := s.filter (fun x => t.contains x)
|
|
9
|
+
def triple : List Nat := inter (inter a b) c
|
|
10
|
+
|
|
11
|
+
theorem pairwise_nonempty :
|
|
12
|
+
inter a b = [1] ∧ inter a c = [0] ∧ inter b c = [2] := by decide
|
|
13
|
+
|
|
14
|
+
theorem triple_empty : triple = [] := by decide
|
|
15
|
+
|
|
16
|
+
theorem c_has_a_hole : c.contains 0 = true ∧ c.contains 2 = true ∧
|
|
17
|
+
c.contains 1 = false := by decide
|
|
18
|
+
|
|
19
|
+
end Obligations.HellyComb
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id":"lineage/symmetric-markov-ceiling",
|
|
3
|
+
"classification":"conditional law with distinguishing finite vectors; Shannon argument cited, not Lean-formalized",
|
|
4
|
+
"source":"samples/laws/lineage-ceiling/yes.json",
|
|
5
|
+
"statement":"For finite n>=2, uniform truth X, an n-ary symmetric channel X->Z with error c in [0,1], and X->Z->Y^K->A, I(X;A)<=I(X;Z)=log2(n)-h2(c)-c*log2(n-1).",
|
|
6
|
+
"conditions":[
|
|
7
|
+
"The reports have a joint kernel conditional on Z alone; pairwise conditional independence is neither required for this bound nor a substitute for the Markov condition.",
|
|
8
|
+
"Aggregation uses reports alone, or randomness conditionally independent of X given the reports. A revealed channel-error/cause indicator, side channel or truth probe is extra input and must be included before applying DPI.",
|
|
9
|
+
"c is the declared crossover probability of this symmetric channel; neither unanimity nor a shared-cause frequency identifies it without a model.",
|
|
10
|
+
"No private p, hypothesis of M/3, or governance model M/4 is changed. The old always-wrong active cause with private p>0 is a different joint law.",
|
|
11
|
+
"Both c=0 and c=1 are permitted. c=(n-1)/n gives zero information; for binary c=1 the channel is an invertible complement and gives one bit. This quantity is not monotone over all c in [0,1]."
|
|
12
|
+
],
|
|
13
|
+
"proofChain":[
|
|
14
|
+
{"id":"symmetric-output","argument":"Uniform X and the symmetric kernel imply uniform Z. The posterior of X given Z has masses 1-c and c/(n-1) on the other symbols, so H(X|Z)=h2(c)+c*log2(n-1), with 0 log 0=0."},
|
|
15
|
+
{"id":"data-processing","argument":"The declared Markov kernels imply I(X;Y^K|Z)=0 and I(X;A|Y^K)=0. The chain rule and nonnegative conditional mutual information give I(X;A)<=I(X;Y^K)<=I(X;Z). No independence among reports given Z is needed for this inequality.","reference":"Duchi, Proposition 2.1.9"},
|
|
16
|
+
{"id":"existing-instance","argument":"Published capacityP0 computes this expression as mutual information for single-dominant-factor@1 at private p=0, for every positive K. In that instance all reports are copies of Z, so equality is already exact; a finite-copy vector is not a new discovery."},
|
|
17
|
+
{"id":"finite-approach","classification":"experiment with declared conditional-iid model","argument":"Compose the symmetric lineage channel with the published decisionInformation table for c=0, p=e and plurality-uniform-ties@1. Exact rational joint tables give a finite sequence of gaps to capacityP0. Under the separately declared fixed-parameter iid recovery hypothesis, consistency and finite-alphabet entropy continuity imply the limit; the finite sequence does not prove the limit."}
|
|
18
|
+
],
|
|
19
|
+
"fanoBoundary":{
|
|
20
|
+
"known":"Fano gives H(X|Z)<=h2(P[X!=Z])+P[X!=Z]*log2(n-1). For uniform X this is a lower bound on I(X;Z), not the proposed upper bound.",
|
|
21
|
+
"equalityCondition":"The symmetric channel supplies equality in the entropy expression. A marginal error probability alone does not.",
|
|
22
|
+
"negative":"A binary uniform source with P(Z=1|X=0)=0 and P(Z=0|X=1)=1/2 has error 1/4 and I=0.311278124459..., larger than 1-h2(1/4)=0.188721875540...."
|
|
23
|
+
},
|
|
24
|
+
"relationToF1":{
|
|
25
|
+
"existingLaw":"law/thm-extremal",
|
|
26
|
+
"existingVectors":["vectors/laws/f1/path-witness.json","vectors/laws/f1/finite-arithmetic.json"],
|
|
27
|
+
"object":"F1 concerns deterministic partitions U,V of one uniformly weighted N-element universe, in the maintained refinement order.",
|
|
28
|
+
"quantity":"RI_H=H(U)+H(V)-H(join)-H(meet)=I(U;V)-H(G)=I(U;V|G), where join is the common refinement (U,V) and G is their common coarsening, a deterministic function of each.",
|
|
29
|
+
"bound":"RI_H<=log2(N)-2+2/N; N=1,2 have zero maximum. This is not I(truth;aggregate); N need not equal the truth alphabet n.",
|
|
30
|
+
"jointUse":"Apply F1 only when the partition/uniform-universe hypotheses hold. Apply the lineage ceiling only to a designated X and its declared Markov channel. If both models are supplied, both bounds may be written beside their own quantities; taking their minimum as a bound on either quantity is invalid.",
|
|
31
|
+
"separators":[
|
|
32
|
+
"Uniform binary truth with noiseless Z has I(X;Z)=1 while F1 on N=2 has maximum RI_H=0.",
|
|
33
|
+
"Let X,Z be independent uniform bits (c=1/2), and R independent uniform on four symbols. The path partitions of R have RI_H=1/2. Reports can ignore Z and output those two views of R, so X->Z->reports holds and I(X;reports)=0. On the full uniform 16-atom (X,Z,R) universe F1 still applies (c_16=2.125), but RI_H=1/2 exceeds the zero lineage ceiling."
|
|
34
|
+
],
|
|
35
|
+
"notAdded":"No proof of F1 is redone; its existing path witness and public c_n are reused."
|
|
36
|
+
},
|
|
37
|
+
"literature":[
|
|
38
|
+
{"title":"Lecture Notes on Statistics and Information Theory","author":"John Duchi","url":"https://web.stanford.edu/class/stats311/lecture-notes.pdf","sections":["2.1.3, Proposition 2.1.9: data processing","Proposition 2.3.3: Fano"],"alreadyKnown":"DPI and Fano, including the direction of the inequalities.","addsHere":"Explicit lineage-channel conditions, reuse of the already published expression, and vectors separating truth information from partition residual. No new information-theory inequality or inference without truth is claimed."}
|
|
39
|
+
],
|
|
40
|
+
"evidenceLimits":["No general Lean proof of Shannon DPI here.","Finite vectors do not enumerate arbitrary observation kernels.","No original browser simulation is recovered or authenticated.","Activation identification, sleeper bounds and all other excluded regions remain open."]
|
|
41
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import Std
|
|
2
|
+
set_option maxRecDepth 10000
|
|
3
|
+
set_option maxHeartbeats 8000000
|
|
4
|
+
namespace Obligations045
|
|
5
|
+
-- Finite closed-form calculation only. This file does not assert a limit theorem.
|
|
6
|
+
def binom : Nat → Nat → Nat
|
|
7
|
+
| 0, 0 => 1
|
|
8
|
+
| 0, _ + 1 => 0
|
|
9
|
+
| _ + 1, 0 => 1
|
|
10
|
+
| n + 1, k + 1 => binom n k + binom n (k + 1)
|
|
11
|
+
def configs : Nat → List (List Bool)
|
|
12
|
+
| 0 => [[]]
|
|
13
|
+
| k + 1 => (configs k).flatMap (fun xs => [false :: xs, true :: xs])
|
|
14
|
+
def ones (xs : List Bool) : Nat := (xs.filter id).length
|
|
15
|
+
-- p=P/20, c=C/20. Below/equal/above 1/2 encoded as 2/1/0.
|
|
16
|
+
def loss2 (K P C m : Nat) : Nat :=
|
|
17
|
+
let lhs := 2 * (20 * C * m + (20-C) * P * K)
|
|
18
|
+
let rhs := 400 * K
|
|
19
|
+
if lhs < rhs then 2 else if lhs == rhs then 1 else 0
|
|
20
|
+
def grouped (K P C : Nat) : Nat :=
|
|
21
|
+
((List.range (K+1)).map (fun m =>
|
|
22
|
+
binom K m * P^m * (20-P)^(K-m) * loss2 K P C m)).sum
|
|
23
|
+
def enumerated (K P C : Nat) : Nat :=
|
|
24
|
+
((configs K).map (fun xs =>
|
|
25
|
+
P^(ones xs) * (20-P)^(K-ones xs) * loss2 K P C (ones xs))).sum
|
|
26
|
+
def grid : List (Nat × Nat × Nat) :=
|
|
27
|
+
([1,2,3,4] : List Nat).flatMap (fun K =>
|
|
28
|
+
(List.range 9).flatMap (fun i =>
|
|
29
|
+
(List.range 20).map (fun j => (K,11+i,1+j))))
|
|
30
|
+
theorem grid_has_720_cases : grid.length = 720 := by decide
|
|
31
|
+
theorem closed_form_matches_full_configurations :
|
|
32
|
+
∀ x ∈ grid, grouped x.1 x.2.1 x.2.2 = enumerated x.1 x.2.1 x.2.2 := by decide
|
|
33
|
+
theorem grid_probability_range :
|
|
34
|
+
∀ x ∈ grid, grouped x.1 x.2.1 x.2.2 ≤ 2*20^x.1 := by decide
|
|
35
|
+
-- p=3/4, c=1/2: two distinct K have the same 1/64 floor.
|
|
36
|
+
theorem inverse_alias :
|
|
37
|
+
grouped 3 15 10 * (2*20^5) = grouped 5 15 10 * (2*20^3) := by decide
|
|
38
|
+
-- For p=3/4,c=9/10 and counts summing to N, compare score with 17*N/36.
|
|
39
|
+
def score (counts : List Nat) (zs : List Bool) : Nat :=
|
|
40
|
+
((counts.zip zs).map (fun x => if x.2 then x.1 else 0)).sum
|
|
41
|
+
def floorNumerator (counts : List Nat) : Nat :=
|
|
42
|
+
((configs counts.length).map (fun zs =>
|
|
43
|
+
let lhs := 36 * score counts zs
|
|
44
|
+
let rhs := 17 * counts.sum
|
|
45
|
+
let factor := if lhs < rhs then 2 else if lhs == rhs then 1 else 0
|
|
46
|
+
3^(ones zs) * factor)).sum
|
|
47
|
+
-- Denominator is 2*4^3=128 in each three-lineage case.
|
|
48
|
+
theorem same_effective_participation_different_floor :
|
|
49
|
+
(1*1+4*4+4*4 : Nat) = 2*2+2*2+5*5 ∧
|
|
50
|
+
floorNumerator [1,4,4] = 20 ∧ floorNumerator [2,2,5] = 32 := by decide
|
|
51
|
+
-- WF population N=5, initial counts [3,1,1]; all 21 descendant count states.
|
|
52
|
+
def wfNumerator : Nat :=
|
|
53
|
+
((List.range 6).map (fun a =>
|
|
54
|
+
((List.range (6-a)).map (fun b =>
|
|
55
|
+
binom 5 a * binom (5-a) b * 3^a *
|
|
56
|
+
floorNumerator [a,b,5-a-b])).sum)).sum
|
|
57
|
+
theorem wf_transition_normalized :
|
|
58
|
+
((List.range 6).map (fun a =>
|
|
59
|
+
((List.range (6-a)).map (fun b =>
|
|
60
|
+
binom 5 a * binom (5-a) b * 3^a)).sum)).sum = 5^5 := by decide
|
|
61
|
+
theorem wf_floor_decreases_in_expectation :
|
|
62
|
+
floorNumerator [3,1,1] = 32 ∧ wfNumerator = 92440 ∧
|
|
63
|
+
wfNumerator < floorNumerator [3,1,1] * 5^5 := by decide
|
|
64
|
+
end Obligations045
|
|
65
|
+
#print axioms Obligations045.grid_has_720_cases
|
|
66
|
+
#print axioms Obligations045.closed_form_matches_full_configurations
|
|
67
|
+
#print axioms Obligations045.grid_probability_range
|
|
68
|
+
#print axioms Obligations045.inverse_alias
|
|
69
|
+
|
|
70
|
+
#print axioms Obligations045.same_effective_participation_different_floor
|
|
71
|
+
#print axioms Obligations045.wf_transition_normalized
|
|
72
|
+
#print axioms Obligations045.wf_floor_decreases_in_expectation
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Mathlib.Data.Real.Basic
|
|
2
|
+
import Mathlib.Tactic.Ring
|
|
3
|
+
namespace Obligations045.M0Coincidence
|
|
4
|
+
/-- Exact expectation over independent Bernoulli(p) latent lineages.
|
|
5
|
+
The recurrence keeps both branches and their actual probabilities. -/
|
|
6
|
+
def expect (p : ℝ) : List ℝ → (ℝ → ℝ) → ℝ
|
|
7
|
+
| [], f => f 0
|
|
8
|
+
| w :: ws, f => (1-p)*expect p ws f + p*expect p ws (fun x => f (w+x))
|
|
9
|
+
def squares (ws : List ℝ) : ℝ := (ws.map (fun w => w^2)).sum
|
|
10
|
+
|
|
11
|
+
theorem expect_quadratic (p : ℝ) (ws : List ℝ) (a b d : ℝ) :
|
|
12
|
+
expect p ws (fun x => a*x^2+b*x+d) =
|
|
13
|
+
a*(p^2*ws.sum^2+p*(1-p)*squares ws)+b*p*ws.sum+d := by
|
|
14
|
+
induction ws generalizing a b d with
|
|
15
|
+
| nil => simp [expect, squares]
|
|
16
|
+
| cons w ws ih =>
|
|
17
|
+
have hf : (fun x : ℝ => a*(w+x)^2+b*(w+x)+d) =
|
|
18
|
+
(fun x => a*x^2+(2*a*w+b)*x+(a*w^2+b*w+d)) := by
|
|
19
|
+
funext x
|
|
20
|
+
ring
|
|
21
|
+
simp only [expect, hf]
|
|
22
|
+
rw [ih, ih]
|
|
23
|
+
simp only [List.sum_cons, squares, List.map_cons]
|
|
24
|
+
ring
|
|
25
|
+
|
|
26
|
+
theorem pair_coincidence (p c : ℝ) (ws : List ℝ) (hw : ws.sum = 1) :
|
|
27
|
+
expect p ws (fun x => ((1-c)*p+c*x)^2+(1-((1-c)*p+c*x))^2) =
|
|
28
|
+
p^2+(1-p)^2+2*c^2*p*(1-p)*squares ws := by
|
|
29
|
+
have hf : (fun x : ℝ => ((1-c)*p+c*x)^2+(1-((1-c)*p+c*x))^2) =
|
|
30
|
+
(fun x => (2*c^2)*x^2+(2*c*(2*(1-c)*p-1))*x+
|
|
31
|
+
(((1-c)*p)^2+(1-(1-c)*p)^2)) := by
|
|
32
|
+
funext x
|
|
33
|
+
ring
|
|
34
|
+
rw [hf, expect_quadratic, hw]
|
|
35
|
+
ring
|
|
36
|
+
|
|
37
|
+
theorem triple_redundant (q : ℝ) :
|
|
38
|
+
q^3+(1-q)^3 = (3*(q^2+(1-q)^2)-1)/2 := by ring
|
|
39
|
+
end Obligations045.M0Coincidence
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Obligations045.ConsensusGrid
|
|
2
|
+
set_option maxRecDepth 10000
|
|
3
|
+
set_option maxHeartbeats 8000000
|
|
4
|
+
namespace Obligations045.Diagonal
|
|
5
|
+
/-- Finite diagonal vector only: K=1,p=3/4,c=1/3,w=[1].
|
|
6
|
+
A=false gives q=1/2, A=true gives q=5/6.
|
|
7
|
+
No general CLT or diagonal-limit theorem is declared in this file. -/
|
|
8
|
+
def loss2 (b N : Nat) : Nat := if 2*b < N then 2 else if 2*b == N then 1 else 0
|
|
9
|
+
def unbiasedNumerator (N : Nat) : Nat :=
|
|
10
|
+
((List.range (N+1)).map (fun b => Obligations045.binom N b * loss2 b N)).sum
|
|
11
|
+
def cases : List Nat := [1,2,3,4,5,6,7,8,9,10,11,12]
|
|
12
|
+
theorem unbiased_diagonal_vector : ∀ N ∈ cases, unbiasedNumerator N = 2^N := by decide
|
|
13
|
+
-- Total error numerator has denominator 8*6^N; the target floor is 1/8.
|
|
14
|
+
def errorNumerator (N : Nat) : Nat :=
|
|
15
|
+
6^N+3*((List.range (N+1)).map (fun b =>
|
|
16
|
+
Obligations045.binom N b * 5^b * loss2 b N)).sum
|
|
17
|
+
#eval cases.map (fun N => (N,errorNumerator N,8*6^N))
|
|
18
|
+
end Obligations045.Diagonal
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import Mathlib.Topology.Instances.Real.Lemmas
|
|
2
|
+
import Mathlib.Data.Real.Archimedean
|
|
3
|
+
import Mathlib.Topology.Algebra.Order.Field
|
|
4
|
+
import Mathlib.Algebra.Order.Floor.Ring
|
|
5
|
+
import Mathlib.Tactic.Linarith
|
|
6
|
+
import Mathlib.Tactic.Ring
|
|
7
|
+
import Mathlib.Tactic.NormNum
|
|
8
|
+
import Mathlib.Tactic.Positivity
|
|
9
|
+
|
|
10
|
+
open scoped BigOperators
|
|
11
|
+
open Filter Topology
|
|
12
|
+
noncomputable section
|
|
13
|
+
open Classical
|
|
14
|
+
namespace Obligations045.M0
|
|
15
|
+
|
|
16
|
+
/-- Declared binary M0 domain. This structure contains no limiting-probability axiom. -/
|
|
17
|
+
structure Domain where
|
|
18
|
+
K : ℕ
|
|
19
|
+
K_pos : 0 < K
|
|
20
|
+
p : ℝ
|
|
21
|
+
c : ℝ
|
|
22
|
+
p_half : (1:ℝ)/2 < p
|
|
23
|
+
p_lt_one : p < 1
|
|
24
|
+
c_nonneg : 0 ≤ c
|
|
25
|
+
c_lt_one : c < 1
|
|
26
|
+
w : ℕ → ℝ
|
|
27
|
+
w_nonneg : ∀ i, 0 ≤ w i
|
|
28
|
+
weights_sum : ∑ i ∈ Finset.range K, w i = 1
|
|
29
|
+
|
|
30
|
+
def cumulative (w : ℕ → ℝ) (i : ℕ) : ℝ := ∑ j ∈ Finset.range i, w j
|
|
31
|
+
|
|
32
|
+
def allocation (w : ℕ → ℝ) (N i : ℕ) : ℕ :=
|
|
33
|
+
⌊(N:ℝ) * cumulative w (i+1)⌋₊ - ⌊(N:ℝ) * cumulative w i⌋₊
|
|
34
|
+
|
|
35
|
+
theorem prefix_succ (w : ℕ → ℝ) (i : ℕ) :
|
|
36
|
+
cumulative w (i+1) = cumulative w i + w i := by simp [cumulative, Finset.sum_range_succ]
|
|
37
|
+
|
|
38
|
+
theorem prefix_monotone (w : ℕ → ℝ) (hw : ∀ i, 0 ≤ w i) : Monotone (cumulative w) := by
|
|
39
|
+
apply monotone_nat_of_le_succ
|
|
40
|
+
intro i
|
|
41
|
+
rw [prefix_succ]
|
|
42
|
+
exact le_add_of_nonneg_right (hw i)
|
|
43
|
+
|
|
44
|
+
theorem allocation_sum (M : Domain) (N : ℕ) :
|
|
45
|
+
∑ i ∈ Finset.range M.K, allocation M.w N i = N := by
|
|
46
|
+
let f : ℕ → ℕ := fun i => ⌊(N:ℝ) * cumulative M.w i⌋₊
|
|
47
|
+
have hf : Monotone f := fun i j hij =>
|
|
48
|
+
Nat.floor_mono (mul_le_mul_of_nonneg_left (prefix_monotone M.w M.w_nonneg hij) (by positivity))
|
|
49
|
+
change ∑ i ∈ Finset.range M.K, (f (i+1) - f i) = N
|
|
50
|
+
rw [Finset.sum_range_tsub hf]
|
|
51
|
+
simp [f, cumulative, M.weights_sum]
|
|
52
|
+
|
|
53
|
+
theorem allocation_discrepancy (M : Domain) (N i : ℕ) :
|
|
54
|
+
-1 < (allocation M.w N i : ℝ) - (N:ℝ)*M.w i ∧
|
|
55
|
+
(allocation M.w N i : ℝ) - (N:ℝ)*M.w i < 1 := by
|
|
56
|
+
have hpre : 0 ≤ cumulative M.w i := Finset.sum_nonneg (fun j _ => M.w_nonneg j)
|
|
57
|
+
have hnext : 0 ≤ cumulative M.w (i+1) := Finset.sum_nonneg (fun j _ => M.w_nonneg j)
|
|
58
|
+
have hm : ⌊(N:ℝ)*cumulative M.w i⌋₊ ≤ ⌊(N:ℝ)*cumulative M.w (i+1)⌋₊ :=
|
|
59
|
+
Nat.floor_mono (mul_le_mul_of_nonneg_left (prefix_monotone M.w M.w_nonneg (Nat.le_succ i)) (by positivity))
|
|
60
|
+
have a := Nat.floor_le (mul_nonneg (Nat.cast_nonneg N) hpre)
|
|
61
|
+
have b := Nat.lt_floor_add_one ((N:ℝ)*cumulative M.w i)
|
|
62
|
+
have c := Nat.floor_le (mul_nonneg (Nat.cast_nonneg N) hnext)
|
|
63
|
+
have d := Nat.lt_floor_add_one ((N:ℝ)*cumulative M.w (i+1))
|
|
64
|
+
have hs := prefix_succ M.w i
|
|
65
|
+
simp only [allocation, Nat.cast_sub hm]
|
|
66
|
+
constructor <;> nlinarith
|
|
67
|
+
|
|
68
|
+
def q (M : Domain) (a : Bool) : ℝ := (1-M.c)*M.p + if a then M.c else 0
|
|
69
|
+
|
|
70
|
+
theorem q_pos (M : Domain) (a : Bool) : 0 < q M a := by
|
|
71
|
+
have hp : 0 < M.p := by linarith [M.p_half]
|
|
72
|
+
cases a <;> simp only [q, Bool.false_eq_true, ite_false, add_zero, ite_true] <;>
|
|
73
|
+
nlinarith [M.c_nonneg, M.c_lt_one]
|
|
74
|
+
|
|
75
|
+
theorem q_lt_one (M : Domain) (a : Bool) : q M a < 1 := by
|
|
76
|
+
have hp : 0 < M.p := by linarith [M.p_half]
|
|
77
|
+
cases a <;> simp only [q, Bool.false_eq_true, ite_false, add_zero, ite_true] <;>
|
|
78
|
+
nlinarith [M.c_nonneg, M.c_lt_one, M.p_lt_one]
|
|
79
|
+
|
|
80
|
+
def score (M : Domain) (a : Fin M.K → Bool) : ℝ :=
|
|
81
|
+
∑ i : Fin M.K, M.w i * q M (a i)
|
|
82
|
+
|
|
83
|
+
def latentMass (M : Domain) (a : Fin M.K → Bool) : ℝ :=
|
|
84
|
+
∏ i : Fin M.K, if a i then M.p else 1-M.p
|
|
85
|
+
|
|
86
|
+
def fairLoss (correct total : ℕ) : ℝ :=
|
|
87
|
+
if 2*correct < total then 1 else if 2*correct = total then 1/2 else 0
|
|
88
|
+
|
|
89
|
+
/-- The exact finite conditional error, using independent binomial counts in each lineage. -/
|
|
90
|
+
noncomputable def conditionalError (M : Domain) (N : ℕ) (a : Fin M.K → Bool) : ℝ :=
|
|
91
|
+
∑ x : (i : Fin M.K) → Fin (allocation M.w N i + 1),
|
|
92
|
+
(∏ i : Fin M.K,
|
|
93
|
+
(Nat.choose (allocation M.w N i) (x i) : ℝ) *
|
|
94
|
+
q M (a i) ^ (x i : ℕ) *
|
|
95
|
+
(1-q M (a i)) ^ (allocation M.w N i - (x i : ℕ))) *
|
|
96
|
+
fairLoss (∑ i : Fin M.K, (x i : ℕ)) N
|
|
97
|
+
|
|
98
|
+
noncomputable def error (M : Domain) (N : ℕ) : ℝ :=
|
|
99
|
+
∑ a : Fin M.K → Bool, latentMass M a * conditionalError M N a
|
|
100
|
+
|
|
101
|
+
noncomputable def limitingLoss (s : ℝ) : ℝ :=
|
|
102
|
+
if s < 1/2 then 1 else if s = 1/2 then 1/2 else 0
|
|
103
|
+
|
|
104
|
+
noncomputable def floor (M : Domain) : ℝ :=
|
|
105
|
+
∑ a : Fin M.K → Bool, latentMass M a * limitingLoss (score M a)
|
|
106
|
+
|
|
107
|
+
/-- Explicit proof obligations, NOT assumptions hidden inside the generative model.
|
|
108
|
+
The strict branches require concentration. The equality branch requires a CLT.
|
|
109
|
+
This certificate has no constructed instance in this project. -/
|
|
110
|
+
def ConditionalTailLimits (M : Domain) : Prop :=
|
|
111
|
+
(∀ a, score M a < 1/2 → Tendsto (fun N => conditionalError M N a) atTop (𝓝 1)) ∧
|
|
112
|
+
(∀ a, 1/2 < score M a → Tendsto (fun N => conditionalError M N a) atTop (𝓝 0)) ∧
|
|
113
|
+
(∀ a, score M a = 1/2 → Tendsto (fun N => conditionalError M N a) atTop (𝓝 (1/2)))
|
|
114
|
+
|
|
115
|
+
/-- Kernel checked finite-mixture transfer. This is intentionally conditional;
|
|
116
|
+
it does not claim that ConditionalTailLimits follows from Domain. -/
|
|
117
|
+
theorem limit_of_conditional_tail_limits (M : Domain) (h : ConditionalTailLimits M) :
|
|
118
|
+
Tendsto (error M) atTop (𝓝 (floor M)) := by
|
|
119
|
+
have hcase : ∀ a, Tendsto (fun N => conditionalError M N a) atTop
|
|
120
|
+
(𝓝 (limitingLoss (score M a))) := by
|
|
121
|
+
intro a
|
|
122
|
+
by_cases hl : score M a < 1/2
|
|
123
|
+
· rw [limitingLoss, if_pos hl]
|
|
124
|
+
exact h.1 a hl
|
|
125
|
+
· by_cases he : score M a = 1/2
|
|
126
|
+
· rw [limitingLoss, if_neg hl, if_pos he]
|
|
127
|
+
exact h.2.2 a he
|
|
128
|
+
· have hg : 1/2 < score M a := lt_of_le_of_ne (le_of_not_gt hl) (Ne.symm he)
|
|
129
|
+
rw [limitingLoss, if_neg hl, if_neg he]
|
|
130
|
+
exact h.2.1 a hg
|
|
131
|
+
unfold error floor
|
|
132
|
+
exact tendsto_finset_sum _ (fun a _ => tendsto_const_nhds.mul (hcase a))
|
|
133
|
+
|
|
134
|
+
end Obligations045.M0
|