@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,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "m0-allocation",
|
|
3
|
+
"form": "statement",
|
|
4
|
+
"status": "unsigned-preparation",
|
|
5
|
+
"value": "floor_quota_bounds: K>=1, named nonnegative weights summing to one, p in (1/2,1), c in [0,1). Set W_i=sum_{j<i}w_j, n_i(N)=floor(N W_{i+1})-floor(N W_i). Lean proves sum n_i=N, -1<n_i-Nw_i<1, n_i/N tends to w_i, positive-share counts tend to infinity and zero-share counts vanish. Transport counts, membership and weights under permutation."
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "m0-finite-grid",
|
|
3
|
+
"form": "statement",
|
|
4
|
+
"status": "unsigned-preparation",
|
|
5
|
+
"value": "Finite law by enumeration: K=1..4, p=11/20..19/20, c=1/20..20/20, uniform shares. All 720 closed scores equal exact binary-configuration enumeration and lie in [0,1]. This is a static score formula, not a proof of the N-limit. The false WF expected-floor monotonicity is rejected by a normalized 21-state counterexample at N=5,p=3/4,c=9/10,w=(3,1,1)/5."
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "m0-limit-diag",
|
|
3
|
+
"form": "statement",
|
|
4
|
+
"status": "unsigned-preparation",
|
|
5
|
+
"value": "floor_limit_diag: vector plus written proof, NOT a general Lean theorem. For 0<=c<1, p in (1/2,1), cumulative-floor quotas and S(A)=1/2, variance is order N and quota mean shift is O(1); the standard independent-array normal approximation yields error tending to 1/2. Finite vector: K=1,p=3/4,c=1/3,w=[1], N=1..12; A=0 has q=1/2, A=1 has q=5/6, target floor=1/8. The finite unbiased diagonal identity is kernel-checked; it does not establish a general limit. theta=0 belongs to this diagonal and retains mass (1-p)^K/2. c=1 is excluded: its zero conditional variance needs a separate tie-preserving allocation contract."
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "m0-limit-offdiag",
|
|
3
|
+
"form": "statement",
|
|
4
|
+
"status": "unsigned-preparation",
|
|
5
|
+
"value": "floor_limit_offdiag_M0 and floor_limit_offdiag_mixture: conditional on each fixed latent A, actual jointly independent Bernoulli lineage draws with mean q_l=(1-c)p+c A_l satisfy lineage_lgn. The proved cumulative-floor allocation gives member_average_lgn. If S(A)=sum w_l q_l differs from 1/2, the fair-majority loss tends almost surely to 1{S<1/2}; dominated convergence gives its probability limit. The mixture theorem requires no S(A)=1/2 for every latent state. Technical hypotheses: integrability, identical distribution, independence and measurability are explicit in the formal statement. No ConditionalTailLimits or CLT is assumed by the off-diagonal theorem. The Lean probability formulation uses actual lineage arrays and integrals; equivalence to the separate computational binomial-sum definition is not kernel-proved here."
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "m0-pair-coincidence",
|
|
3
|
+
"form": "statement",
|
|
4
|
+
"status": "unsigned-preparation",
|
|
5
|
+
"value": "Exact M0 independent-Bernoulli expectation gives R2=p^2+(1-p)^2+2c^2 p(1-p) sum w^2 for normalized declared shares; this identity is checked generally in Lean by expect_quadratic and pair_coincidence. Triple agreement satisfies R3=(3R2-1)/2 and adds no independent equation. Population agreement is not majority error or causal identification. Finite distinct-member sampling needs gamma_N, and observed data still need calibration, justified reference and uncertainty."
|
|
6
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type ValueReading, type TruthReading, type CoincidenceReference } from './coincidence.ts';
|
|
2
|
+
import { type RationalInput } from './rational.ts';
|
|
3
|
+
export type PairReference = Readonly<{
|
|
4
|
+
model: 'independent-categorical@1';
|
|
5
|
+
marginals: readonly Readonly<{
|
|
6
|
+
origin: string;
|
|
7
|
+
probabilities: readonly Readonly<{
|
|
8
|
+
value: string;
|
|
9
|
+
p: RationalInput;
|
|
10
|
+
}>[];
|
|
11
|
+
}>[];
|
|
12
|
+
}>;
|
|
13
|
+
export type PairSampling = Readonly<{
|
|
14
|
+
model: 'iid-cells@1';
|
|
15
|
+
epsilon: RationalInput;
|
|
16
|
+
}>;
|
|
17
|
+
type Common = Readonly<{
|
|
18
|
+
origins: readonly string[];
|
|
19
|
+
values: readonly string[];
|
|
20
|
+
T?: number;
|
|
21
|
+
theta?: RationalInput;
|
|
22
|
+
budget: string;
|
|
23
|
+
sampling?: PairSampling;
|
|
24
|
+
}>;
|
|
25
|
+
export type CofailureModel = Common & (Readonly<{
|
|
26
|
+
variant: 'oracle-false-rate';
|
|
27
|
+
truth: readonly TruthReading[];
|
|
28
|
+
reference: CoincidenceReference;
|
|
29
|
+
}> | Readonly<{
|
|
30
|
+
variant: 'categorical-match-excess';
|
|
31
|
+
reference?: PairReference;
|
|
32
|
+
truth?: never;
|
|
33
|
+
}>);
|
|
34
|
+
export declare function cofailurePairs(rows: readonly ValueReading[], model: CofailureModel): {
|
|
35
|
+
status: "unmeasured";
|
|
36
|
+
cause: string;
|
|
37
|
+
required?: undefined;
|
|
38
|
+
events?: undefined;
|
|
39
|
+
T?: undefined;
|
|
40
|
+
variant?: undefined;
|
|
41
|
+
theta?: undefined;
|
|
42
|
+
origins?: undefined;
|
|
43
|
+
pairs?: undefined;
|
|
44
|
+
components?: undefined;
|
|
45
|
+
uncertainty?: undefined;
|
|
46
|
+
scoreMeaning?: undefined;
|
|
47
|
+
interpretation?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
status: "unmeasured";
|
|
50
|
+
cause: string;
|
|
51
|
+
required: string;
|
|
52
|
+
events?: undefined;
|
|
53
|
+
T?: undefined;
|
|
54
|
+
variant?: undefined;
|
|
55
|
+
theta?: undefined;
|
|
56
|
+
origins?: undefined;
|
|
57
|
+
pairs?: undefined;
|
|
58
|
+
components?: undefined;
|
|
59
|
+
uncertainty?: undefined;
|
|
60
|
+
scoreMeaning?: undefined;
|
|
61
|
+
interpretation?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
status: "unmeasured";
|
|
64
|
+
cause: string;
|
|
65
|
+
events: number;
|
|
66
|
+
T: number;
|
|
67
|
+
required?: undefined;
|
|
68
|
+
variant?: undefined;
|
|
69
|
+
theta?: undefined;
|
|
70
|
+
origins?: undefined;
|
|
71
|
+
pairs?: undefined;
|
|
72
|
+
components?: undefined;
|
|
73
|
+
uncertainty?: undefined;
|
|
74
|
+
scoreMeaning?: undefined;
|
|
75
|
+
interpretation?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
status: "measured";
|
|
78
|
+
variant: "oracle-false-rate" | "categorical-match-excess";
|
|
79
|
+
T: number;
|
|
80
|
+
theta: Readonly<{
|
|
81
|
+
numerator: string;
|
|
82
|
+
denominator: string;
|
|
83
|
+
}>;
|
|
84
|
+
origins: string[];
|
|
85
|
+
pairs: {
|
|
86
|
+
origins: readonly [string, string];
|
|
87
|
+
observed: Readonly<{
|
|
88
|
+
numerator: string;
|
|
89
|
+
denominator: string;
|
|
90
|
+
}>;
|
|
91
|
+
expected: Readonly<{
|
|
92
|
+
numerator: string;
|
|
93
|
+
denominator: string;
|
|
94
|
+
}>;
|
|
95
|
+
excess: Readonly<{
|
|
96
|
+
numerator: string;
|
|
97
|
+
denominator: string;
|
|
98
|
+
}>;
|
|
99
|
+
score: Readonly<{
|
|
100
|
+
numerator: string;
|
|
101
|
+
denominator: string;
|
|
102
|
+
}>;
|
|
103
|
+
edge: boolean;
|
|
104
|
+
}[];
|
|
105
|
+
components: string[][];
|
|
106
|
+
uncertainty: unknown;
|
|
107
|
+
scoreMeaning: string;
|
|
108
|
+
interpretation: "descriptive threshold components, not identified causes or probability of truth";
|
|
109
|
+
cause?: undefined;
|
|
110
|
+
required?: undefined;
|
|
111
|
+
events?: undefined;
|
|
112
|
+
};
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { coincidenceExcess } from "./coincidence.js";
|
|
2
|
+
import { unionBoundConfidence } from "./confidence.js";
|
|
3
|
+
import { add, sub, mul, div, q, zero, one, pack, rational, probability } from "./rational.js";
|
|
4
|
+
const refuse = (cause) => { throw Error('REFUSE·cofailure ' + cause); };
|
|
5
|
+
const named = (v) => typeof v === 'string' && v.trim().length > 0;
|
|
6
|
+
const compare = (a, b) => a[0] * b[1] < b[0] * a[1] ? -1 : a[0] * b[1] > b[0] * a[1] ? 1 : 0;
|
|
7
|
+
const max = (a, b) => compare(a, b) >= 0 ? a : b;
|
|
8
|
+
const min = (a, b) => compare(a, b) <= 0 ? a : b;
|
|
9
|
+
export function cofailurePairs(rows, model) {
|
|
10
|
+
if (!model || model.T === undefined || model.theta === undefined)
|
|
11
|
+
return { status: 'unmeasured', cause: 'cofailure/T-and-theta-required' };
|
|
12
|
+
if (!Number.isSafeInteger(model.T) || model.T < 1)
|
|
13
|
+
refuse('invalid-T');
|
|
14
|
+
if (!Array.isArray(rows) || !Array.isArray(model.origins) || model.origins.length < 2 || model.origins.some(id => !named(id)) || new Set(model.origins).size !== model.origins.length)
|
|
15
|
+
refuse('invalid-origins-or-rows');
|
|
16
|
+
if (!Array.isArray(model.values) || model.values.length < 2 || model.values.some(v => !named(v)) || new Set(model.values).size !== model.values.length)
|
|
17
|
+
refuse('invalid-alphabet');
|
|
18
|
+
if (model.variant !== 'oracle-false-rate' && model.variant !== 'categorical-match-excess')
|
|
19
|
+
refuse('declared-variant-required');
|
|
20
|
+
if (typeof model.budget !== 'string' || !/^\d+$/.test(model.budget))
|
|
21
|
+
refuse('budget-required');
|
|
22
|
+
const theta = rational(model.theta);
|
|
23
|
+
if (compare(theta, one) > 0 || compare(theta, model.variant === 'oracle-false-rate' ? zero : q(-1n)) < 0)
|
|
24
|
+
refuse('invalid-threshold');
|
|
25
|
+
const origins = [...model.origins].sort(), M = origins.length * (origins.length - 1) / 2;
|
|
26
|
+
const truth = model.variant === 'oracle-false-rate' ? model.truth : [];
|
|
27
|
+
if (!Array.isArray(truth))
|
|
28
|
+
refuse('truth-array-required');
|
|
29
|
+
if (model.variant === 'categorical-match-excess' && Object.hasOwn(model, 'truth'))
|
|
30
|
+
refuse('non-oracle-truth-input');
|
|
31
|
+
const required = BigInt(M) * (3n * BigInt(rows.length) + BigInt(truth.length) + BigInt(model.values.length) + 2n) + BigInt(rows.length) + BigInt(model.T) * BigInt(origins.length);
|
|
32
|
+
if (required > BigInt(model.budget))
|
|
33
|
+
return { status: 'unmeasured', cause: 'cofailure/budget', required: String(required) };
|
|
34
|
+
const alphabet = new Set(model.values), selected = new Set(origins), events = new Map();
|
|
35
|
+
for (const row of rows) {
|
|
36
|
+
if (!row || !named(row.event) || !named(row.origin) || !alphabet.has(row.value))
|
|
37
|
+
refuse('invalid-value-reading');
|
|
38
|
+
if (!selected.has(row.origin))
|
|
39
|
+
continue;
|
|
40
|
+
const at = events.get(row.event) ?? new Map();
|
|
41
|
+
if (at.has(row.origin) && at.get(row.origin) !== row.value)
|
|
42
|
+
refuse('conflicting-value ' + row.event + '/' + row.origin);
|
|
43
|
+
at.set(row.origin, row.value);
|
|
44
|
+
events.set(row.event, at);
|
|
45
|
+
}
|
|
46
|
+
if (events.size !== model.T || [...events.values()].some(at => at.size !== origins.length))
|
|
47
|
+
return { status: 'unmeasured', cause: 'cofailure/incomplete-declared-frame', events: events.size, T: model.T };
|
|
48
|
+
const marginals = new Map();
|
|
49
|
+
if (model.variant === 'oracle-false-rate' && model.reference?.marginals === 'handed') {
|
|
50
|
+
const errors = model.reference.errors;
|
|
51
|
+
if (!Array.isArray(errors) || errors.length !== origins.length || errors.some(e => !e) || new Set(errors.map(e => e.origin)).size !== origins.length || errors.some(e => !selected.has(e.origin)))
|
|
52
|
+
refuse('oracle-reference-origins');
|
|
53
|
+
}
|
|
54
|
+
if (model.variant === 'categorical-match-excess') {
|
|
55
|
+
if (!model.reference)
|
|
56
|
+
return { status: 'unmeasured', cause: 'cofailure/reference-required' };
|
|
57
|
+
if (model.reference.model !== 'independent-categorical@1' || !Array.isArray(model.reference.marginals) || model.reference.marginals.length !== origins.length)
|
|
58
|
+
refuse('categorical-reference-required');
|
|
59
|
+
for (const row of model.reference.marginals) {
|
|
60
|
+
if (!row || !selected.has(row.origin) || marginals.has(row.origin) || !Array.isArray(row.probabilities) || row.probabilities.length !== alphabet.size)
|
|
61
|
+
refuse('reference-origins-or-values');
|
|
62
|
+
const values = new Map();
|
|
63
|
+
for (const p of row.probabilities) {
|
|
64
|
+
if (!p || !alphabet.has(p.value) || values.has(p.value))
|
|
65
|
+
refuse('reference-origins-or-values');
|
|
66
|
+
values.set(p.value, probability(p.p));
|
|
67
|
+
}
|
|
68
|
+
const total = [...values.values()].reduce(add, zero);
|
|
69
|
+
if (compare(total, one) !== 0)
|
|
70
|
+
refuse('reference-not-normalized');
|
|
71
|
+
marginals.set(row.origin, values);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const pairs = [];
|
|
75
|
+
for (let i = 0; i < origins.length; i++)
|
|
76
|
+
for (let j = i + 1; j < origins.length; j++) {
|
|
77
|
+
const a = origins[i], b = origins[j];
|
|
78
|
+
let observed, expected;
|
|
79
|
+
if (model.variant === 'oracle-false-rate') {
|
|
80
|
+
if (!model.reference || !Array.isArray(model.reference.values) || model.reference.values.length !== alphabet.size || model.reference.values.some(v => !alphabet.has(v)))
|
|
81
|
+
refuse('oracle-reference-alphabet');
|
|
82
|
+
const reference = model.reference.marginals === 'handed' ? { ...model.reference, errors: model.reference.errors.filter(e => e.origin === a || e.origin === b) } : model.reference;
|
|
83
|
+
const reading = coincidenceExcess(rows, truth, [a, b], reference, { minEvents: model.T, minEventsPerTruth: 1, budget: model.budget });
|
|
84
|
+
if (reading.status !== 'measured')
|
|
85
|
+
return { status: 'unmeasured', cause: 'cofailure/oracle ' + reading.cause };
|
|
86
|
+
observed = rational(reading.observed);
|
|
87
|
+
expected = rational(reading.expected);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
let count = 0;
|
|
91
|
+
for (const row of events.values())
|
|
92
|
+
if (row.get(a) === row.get(b))
|
|
93
|
+
count++;
|
|
94
|
+
observed = q(BigInt(count), BigInt(model.T));
|
|
95
|
+
expected = model.values.map(v => mul(marginals.get(a).get(v), marginals.get(b).get(v))).reduce(add, zero);
|
|
96
|
+
}
|
|
97
|
+
const excess = sub(observed, expected), score = model.variant === 'oracle-false-rate' ? observed : excess;
|
|
98
|
+
pairs.push({ origins: [a, b], observed: pack(observed), expected: pack(expected), excess: pack(excess), score: pack(score), edge: compare(score, theta) > 0 });
|
|
99
|
+
}
|
|
100
|
+
const parent = origins.map((_, i) => i), find = (i) => parent[i] === i ? i : find(parent[i]);
|
|
101
|
+
for (const p of pairs)
|
|
102
|
+
if (p.edge)
|
|
103
|
+
parent[find(origins.indexOf(p.origins[0]))] = find(origins.indexOf(p.origins[1]));
|
|
104
|
+
const groups = new Map();
|
|
105
|
+
origins.forEach((id, i) => { const key = find(i); groups.set(key, [...(groups.get(key) ?? []), id]); });
|
|
106
|
+
const components = [...groups.values()].sort((a, b) => a[0].localeCompare(b[0]));
|
|
107
|
+
let uncertainty = { status: 'unmeasured', cause: 'cofailure/sampling-design-required' };
|
|
108
|
+
if (model.sampling) {
|
|
109
|
+
if (model.sampling.model !== 'iid-cells@1')
|
|
110
|
+
refuse('sampling-model-required');
|
|
111
|
+
const epsilon = probability(model.sampling.epsilon);
|
|
112
|
+
if (compare(epsilon, zero) <= 0)
|
|
113
|
+
refuse('positive-epsilon-required');
|
|
114
|
+
const failure = min(one, div(one, mul(q(4n * BigInt(model.T)), mul(epsilon, epsilon))));
|
|
115
|
+
const confidence = unionBoundConfidence(pairs.map((p, i) => ({ id: 'pair-' + i, p: pack(failure), justification: 'Chebyshev: declared iid Bernoulli indicators, variance <= 1/4; fixed handed reference' })));
|
|
116
|
+
const intervals = pairs.map(p => {
|
|
117
|
+
const score = rational(p.score), expected = rational(p.expected), low = model.variant === 'oracle-false-rate' ? zero : sub(zero, expected), high = model.variant === 'oracle-false-rate' ? one : sub(one, expected);
|
|
118
|
+
const lo = max(low, sub(score, epsilon)), hi = min(high, add(score, epsilon));
|
|
119
|
+
return { origins: p.origins, lo: pack(lo), hi: pack(hi), decision: compare(lo, theta) > 0 ? 'above' : compare(hi, theta) < 0 ? 'below' : 'unresolved' };
|
|
120
|
+
});
|
|
121
|
+
uncertainty = { status: 'conditional', model: model.sampling.model, epsilon: pack(epsilon), perPairFailureUpper: pack(failure), confidence,
|
|
122
|
+
intervals, thresholdGraphResolved: intervals.every(i => i.decision !== 'unresolved'),
|
|
123
|
+
conditionalGraphCertificate: !confidence.trivial && intervals.every(i => i.decision !== 'unresolved'),
|
|
124
|
+
meaning: 'fixed-frame threshold graph only, conditional on the handed iid design; neither causal grouping nor iid was inferred' };
|
|
125
|
+
}
|
|
126
|
+
return { status: 'measured', variant: model.variant, T: model.T, theta: pack(theta), origins, pairs, components, uncertainty,
|
|
127
|
+
scoreMeaning: model.variant === 'oracle-false-rate' ? 'same wrong answer / T' : 'same answer / T minus handed independent-categorical reference',
|
|
128
|
+
interpretation: 'descriptive threshold components, not identified causes or probability of truth' };
|
|
129
|
+
}
|
package/dist/measures/index.d.ts
CHANGED
|
@@ -30,3 +30,7 @@ export { phaseDefect, phaseDefectExtrema } from './phase-defect.ts';
|
|
|
30
30
|
export type { PhaseDefectInterpretation } from './phase-defect.ts';
|
|
31
31
|
export { mixProjectionLoss } from './mix-loss.ts';
|
|
32
32
|
export type { NamedConfiguration, ConfigurationPrior, MixLossModel, MixLossPolicy } from './mix-loss.ts';
|
|
33
|
+
export { cofailurePairs } from './cofailure-pairs.ts';
|
|
34
|
+
export type { PairReference, PairSampling, CofailureModel } from './cofailure-pairs.ts';
|
|
35
|
+
export { marginalInformation } from './marginal-information.ts';
|
|
36
|
+
export type { MarginalSource, JointAtom, MarginalModel } from './marginal-information.ts';
|
package/dist/measures/index.js
CHANGED
|
@@ -14,3 +14,5 @@ export { unionBoundConfidence, tolerantCountConfidence } from "./confidence.js";
|
|
|
14
14
|
export { tolerantSubsetConfidence, independentCountConfidence } from "./tolerant-subsets.js";
|
|
15
15
|
export { phaseDefect, phaseDefectExtrema } from "./phase-defect.js";
|
|
16
16
|
export { mixProjectionLoss } from "./mix-loss.js";
|
|
17
|
+
export { cofailurePairs } from "./cofailure-pairs.js";
|
|
18
|
+
export { marginalInformation } from "./marginal-information.js";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type MixLossPolicy } from './mix-loss.ts';
|
|
2
|
+
import { type RationalInput } from './rational.ts';
|
|
3
|
+
export type MarginalSource = Readonly<{
|
|
4
|
+
id: string;
|
|
5
|
+
lineage: string;
|
|
6
|
+
values: readonly string[];
|
|
7
|
+
}>;
|
|
8
|
+
export type JointAtom = Readonly<{
|
|
9
|
+
id: string;
|
|
10
|
+
truth: string;
|
|
11
|
+
values: Readonly<Record<string, string>>;
|
|
12
|
+
p?: RationalInput;
|
|
13
|
+
}>;
|
|
14
|
+
export type MarginalModel = Readonly<{
|
|
15
|
+
model: 'finite-declared-joint@1';
|
|
16
|
+
truthValues: readonly string[];
|
|
17
|
+
sources: readonly MarginalSource[];
|
|
18
|
+
atoms: readonly JointAtom[];
|
|
19
|
+
}>;
|
|
20
|
+
export declare function marginalInformation(model: MarginalModel, orders: readonly (readonly string[])[], policy: MixLossPolicy): {
|
|
21
|
+
status: "unmeasured";
|
|
22
|
+
cause: string;
|
|
23
|
+
required?: undefined;
|
|
24
|
+
workUnit?: undefined;
|
|
25
|
+
model?: undefined;
|
|
26
|
+
unit?: undefined;
|
|
27
|
+
approximation?: undefined;
|
|
28
|
+
truthEntropy?: undefined;
|
|
29
|
+
declaredAtoms?: undefined;
|
|
30
|
+
computedSubsets?: undefined;
|
|
31
|
+
policy?: undefined;
|
|
32
|
+
readings?: undefined;
|
|
33
|
+
meaning?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
status: "unmeasured";
|
|
36
|
+
cause: string;
|
|
37
|
+
required: string;
|
|
38
|
+
workUnit: "declared-support-scans";
|
|
39
|
+
model?: undefined;
|
|
40
|
+
unit?: undefined;
|
|
41
|
+
approximation?: undefined;
|
|
42
|
+
truthEntropy?: undefined;
|
|
43
|
+
declaredAtoms?: undefined;
|
|
44
|
+
computedSubsets?: undefined;
|
|
45
|
+
policy?: undefined;
|
|
46
|
+
readings?: undefined;
|
|
47
|
+
meaning?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
status: "measured";
|
|
50
|
+
model: "finite-declared-joint@1";
|
|
51
|
+
unit: "bits";
|
|
52
|
+
approximation: "binary64-log2";
|
|
53
|
+
truthEntropy: number;
|
|
54
|
+
declaredAtoms: number;
|
|
55
|
+
computedSubsets: number;
|
|
56
|
+
policy: Readonly<{
|
|
57
|
+
logarithm: "binary64-log2";
|
|
58
|
+
budget: string;
|
|
59
|
+
}>;
|
|
60
|
+
workUnit: "declared-support-scans";
|
|
61
|
+
required: string;
|
|
62
|
+
readings: {
|
|
63
|
+
additionOrder: string[];
|
|
64
|
+
steps: {
|
|
65
|
+
source: string;
|
|
66
|
+
lineage: string;
|
|
67
|
+
priorSources: string[];
|
|
68
|
+
deltaInformation: number;
|
|
69
|
+
cumulativeInformation: number;
|
|
70
|
+
remainingConditionalEntropy: number;
|
|
71
|
+
}[];
|
|
72
|
+
totalInformation: number;
|
|
73
|
+
sumMarginals: number;
|
|
74
|
+
telescopingResidual: number;
|
|
75
|
+
}[];
|
|
76
|
+
meaning: "I(truth; new source | previous sources) under one unchanged declared joint prior; lineage labels supply no ordering or independence";
|
|
77
|
+
cause?: undefined;
|
|
78
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { mixProjectionLoss } from "./mix-loss.js";
|
|
2
|
+
import { add, probability, pack, zero } from "./rational.js";
|
|
3
|
+
const refuse = (why) => { throw Error('REFUSE·marginal ' + why); };
|
|
4
|
+
const names = (xs) => Array.isArray(xs) && xs.length > 0 && xs.every(x => typeof x === 'string' && x.trim().length > 0) && new Set(xs).size === xs.length;
|
|
5
|
+
export function marginalInformation(model, orders, policy) {
|
|
6
|
+
if (!model || model.model !== 'finite-declared-joint@1' || !Array.isArray(model.atoms))
|
|
7
|
+
return { status: 'unmeasured', cause: 'marginal/joint-model-required' };
|
|
8
|
+
if (!names(model.truthValues) || !Array.isArray(model.sources) || !model.sources.length || !names(model.sources.map(s => s?.id)))
|
|
9
|
+
refuse('declared-domain-required');
|
|
10
|
+
if (model.sources.some(s => !s || typeof s.lineage !== 'string' || !s.lineage.trim() || !names(s.values)))
|
|
11
|
+
refuse('declared-source-domain-required');
|
|
12
|
+
if (!policy || policy.logarithm !== 'binary64-log2' || typeof policy.budget !== 'string' || !/^\d+$/.test(policy.budget))
|
|
13
|
+
refuse('numeric-policy-required');
|
|
14
|
+
const ids = model.sources.map(s => s.id);
|
|
15
|
+
if (!Array.isArray(orders) || !orders.length || orders.some(o => !Array.isArray(o) || o.length !== ids.length || new Set(o).size !== ids.length || o.some(id => !ids.includes(id))))
|
|
16
|
+
refuse('order-must-be-permutation');
|
|
17
|
+
if (!model.atoms.length || !names(model.atoms.map(a => a?.id)))
|
|
18
|
+
refuse('unique-atom-ids-required');
|
|
19
|
+
if (model.atoms.some(a => !a || a.p === undefined || a.p === null))
|
|
20
|
+
return { status: 'unmeasured', cause: 'marginal/prior-required' };
|
|
21
|
+
const required = BigInt(model.atoms.length) * BigInt(ids.length + 1) * BigInt(1 + orders.length * (ids.length + 1));
|
|
22
|
+
if (required > BigInt(policy.budget))
|
|
23
|
+
return { status: 'unmeasured', cause: 'marginal/budget', required: String(required), workUnit: 'declared-support-scans' };
|
|
24
|
+
const probabilities = model.atoms.map(a => probability(a.p));
|
|
25
|
+
const total = probabilities.reduce(add, zero);
|
|
26
|
+
if (total[0] !== total[1])
|
|
27
|
+
refuse('prior-must-sum-to-one');
|
|
28
|
+
for (const a of model.atoms) {
|
|
29
|
+
if (!model.truthValues.includes(a.truth) || !a.values || Object.keys(a.values).length !== ids.length || model.sources.some(s => !Object.hasOwn(a.values, s.id) || !s.values.includes(a.values[s.id])))
|
|
30
|
+
refuse('atom-outside-domain');
|
|
31
|
+
}
|
|
32
|
+
const cached = new Map();
|
|
33
|
+
function conditional(selected) {
|
|
34
|
+
const coordinates = [...selected].sort(), key = JSON.stringify(coordinates), held = cached.get(key);
|
|
35
|
+
if (held !== undefined)
|
|
36
|
+
return held;
|
|
37
|
+
const states = new Map();
|
|
38
|
+
model.atoms.forEach((a, i) => {
|
|
39
|
+
const truth = JSON.stringify(['truth', a.truth]), tuple = JSON.stringify(['selected', coordinates.map(id => a.values[id])]), name = JSON.stringify([truth, tuple]);
|
|
40
|
+
const previous = states.get(name);
|
|
41
|
+
states.set(name, { truth, tuple, mass: add(previous?.mass ?? zero, probabilities[i]) });
|
|
42
|
+
});
|
|
43
|
+
const values = [...states.values()], alphabet = [...new Set(values.flatMap(v => [v.truth, v.tuple]))];
|
|
44
|
+
const result = mixProjectionLoss({ factors: [{ id: 'truth-coordinate', weight: '0' }, { id: 'selected-coordinate', weight: '1' }], alphabet,
|
|
45
|
+
configurations: values.map((v, i) => ({ id: String(i), values: [v.truth, v.tuple] })),
|
|
46
|
+
prior: { kind: 'explicit', probabilities: values.map((v, i) => ({ configuration: String(i), p: pack(v.mass) })) } }, policy);
|
|
47
|
+
if (result.status !== 'measured')
|
|
48
|
+
return refuse('projection-budget');
|
|
49
|
+
cached.set(key, result.lossBits);
|
|
50
|
+
return result.lossBits;
|
|
51
|
+
}
|
|
52
|
+
const truthEntropy = conditional([]);
|
|
53
|
+
const readings = orders.map(additionOrder => {
|
|
54
|
+
const selected = [];
|
|
55
|
+
let before = truthEntropy, sumMarginals = 0;
|
|
56
|
+
const steps = additionOrder.map(source => {
|
|
57
|
+
const priorSources = [...selected];
|
|
58
|
+
selected.push(source);
|
|
59
|
+
const after = conditional(selected), delta = before - after;
|
|
60
|
+
sumMarginals += delta;
|
|
61
|
+
before = after;
|
|
62
|
+
return { source, lineage: model.sources.find(s => s.id === source).lineage, priorSources,
|
|
63
|
+
deltaInformation: delta, cumulativeInformation: truthEntropy - after, remainingConditionalEntropy: after };
|
|
64
|
+
});
|
|
65
|
+
const totalInformation = truthEntropy - before;
|
|
66
|
+
return { additionOrder: [...additionOrder], steps, totalInformation, sumMarginals, telescopingResidual: sumMarginals - totalInformation };
|
|
67
|
+
});
|
|
68
|
+
return { status: 'measured', model: model.model, unit: 'bits', approximation: 'binary64-log2',
|
|
69
|
+
truthEntropy, declaredAtoms: model.atoms.length, computedSubsets: cached.size, policy, workUnit: 'declared-support-scans',
|
|
70
|
+
required: String(required), readings, meaning: 'I(truth; new source | previous sources) under one unchanged declared joint prior; lineage labels supply no ordering or independence' };
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
floor_quota_bounds: K>=1, named nonnegative weights summing to one, p in (1/2,1), c in [0,1). Set W_i=sum_{j<i}w_j, n_i(N)=floor(N W_{i+1})-floor(N W_i). Lean proves sum n_i=N, -1<n_i-Nw_i<1, n_i/N tends to w_i, positive-share counts tend to infinity and zero-share counts vanish. Transport counts, membership and weights under permutation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Finite law by enumeration: K=1..4, p=11/20..19/20, c=1/20..20/20, uniform shares. All 720 closed scores equal exact binary-configuration enumeration and lie in [0,1]. This is a static score formula, not a proof of the N-limit. The false WF expected-floor monotonicity is rejected by a normalized 21-state counterexample at N=5,p=3/4,c=9/10,w=(3,1,1)/5.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
floor_limit_diag: vector plus written proof, NOT a general Lean theorem. For 0<=c<1, p in (1/2,1), cumulative-floor quotas and S(A)=1/2, variance is order N and quota mean shift is O(1); the standard independent-array normal approximation yields error tending to 1/2. Finite vector: K=1,p=3/4,c=1/3,w=[1], N=1..12; A=0 has q=1/2, A=1 has q=5/6, target floor=1/8. The finite unbiased diagonal identity is kernel-checked; it does not establish a general limit. theta=0 belongs to this diagonal and retains mass (1-p)^K/2. c=1 is excluded: its zero conditional variance needs a separate tie-preserving allocation contract.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
floor_limit_offdiag_M0 and floor_limit_offdiag_mixture: conditional on each fixed latent A, actual jointly independent Bernoulli lineage draws with mean q_l=(1-c)p+c A_l satisfy lineage_lgn. The proved cumulative-floor allocation gives member_average_lgn. If S(A)=sum w_l q_l differs from 1/2, the fair-majority loss tends almost surely to 1{S<1/2}; dominated convergence gives its probability limit. The mixture theorem requires no S(A)=1/2 for every latent state. Technical hypotheses: integrability, identical distribution, independence and measurability are explicit in the formal statement. No ConditionalTailLimits or CLT is assumed by the off-diagonal theorem. The Lean probability formulation uses actual lineage arrays and integrals; equivalence to the separate computational binomial-sum definition is not kernel-proved here.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Exact M0 independent-Bernoulli expectation gives R2=p^2+(1-p)^2+2c^2 p(1-p) sum w^2 for normalized declared shares; this identity is checked generally in Lean by expect_quadratic and pair_coincidence. Triple agreement satisfies R3=(3R2-1)/2 and adds no independent equation. Population agreement is not majority error or causal identification. Finite distinct-member sampling needs gamma_N, and observed data still need calibration, justified reference and uncertainty.
|
package/docs/measures.md
CHANGED
|
@@ -219,3 +219,19 @@ L7: conditional bound on one declared common probability space: P(N>k)<=min(1,su
|
|
|
219
219
|
L8: law by enumeration only for 3<=n<=64, positive integer divisors p|n and integer 0<=s<p. D=log2(n/p)-h(s/p), explicit binary64-log2 approximation. Odd-period minimum uses h(floor(p/2)/p), even-period minimum uses one. Complete maximum at zero; nonzero domain has endpoints 1,p-1, empty when p=1. No information or worst-case interpretation follows from nonnegativity. T87 retains its separate wrapped-phase amplitude identity.
|
|
220
220
|
|
|
221
221
|
L9: law by counterexample of existence of noninjective weighted mix, and measure with a declared prior on a finite explicitly supplied set of named-factor configurations. Equal-weight ab and ba give the same bottom tie and different named forks. Loss is H(configuration | mix)=H(configuration)-H(mix); a uniform prior must be explicitly selected, absent prior is unmeasured. The four-state uniform example has mean loss 0.5 bits and one bit conditioned on tie; the injective named fork has zero loss. Defines no new algebraic act, governance selection, M/3 or M/4 law, or destroyed field.
|
|
222
|
+
|
|
223
|
+
## Lineage and delivery: distinct scopes
|
|
224
|
+
|
|
225
|
+
For n>=2, uniform truth X, the declared n-ary symmetric channel X->Z with crossover probability c in [0,1], and X->Z->reports->aggregate A,
|
|
226
|
+
|
|
227
|
+
```text
|
|
228
|
+
H(X|Z) = h2(c) + c*log2(n-1) >= h2(c)
|
|
229
|
+
H(X|A) >= H(X|Z)
|
|
230
|
+
I(X;A) <= log2(n) - h2(c) - c*log2(n-1)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Here h2 is binary entropy, with 0*log2(0)=0. The uncertainty floor and information ceiling follow from this symmetric-channel equality and the declared Markov bottleneck. The reports and aggregation have no additional access to truth or a revealed error/cause indicator. This reuses capacityP0; it neither replaces capacityBound nor changes M/3 or M/4. An error rate alone, an asymmetric channel or the existing private-error model does not establish this ceiling. The distinguishing counterexamples and relation to F1 are in [the conditional lineage contract](../proofs/lineage-ceiling.json).
|
|
234
|
+
|
|
235
|
+
The parameter c denotes the mixture activation or channel crossover specified by the selected model. It is not identified from unanimity without that model, and no equality with the genetic inbreeding coefficient F is asserted. No genetic law follows here.
|
|
236
|
+
|
|
237
|
+
Cell vacuity is a property of a region under the algebra. Delivery asks whether the bytes named by a digest are available and match it. A vacuous cell neither certifies delivery nor proves that a delivered package is admissible. The relation between these predicates remains the named vacuity-versus-delivery tension.
|
package/docs/paper.md
CHANGED
|
@@ -63,7 +63,7 @@ claims that meet outside the bounds FORBIDDEN ✕
|
|
|
63
63
|
| D7-fork | definition | lattice | A2-meet | two incomparable bounds on one cell from two signers; rendered with both, closed only by a signature | | none | derived by the reader | not a derivation |
|
|
64
64
|
| D8-present | definition | field | A4-epoch, A3-resolution | the present is the meet of overlapping observation bands; there is no instant to certify | | [yes](../samples/yes/D8-present.json) | derived by the reader | not a derivation |
|
|
65
65
|
| D9-yield | definition | valuation | A5-origin-is-extension, D4-debit-in-bits | an origin's yield is bits it closed minus bits reopened against it, per act, over an epoch | | [yes](../samples/yes/D9-yield.json) | derived by the reader | not a derivation |
|
|
66
|
-
| H1-uncertainty | conjecture | chain | A3-resolution, A1-encounter | resolution times independent encounters per cell stays above a floor c; the sufficient resolution is where the product saturates | | [yes](../samples/yes/H1-uncertainty.json) | The falsifier: a
|
|
66
|
+
| H1-uncertainty | conjecture | chain | A3-resolution, A1-encounter | resolution times independent encounters per cell stays above a floor c; the sufficient resolution is where the product saturates | | [yes](../samples/yes/H1-uncertainty.json) | The falsifier: after declaring a counting model, population, units and a fixed positive floor c before observing the sample, an admissible cell whose resolution times encounters per cell falls below c. A rising product does not refute a lower bound. A decrease refutes monotonicity and an exceedance refutes an upper bound only under their separately declared contracts. H1 remains open without the counting/refinement model and fixed parameters; the increasing sample is an experiment, not a universal bound. | not a derivation |
|
|
67
67
|
| H10-the-period-is-a-line-of-the-region | conjecture | field | T48-epoch-is-phase, T87-the-quarter-turn | the period a phase is read against, the one T48 and T87 turn on, is a line of the region and never a fact of the instrument: a concert, a match and a sensor-s cadence each define theirs, and two heads that read one region with its period agree on its coherence with no clock between them; structural resemblance, one origin, not a claim about the world | | [yes](../samples/yes/H10-the-period-is-a-line-of-the-region.json) | The falsifier: two heads that read one region, each with the period of its own clock, and agree on its coherence. A period each instrument brought would be the instrument's, and the heads would need a clock between them to agree. | not a derivation |
|
|
68
68
|
| H2-density-attracts | conjecture | field | A1-encounter, A6-vacuity | where reading already is, the next reading lands: over eight epochs of placement in proportion to the origins a cell already carries, the ratio between the densest tenth and the sparsest rises at every epoch and the deserts stay empty, while the same budget placed blind to density holds that ratio near two and touches three times as many cells | | [yes](../samples/yes/H2-density-attracts.json) | The falsifier: encounters that land independently of the density already there. Then the ratio does not rise with the epochs and the cells touched grow with the budget, which is what the blind placement in the yes sample shows. | not a derivation |
|
|
69
69
|
| H3-a-distant-signature-moves-a-cell-that-did-not-move | conjecture | lattice | T46-a-bound-moves-cells-no-walk-reaches, T47-a-two-pole-object | stated as a hint and never as a claim about the world: if what is is a field of floors and ceilings, a distant signature changes a cell whose own record never moved, and in two hundred trials of one cell holding one value the verdict came out both ways, so nothing stored at the cell explains the difference and what explains it is the bound the cell rests on; the resemblance is structural and never arithmetic, with no continuous amplitudes and no inequality violated by number; structural resemblance, one origin, not a claim about the world | | [yes](../samples/yes/H3-a-distant-signature-moves-a-cell-that-did-not-move.json) | The falsifier: one act that is both local and non-local — a change that travels a distance and also reaches a cell that does not rest on its bound. The two poles would then be one, and this would be a claim about the world rather than a hint. | not a derivation |
|
|
@@ -191,7 +191,7 @@ Five readings:
|
|
|
191
191
|
|
|
192
192
|
<details><summary>Every conjecture in full</summary>
|
|
193
193
|
|
|
194
|
-
Resolution times independent encounters per cell stays above a floor c; the sufficient resolution is where the product saturates. The falsifier: a
|
|
194
|
+
Resolution times independent encounters per cell stays above a floor c; the sufficient resolution is where the product saturates. The falsifier: after declaring a counting model, population, units and a fixed positive floor c before observing the sample, an admissible cell whose resolution times encounters per cell falls below c. A rising product does not refute a lower bound. A decrease refutes monotonicity and an exceedance refutes an upper bound only under their separately declared contracts. H1 remains open without the counting/refinement model and fixed parameters; the increasing sample is an experiment, not a universal bound.
|
|
195
195
|
|
|
196
196
|
Where reading already is, the next reading lands: over eight epochs of placement in proportion to the origins a cell already carries, the ratio between the densest tenth and the sparsest rises at every epoch and the deserts stay empty, while the same budget placed blind to density holds that ratio near two and touches three times as many cells. The falsifier: encounters that land independently of the density already there. Then the ratio does not rise with the epochs and the cells touched grow with the budget, which is what the blind placement in the yes sample shows.
|
|
197
197
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "floor_limit_diag",
|
|
3
|
+
"classification": "bounded vector with mathematical proof text, not a general kernel proof",
|
|
4
|
+
"domain": "M0: finite fixed K, nonnegative normalized fixed w, p in (1/2,1), c in [0,1), cumulative-floor counts, fair ties, conditional independent Bernoulli emissions",
|
|
5
|
+
"fixedState": "Condition on latent A with S(A)=1/2. Set T_N=sum correct bits, mu_N=E[T_N|A], sigma_N^2=Var(T_N|A).",
|
|
6
|
+
"steps": [
|
|
7
|
+
"The proved quotas imply |mu_N-N/2|<=K because every q_l is in (0,1).",
|
|
8
|
+
"Every q_l >= (1-c)p and 1-q_l >= (1-c)(1-p). Thus sigma_N^2 >= kappa*N with kappa=(1-c)^2*p*(1-p)>0; sigma_N^2<=N/4.",
|
|
9
|
+
"Centered Bernoulli summands are bounded by 1, so their summed third absolute moments are at most sigma_N^2. Dividing by sigma_N^3 gives at most 1/sqrt(kappa*N), tending to zero.",
|
|
10
|
+
"Apply the independent, non-identically distributed normal-approximation theorem in dimension one to these standardized summands. Its error on half-lines tends to zero.",
|
|
11
|
+
"The standardized quota shift (N/2-mu_N)/sigma_N tends to zero. Therefore P(T_N<=N/2|A) tends to 1/2.",
|
|
12
|
+
"The approximation has a continuous limiting CDF, so the atom P(T_N=N/2|A) tends to zero. Fair tie handling changes the non-strict tail by half of this vanishing atom.",
|
|
13
|
+
"Hence conditional error tends to 1/2. Sum finitely many latent states with their declared product Bernoulli weights, combining this argument with the kernel-proved off-diagonal theorem."
|
|
14
|
+
],
|
|
15
|
+
"externalTheorem": {
|
|
16
|
+
"author": "Martin Raič",
|
|
17
|
+
"title": "A multivariate Berry–Esseen theorem with explicit constants",
|
|
18
|
+
"url": "https://arxiv.org/pdf/1802.06475",
|
|
19
|
+
"theorem": "1.1, dimension d=1, independent centered standardized summands; convex half-lines",
|
|
20
|
+
"dependence": "A prior mathematical result, not a theorem newly established by Obligations. The application and this proof text are not checked in Lean."
|
|
21
|
+
},
|
|
22
|
+
"degenerates": {
|
|
23
|
+
"theta=0": "Retains (1-p)^K/2; not the zero-floor domain.",
|
|
24
|
+
"c=1": "Excluded: kappa=0 and bounded quota errors need not vanish relative to fluctuations. Separate exact-tie-preserving allocation required.",
|
|
25
|
+
"p=1": "Separate deterministic case, outside current Domain."
|
|
26
|
+
},
|
|
27
|
+
"finiteVector": "proofs/lean/Obligations045/M0Diagonal.lean, N=1..12; actual outputs must be captured",
|
|
28
|
+
"READY": false
|
|
29
|
+
}
|
package/docs/reference.md
CHANGED
|
@@ -361,7 +361,7 @@ flowchart BT
|
|
|
361
361
|
| D7-fork | definition | lattice | A2-meet | two incomparable bounds on one cell from two signers; rendered with both, closed only by a signature | | none | derived by the reader | not a derivation |
|
|
362
362
|
| D8-present | definition | field | A4-epoch, A3-resolution | the present is the meet of overlapping observation bands; there is no instant to certify | | [yes](../samples/yes/D8-present.json) | derived by the reader | not a derivation |
|
|
363
363
|
| D9-yield | definition | valuation | A5-origin-is-extension, D4-debit-in-bits | an origin's yield is bits it closed minus bits reopened against it, per act, over an epoch | | [yes](../samples/yes/D9-yield.json) | derived by the reader | not a derivation |
|
|
364
|
-
| H1-uncertainty | conjecture | chain | A3-resolution, A1-encounter | resolution times independent encounters per cell stays above a floor c; the sufficient resolution is where the product saturates | | [yes](../samples/yes/H1-uncertainty.json) | The falsifier: a
|
|
364
|
+
| H1-uncertainty | conjecture | chain | A3-resolution, A1-encounter | resolution times independent encounters per cell stays above a floor c; the sufficient resolution is where the product saturates | | [yes](../samples/yes/H1-uncertainty.json) | The falsifier: after declaring a counting model, population, units and a fixed positive floor c before observing the sample, an admissible cell whose resolution times encounters per cell falls below c. A rising product does not refute a lower bound. A decrease refutes monotonicity and an exceedance refutes an upper bound only under their separately declared contracts. H1 remains open without the counting/refinement model and fixed parameters; the increasing sample is an experiment, not a universal bound. | not a derivation |
|
|
365
365
|
| H10-the-period-is-a-line-of-the-region | conjecture | field | T48-epoch-is-phase, T87-the-quarter-turn | the period a phase is read against, the one T48 and T87 turn on, is a line of the region and never a fact of the instrument: a concert, a match and a sensor-s cadence each define theirs, and two heads that read one region with its period agree on its coherence with no clock between them; structural resemblance, one origin, not a claim about the world | | [yes](../samples/yes/H10-the-period-is-a-line-of-the-region.json) | The falsifier: two heads that read one region, each with the period of its own clock, and agree on its coherence. A period each instrument brought would be the instrument's, and the heads would need a clock between them to agree. | not a derivation |
|
|
366
366
|
| H2-density-attracts | conjecture | field | A1-encounter, A6-vacuity | where reading already is, the next reading lands: over eight epochs of placement in proportion to the origins a cell already carries, the ratio between the densest tenth and the sparsest rises at every epoch and the deserts stay empty, while the same budget placed blind to density holds that ratio near two and touches three times as many cells | | [yes](../samples/yes/H2-density-attracts.json) | The falsifier: encounters that land independently of the density already there. Then the ratio does not rise with the epochs and the cells touched grow with the budget, which is what the blind placement in the yes sample shows. | not a derivation |
|
|
367
367
|
| H3-a-distant-signature-moves-a-cell-that-did-not-move | conjecture | lattice | T46-a-bound-moves-cells-no-walk-reaches, T47-a-two-pole-object | stated as a hint and never as a claim about the world: if what is is a field of floors and ceilings, a distant signature changes a cell whose own record never moved, and in two hundred trials of one cell holding one value the verdict came out both ways, so nothing stored at the cell explains the difference and what explains it is the bound the cell rests on; the resemblance is structural and never arithmetic, with no continuous amplitudes and no inequality violated by number; structural resemblance, one origin, not a claim about the world | | [yes](../samples/yes/H3-a-distant-signature-moves-a-cell-that-did-not-move.json) | The falsifier: one act that is both local and non-local — a change that travels a distance and also reaches a cell that does not rest on its bound. The two poles would then be one, and this would be a claim about the world rather than a hint. | not a derivation |
|
|
@@ -493,3 +493,8 @@ flowchart BT
|
|
|
493
493
|
| (o, φ) | Origin |
|
|
494
494
|
| s | Act |
|
|
495
495
|
| state | State |
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
## Executable Lean evidence
|
|
499
|
+
|
|
500
|
+
The Lean proof reading executes the declared compiler against handed source bytes after image preparation. Its input identity includes all Lean sources, lean-toolchain, lakefile.toml, lake-manifest.json, both policy vectors and the selected reader implementation. It checks the compiler version/commit and every dependency revision and tracked worktree. A successful receipt means the declared 16 theorem audits and both negative causes passed. No dependencies are installed inside the reading. Native read/open counters distinguish execution from verified reuse. This proof place is separate from npm consumption: consumers verify portable historical readings without installing Lean. Compiler and cache preparation is reported separately, never charged to an existing proof-reader ceiling. Native reading uses the existing 25-second global limit, with the existing 65536-byte capture boundary. Changes to declared inputs reopen the reading; no prose claim closes it.
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@lapxo/obligations","version":"0.4.
|
|
1
|
+
{"name":"@lapxo/obligations","version":"0.4.5","description":"The algebra of a cell: two poles, origins with phase, eight acts.","type":"module","license":"MIT","author":"Lapxo","repository":{"type":"git","url":"git+https://github.com/Lapxo/obligations.git"},"keywords":["obligations","lattice","provenance"],"sideEffects":false,"engines":{"node":">=22.12"},"exports":{".":{"types":"./dist/lattice/index.d.ts","default":"./dist/lattice/index.js"},"./debit":{"types":"./dist/debit/debit.d.ts","default":"./dist/debit/debit.js"},"./encounter":{"types":"./dist/field/encounter.d.ts","default":"./dist/field/encounter.js"},"./field":{"types":"./dist/field/field.d.ts","default":"./dist/field/field.js"},"./forms":{"types":"./dist/lattice/forms.d.ts","default":"./dist/lattice/forms.js"},"./lattice":{"types":"./dist/lattice/lattice.d.ts","default":"./dist/lattice/lattice.js"},"./measures":{"types":"./dist/measures/index.d.ts","default":"./dist/measures/index.js"},"./packed":{"types":"./dist/debit/packed.d.ts","default":"./dist/debit/packed.js"},"./present":{"types":"./dist/field/present.d.ts","default":"./dist/field/present.js"},"./price":{"types":"./dist/lattice/price/index.d.ts","default":"./dist/lattice/price/index.js"},"./replay":{"types":"./dist/replay.d.ts","default":"./dist/replay.js"},"./shuffle":{"types":"./dist/debit/shuffle.d.ts","default":"./dist/debit/shuffle.js"},"./signatures":{"types":"./dist/field/signatures.d.ts","default":"./dist/field/signatures.js"},"./views/field":{"types":"./dist/views/field.d.ts","default":"./dist/views/field.js"},"./views/product":{"types":"./dist/views/product.d.ts","default":"./dist/views/product.js"},"./package.json":"./package.json"},"files":["dist","README.md","LICENSE","TARGET.bound","receipts.bound","docs/measures.md","samples/measures","vectors/measures","samples/yes/algebra-is-closed.json","samples/yes/field-uses-price-and-debit.json","samples/yes/three-theories-one-algebra.json","src/lattice/index.ts","src/field/motion.ts","samples/yes/installed-artifact.json","samples/no/installed-artifact.json","vectors/measures/installed-artifact.cli.json","docs/img","docs/paper.md","docs/reference.md","docs/learn/in-phase.md","docs/learn/price.md","docs/learn/signature.md","docs/learn/thermometer.md","docs/learn/withdrawal.md","vectors/laws/policy.json","vectors/laws/l7-tolerant-k.json","vectors/laws/l8-phase-defect.json","vectors/laws/l9-mix-loss.json","vectors/laws/implementation-043.json","samples/laws/cofailure-pairs/no/sample.json","samples/laws/cofailure-pairs/yes/sample.json","samples/laws/linage-rest/no/sample.json","samples/laws/linage-rest/yes/sample.json","samples/laws/lineage-ceiling/no/sample.json","samples/laws/lineage-ceiling/yes/sample.json","samples/laws/marginal-information/no/sample.json","samples/laws/marginal-information/yes/sample.json","samples/laws/semilattice/no/sample.json","samples/laws/semilattice/yes/sample.json","vectors/laws/cofailure-pairs.json","vectors/laws/cofailure-pairs.native.json","vectors/laws/coordination.json","vectors/laws/f1/finite-arithmetic.json","vectors/laws/f1/path-witness.json","vectors/laws/helly-comb.json","vectors/laws/helly-comb.lean.json","vectors/laws/linage-rest.native.json","vectors/laws/lineage-ceiling.json","vectors/laws/lineage-ceiling.native.json","vectors/laws/marginal-information.json","vectors/laws/marginal-information.native.json","vectors/laws/meet-semilattice.json","vectors/laws/meet-semilattice.native.json","vectors/laws/resolution-encounters.json","proofs/lineage-ceiling.json","proofs/cofailure-pairs.json","proofs/marginal-information.json","proofs/helly-comb.json","proofs/resolution-encounters.json","proofs/coordination.json","proofs/lean/Obligations/Cell.lean","proofs/lean/Obligations/HellyComb.lean","samples/yes/H1-uncertainty.json","samples/no/H1-uncertainty.json","proofs/m0-045/Obligations045/ConsensusGrid.lean","proofs/m0-045/Obligations045/M0Coincidence.lean","proofs/m0-045/Obligations045/M0Diagonal.lean","proofs/m0-045/Obligations045/M0Limit.lean","proofs/m0-045/Obligations045/M0Offdiag.lean","proofs/m0-045/Obligations045.lean","proofs/m0-045/lake-manifest.json","proofs/m0-045/lakefile.toml","proofs/m0-045/lean-toolchain","vectors/laws/m0-allocation.lean.json","contracts/m0-allocation.json","samples/laws/m0-allocation/yes/sample.json","samples/laws/m0-allocation/no/sample.json","vectors/laws/m0-allocation.native.json","docs/contracts/m0-allocation.md","vectors/laws/m0-finite-grid.lean.json","contracts/m0-finite-grid.json","samples/laws/m0-finite-grid/yes/sample.json","samples/laws/m0-finite-grid/no/sample.json","vectors/laws/m0-finite-grid.native.json","docs/contracts/m0-finite-grid.md","vectors/laws/m0-limit-offdiag.lean.json","contracts/m0-limit-offdiag.json","samples/laws/m0-limit-offdiag/yes/sample.json","samples/laws/m0-limit-offdiag/no/sample.json","vectors/laws/m0-limit-offdiag.native.json","docs/contracts/m0-limit-offdiag.md","vectors/laws/m0-limit-diag.lean.json","contracts/m0-limit-diag.json","samples/laws/m0-limit-diag/yes/sample.json","samples/laws/m0-limit-diag/no/sample.json","docs/proofs/floor-limit-diag.proof.json","vectors/laws/m0-limit-diag.native.json","docs/contracts/m0-limit-diag.md","vectors/laws/m0-pair-coincidence.lean.json","contracts/m0-pair-coincidence.json","samples/laws/m0-pair-coincidence/yes/sample.json","samples/laws/m0-pair-coincidence/no/sample.json","vectors/laws/m0-pair-coincidence.native.json","docs/contracts/m0-pair-coincidence.md","CHANGELOG.md"],"scripts":{"build":"tsc --build","test":"node --import ./test/setup.ts --test --test-concurrency=2 test/*.test.ts test/measures/*.test.ts"},"devDependencies":{"@types/node":"^22","typescript":"^5.9.3"}}
|