@lapxo/obligations 0.4.2 → 0.4.3

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.
@@ -0,0 +1,187 @@
1
+ import { type RationalInput } from './rational.ts';
2
+ export type NamedConfiguration = Readonly<{
3
+ id: string;
4
+ values: readonly string[];
5
+ }>;
6
+ export type ConfigurationPrior = Readonly<{
7
+ kind: 'uniform';
8
+ }> | Readonly<{
9
+ kind: 'explicit';
10
+ probabilities: readonly Readonly<{
11
+ configuration: string;
12
+ p: RationalInput;
13
+ }>[];
14
+ }>;
15
+ export type MixLossModel = Readonly<{
16
+ factors: readonly Readonly<{
17
+ id: string;
18
+ weight: RationalInput;
19
+ }>[];
20
+ alphabet: readonly string[];
21
+ configurations: readonly NamedConfiguration[];
22
+ prior?: ConfigurationPrior;
23
+ }>;
24
+ export type MixLossPolicy = Readonly<{
25
+ logarithm: 'binary64-log2';
26
+ budget: string;
27
+ }>;
28
+ export declare function mixProjectionLoss(model: MixLossModel, policy: MixLossPolicy): {
29
+ status: "unmeasured";
30
+ cause: "mix-loss/prior-required";
31
+ parameters: {
32
+ m: number;
33
+ factors: {
34
+ id: string;
35
+ weight: Readonly<{
36
+ numerator: string;
37
+ denominator: string;
38
+ }>;
39
+ }[];
40
+ alphabet: string[];
41
+ configurations: {
42
+ id: string;
43
+ values: string[];
44
+ }[];
45
+ };
46
+ policy: Readonly<{
47
+ logarithm: "binary64-log2";
48
+ budget: string;
49
+ }>;
50
+ required?: undefined;
51
+ workUnit?: undefined;
52
+ model?: undefined;
53
+ prior?: undefined;
54
+ unit?: undefined;
55
+ approximation?: undefined;
56
+ configurationBits?: undefined;
57
+ mixBits?: undefined;
58
+ lossBits?: undefined;
59
+ entropyDifferenceBits?: undefined;
60
+ forkLossBits?: undefined;
61
+ mixInjectiveOnConfigurations?: undefined;
62
+ mixInjectiveOnPositiveSupport?: undefined;
63
+ configurations?: undefined;
64
+ outputs?: undefined;
65
+ meaning?: undefined;
66
+ } | {
67
+ status: "unmeasured";
68
+ cause: "mix-loss/work-budget";
69
+ parameters: {
70
+ m: number;
71
+ factors: {
72
+ id: string;
73
+ weight: Readonly<{
74
+ numerator: string;
75
+ denominator: string;
76
+ }>;
77
+ }[];
78
+ alphabet: string[];
79
+ configurations: {
80
+ id: string;
81
+ values: string[];
82
+ }[];
83
+ };
84
+ policy: Readonly<{
85
+ logarithm: "binary64-log2";
86
+ budget: string;
87
+ }>;
88
+ required: string;
89
+ workUnit: "declared-configurations";
90
+ model?: undefined;
91
+ prior?: undefined;
92
+ unit?: undefined;
93
+ approximation?: undefined;
94
+ configurationBits?: undefined;
95
+ mixBits?: undefined;
96
+ lossBits?: undefined;
97
+ entropyDifferenceBits?: undefined;
98
+ forkLossBits?: undefined;
99
+ mixInjectiveOnConfigurations?: undefined;
100
+ mixInjectiveOnPositiveSupport?: undefined;
101
+ configurations?: undefined;
102
+ outputs?: undefined;
103
+ meaning?: undefined;
104
+ } | {
105
+ status: "measured";
106
+ model: "declared-weighted-mix-projection@1";
107
+ parameters: {
108
+ m: number;
109
+ factors: {
110
+ id: string;
111
+ weight: Readonly<{
112
+ numerator: string;
113
+ denominator: string;
114
+ }>;
115
+ }[];
116
+ alphabet: string[];
117
+ configurations: {
118
+ id: string;
119
+ values: string[];
120
+ }[];
121
+ };
122
+ prior: {
123
+ kind: "uniform" | "explicit";
124
+ probabilities: {
125
+ configuration: string;
126
+ p: Readonly<{
127
+ numerator: string;
128
+ denominator: string;
129
+ }>;
130
+ }[];
131
+ };
132
+ policy: Readonly<{
133
+ logarithm: "binary64-log2";
134
+ budget: string;
135
+ }>;
136
+ unit: "bits";
137
+ approximation: "binary64-log2";
138
+ configurationBits: number;
139
+ mixBits: number;
140
+ lossBits: number;
141
+ entropyDifferenceBits: number;
142
+ forkLossBits: number;
143
+ mixInjectiveOnConfigurations: boolean;
144
+ mixInjectiveOnPositiveSupport: boolean;
145
+ configurations: {
146
+ id: string;
147
+ probability: Readonly<{
148
+ numerator: string;
149
+ denominator: string;
150
+ }>;
151
+ mix: Readonly<{
152
+ kind: "value";
153
+ value: string;
154
+ }> | {
155
+ kind: "tie";
156
+ };
157
+ fork: {
158
+ factor: string;
159
+ value: string;
160
+ }[];
161
+ }[];
162
+ outputs: {
163
+ output: Readonly<{
164
+ kind: "value";
165
+ value: string;
166
+ }> | {
167
+ kind: "tie";
168
+ };
169
+ probability: Readonly<{
170
+ numerator: string;
171
+ denominator: string;
172
+ }>;
173
+ configurations: string[];
174
+ posterior: {
175
+ configuration: string;
176
+ p: Readonly<{
177
+ numerator: string;
178
+ denominator: string;
179
+ }>;
180
+ }[];
181
+ conditionalBits: number | null;
182
+ }[];
183
+ meaning: "conditional entropy of the declared configuration given its deterministic mix output; named fork is injective";
184
+ cause?: undefined;
185
+ required?: undefined;
186
+ workUnit?: undefined;
187
+ };
@@ -0,0 +1,101 @@
1
+ import { add, div, one, pack, probability, rational, zero } from "./rational.js";
2
+ const refuse = (why) => { throw Error('REFUSE·mix-loss ' + why); };
3
+ const exact = (input, asProbability = false) => {
4
+ try {
5
+ return asProbability ? probability(input) : rational(input);
6
+ }
7
+ catch {
8
+ return refuse('invalid ' + (asProbability ? 'prior probability' : 'factor weight'));
9
+ }
10
+ };
11
+ const logInteger = (n) => { const shift = Math.max(0, n.toString(2).length - 53); return Math.log2(Number(n >> BigInt(shift))) + shift; };
12
+ const logQ = (p) => logInteger(p[0]) - logInteger(p[1]);
13
+ const numeric = (p) => p[0] === 0n ? 0 : 2 ** logQ(p);
14
+ const entropy = (ps) => ps.reduce((sum, p) => p[0] === 0n ? sum : sum - numeric(p) * logQ(p), 0);
15
+ const uniqueNames = (names, what) => {
16
+ if (!Array.isArray(names) || !names.length || names.some(n => typeof n !== 'string' || !n.trim()) || new Set(names).size !== names.length)
17
+ refuse('distinct nonempty ' + what + ' required');
18
+ };
19
+ export function mixProjectionLoss(model, policy) {
20
+ if (!policy || policy.logarithm !== 'binary64-log2' || typeof policy.budget !== 'string' || !/^\d+$/.test(policy.budget))
21
+ refuse('logarithm and work budget required');
22
+ if (!model || !Array.isArray(model.factors) || !Array.isArray(model.alphabet) || !Array.isArray(model.configurations))
23
+ refuse('declared factors, alphabet and configuration support required');
24
+ uniqueNames(model.factors.map(f => f?.id), 'factor IDs');
25
+ uniqueNames(model.alphabet, 'alphabet values');
26
+ uniqueNames(model.configurations.map(c => c?.id), 'configuration IDs');
27
+ const alphabet = new Set(model.alphabet);
28
+ const patterns = new Set();
29
+ for (const c of model.configurations) {
30
+ if (!Array.isArray(c.values) || c.values.length !== model.factors.length || c.values.some(v => !alphabet.has(v)))
31
+ refuse('configuration outside declared factor/alphabet domain');
32
+ const pattern = JSON.stringify(c.values);
33
+ if (patterns.has(pattern))
34
+ refuse('duplicate named-factor configuration');
35
+ patterns.add(pattern);
36
+ }
37
+ const weights = model.factors.map(f => exact(f.weight));
38
+ if (weights.some(w => w[0] < 0n) || weights.every(w => w[0] === 0n))
39
+ refuse('nonnegative weights with positive total required');
40
+ const parameters = { m: model.factors.length, factors: model.factors.map((f, i) => ({ id: f.id, weight: pack(weights[i]) })),
41
+ alphabet: [...model.alphabet], configurations: model.configurations.map(c => ({ id: c.id, values: [...c.values] })) };
42
+ if (!model.prior)
43
+ return { status: 'unmeasured', cause: 'mix-loss/prior-required', parameters, policy };
44
+ const required = BigInt(model.configurations.length);
45
+ if (required > BigInt(policy.budget))
46
+ return { status: 'unmeasured', cause: 'mix-loss/work-budget',
47
+ parameters, policy, required: String(required), workUnit: 'declared-configurations' };
48
+ let prior;
49
+ if (model.prior.kind === 'uniform')
50
+ prior = model.configurations.map(() => div(one, [BigInt(model.configurations.length), 1n]));
51
+ else if (model.prior.kind === 'explicit') {
52
+ const entries = model.prior.probabilities;
53
+ if (!Array.isArray(entries) || entries.length !== model.configurations.length || entries.some(e => !e || typeof e.configuration !== 'string') ||
54
+ new Set(entries.map(e => e.configuration)).size !== entries.length)
55
+ refuse('one prior probability per configuration required');
56
+ const byId = new Map(entries.map(e => [e.configuration, exact(e.p, true)]));
57
+ if (model.configurations.some(c => !byId.has(c.id)))
58
+ refuse('prior support differs from declared configurations');
59
+ prior = model.configurations.map(c => byId.get(c.id));
60
+ const total = prior.reduce(add, zero);
61
+ if (total[0] !== total[1])
62
+ refuse('prior probabilities must sum exactly to one');
63
+ }
64
+ else
65
+ return refuse('declared prior kind required');
66
+ const fibers = new Map();
67
+ const configurations = model.configurations.map((c, i) => {
68
+ const totals = new Map(model.alphabet.map(v => [v, zero]));
69
+ c.values.forEach((v, j) => totals.set(v, add(totals.get(v), weights[j])));
70
+ let best = zero;
71
+ for (const total of totals.values())
72
+ if (total[0] * best[1] > best[0] * total[1])
73
+ best = total;
74
+ const winners = model.alphabet.filter(v => { const t = totals.get(v); return t[0] * best[1] === best[0] * t[1]; });
75
+ const output = winners.length === 1 ? { kind: 'value', value: winners[0] } : { kind: 'tie', values: winners };
76
+ const key = output.kind === 'tie' ? 'tie' : JSON.stringify(['value', output.value]);
77
+ const fiber = fibers.get(key) ?? { output: output.kind === 'tie' ? { kind: 'tie', values: [] } : output, indices: [] };
78
+ fiber.indices.push(i);
79
+ fibers.set(key, fiber);
80
+ return { id: c.id, probability: pack(prior[i]), mix: output.kind === 'tie' ? { kind: 'tie' } : output,
81
+ fork: model.factors.map((f, j) => ({ factor: f.id, value: c.values[j] })) };
82
+ });
83
+ const outputs = [...fibers.values()].map(f => {
84
+ const mass = f.indices.map(i => prior[i]).reduce(add, zero);
85
+ const posterior = mass[0] === 0n ? [] : f.indices.map(i => ({ configuration: model.configurations[i].id, p: div(prior[i], mass) }));
86
+ return { output: f.output.kind === 'tie' ? { kind: 'tie' } : f.output, probability: pack(mass),
87
+ configurations: f.indices.map(i => model.configurations[i].id),
88
+ posterior: posterior.map(p => ({ configuration: p.configuration, p: pack(p.p) })),
89
+ conditionalBits: mass[0] === 0n ? null : entropy(posterior.map(p => p.p)), mass };
90
+ });
91
+ const configurationBits = entropy(prior), mixBits = entropy(outputs.map(o => o.mass));
92
+ const lossBits = outputs.reduce((sum, o) => sum + (o.conditionalBits === null ? 0 : numeric(o.mass) * o.conditionalBits), 0);
93
+ return { status: 'measured', model: 'declared-weighted-mix-projection@1', parameters,
94
+ prior: { kind: model.prior.kind, probabilities: model.configurations.map((c, i) => ({ configuration: c.id, p: pack(prior[i]) })) },
95
+ policy, unit: 'bits', approximation: 'binary64-log2', configurationBits, mixBits, lossBits,
96
+ entropyDifferenceBits: configurationBits - mixBits, forkLossBits: 0,
97
+ mixInjectiveOnConfigurations: [...fibers.values()].every(f => f.indices.length === 1),
98
+ mixInjectiveOnPositiveSupport: [...fibers.values()].every(f => f.indices.filter(i => prior[i][0] > 0n).length <= 1),
99
+ configurations, outputs: outputs.map(({ mass, ...o }) => o),
100
+ meaning: 'conditional entropy of the declared configuration given its deterministic mix output; named fork is injective' };
101
+ }
@@ -0,0 +1,40 @@
1
+ import type { LogarithmPolicy } from './capacity.ts';
2
+ export type PhaseDefectInterpretation = 'phase-defect' | 'information';
3
+ export declare function phaseDefect(n: number, p: number, s: number, policy: LogarithmPolicy, interpretation?: PhaseDefectInterpretation): {
4
+ model: "F4-integer-phase-defect@1";
5
+ parameters: {
6
+ n: number;
7
+ p: number;
8
+ s: number;
9
+ };
10
+ policy: Readonly<{
11
+ logarithm: "binary64-log2";
12
+ }>;
13
+ status: "measured";
14
+ meaning: "phase defect; information interpretation open";
15
+ regime: "nonnegative" | "may-be-negative";
16
+ value: number;
17
+ };
18
+ export declare function phaseDefectExtrema(n: number, p: number, policy: LogarithmPolicy): {
19
+ model: "F4-integer-phase-defect@1";
20
+ parameters: {
21
+ n: number;
22
+ p: number;
23
+ };
24
+ policy: Readonly<{
25
+ logarithm: "binary64-log2";
26
+ }>;
27
+ status: "measured";
28
+ minimum: {
29
+ value: number;
30
+ shifts: number[];
31
+ };
32
+ maximum: {
33
+ value: number;
34
+ shifts: number[];
35
+ };
36
+ nonzeroMaximum: {
37
+ value: number;
38
+ shifts: number[];
39
+ } | null;
40
+ };
@@ -0,0 +1,33 @@
1
+ const refuse = (cause) => { throw new Error('REFUSE·phase-defect ' + cause); };
2
+ function domain(n, p, policy) {
3
+ if (!Number.isSafeInteger(n) || n < 1 || !Number.isSafeInteger(p) || p < 1 || n % p !== 0)
4
+ refuse('positive integer divisor domain required');
5
+ if (!policy || policy.logarithm !== 'binary64-log2')
6
+ refuse('logarithm policy required');
7
+ }
8
+ function shift(p, s) {
9
+ if (!Number.isSafeInteger(s) || s < 0 || s >= p)
10
+ refuse('integer shift domain required');
11
+ }
12
+ function binaryEntropy(t) {
13
+ return t === 0 || t === 1 ? 0 : -t * Math.log2(t) - (1 - t) * Math.log2(1 - t);
14
+ }
15
+ export function phaseDefect(n, p, s, policy, interpretation = 'phase-defect') {
16
+ domain(n, p, policy);
17
+ shift(p, s);
18
+ if (interpretation !== 'phase-defect')
19
+ refuse('information interpretation unsupported');
20
+ return { model: 'F4-integer-phase-defect@1', parameters: { n, p, s }, policy,
21
+ status: 'measured', meaning: 'phase defect; information interpretation open',
22
+ regime: n / p >= 2 ? 'nonnegative' : 'may-be-negative',
23
+ value: Math.log2(n / p) - binaryEntropy(s / p) };
24
+ }
25
+ export function phaseDefectExtrema(n, p, policy) {
26
+ domain(n, p, policy);
27
+ const middle = Math.floor(p / 2), minimumShifts = p === 1 ? [0] : p % 2 === 0 ? [middle] : [middle, middle + 1];
28
+ return { model: 'F4-integer-phase-defect@1', parameters: { n, p }, policy,
29
+ status: 'measured',
30
+ minimum: { value: Math.log2(n / p) - binaryEntropy(middle / p), shifts: minimumShifts },
31
+ maximum: { value: Math.log2(n / p), shifts: [0] },
32
+ nonzeroMaximum: p === 1 ? null : { value: Math.log2(n / p) - binaryEntropy(1 / p), shifts: p === 2 ? [1] : [1, p - 1] } };
33
+ }
@@ -0,0 +1,79 @@
1
+ import { type DeclaredFailure } from './confidence.ts';
2
+ export declare function tolerantSubsetConfidence(failures: readonly DeclaredFailure[], k: number, probabilitySpace: string): {
3
+ model: "declared-failure-subset-bound@1";
4
+ status: "conditional-bound";
5
+ unit: "probability";
6
+ probabilitySpace: string;
7
+ declarations: {
8
+ id: string;
9
+ p: Readonly<{
10
+ numerator: string;
11
+ denominator: string;
12
+ }>;
13
+ justification: string;
14
+ }[];
15
+ allowedFailures: number;
16
+ totalDeclarations: number;
17
+ conditions: readonly ["common-probability-space", "declared-marginal-upper-bounds"];
18
+ referencesVerified: false;
19
+ terms: {
20
+ id: string;
21
+ subsets: string;
22
+ contribution: Readonly<{
23
+ numerator: string;
24
+ denominator: string;
25
+ }>;
26
+ }[];
27
+ uncappedFailureBound: Readonly<{
28
+ numerator: string;
29
+ denominator: string;
30
+ }>;
31
+ failureUpperBound: Readonly<{
32
+ numerator: string;
33
+ denominator: string;
34
+ }>;
35
+ value: Readonly<{
36
+ numerator: string;
37
+ denominator: string;
38
+ }>;
39
+ trivial: boolean;
40
+ };
41
+ export type JointIndependenceDeclaration = Readonly<{
42
+ probabilitySpace: string;
43
+ jointIndependence: true;
44
+ justification: string;
45
+ }>;
46
+ export declare function independentCountConfidence(failures: readonly DeclaredFailure[], k: number, declaration: JointIndependenceDeclaration): {
47
+ model: "declared-joint-independent-count-bound@1";
48
+ status: "conditional-bound";
49
+ unit: "probability";
50
+ probabilitySpace: string;
51
+ declarations: {
52
+ id: string;
53
+ p: Readonly<{
54
+ numerator: string;
55
+ denominator: string;
56
+ }>;
57
+ justification: string;
58
+ }[];
59
+ allowedFailures: number;
60
+ totalDeclarations: number;
61
+ jointIndependence: {
62
+ declared: true;
63
+ justification: string;
64
+ };
65
+ referencesVerified: false;
66
+ bernoulliEnvelope: Readonly<{
67
+ numerator: string;
68
+ denominator: string;
69
+ }>[];
70
+ failureUpperBound: Readonly<{
71
+ numerator: string;
72
+ denominator: string;
73
+ }>;
74
+ value: Readonly<{
75
+ numerator: string;
76
+ denominator: string;
77
+ }>;
78
+ trivial: boolean;
79
+ };
@@ -0,0 +1,60 @@
1
+ import { unionBoundConfidence } from "./confidence.js";
2
+ import { add, sub, mul, q, rational, zero, one, pack } from "./rational.js";
3
+ const refuse = (cause) => { throw new Error('REFUSE·L7 ' + cause); };
4
+ function inputs(failures, k, probabilitySpace) {
5
+ if (typeof probabilitySpace !== 'string' || probabilitySpace.trim() === '')
6
+ refuse('common-probability-space-required');
7
+ const base = unionBoundConfidence(failures), m = base.declarations.length;
8
+ if (!Number.isSafeInteger(k) || k < 0 || k > m)
9
+ refuse('allowed-failure-count-outside-0..m');
10
+ return { base, m };
11
+ }
12
+ function choose(n, k) {
13
+ if (k > n)
14
+ return 0n;
15
+ let c = 1n;
16
+ for (let j = 1; j <= Math.min(k, n - k); j++)
17
+ c = c * BigInt(n - j + 1) / BigInt(j);
18
+ return c;
19
+ }
20
+ export function tolerantSubsetConfidence(failures, k, probabilitySpace) {
21
+ const { base, m } = inputs(failures, k, probabilitySpace);
22
+ const ordered = base.declarations.map(entry => ({ entry, p: rational(entry.p) })).sort((a, b) => {
23
+ const d = a.p[0] * b.p[1] - b.p[0] * a.p[1];
24
+ return d < 0n ? -1 : d > 0n ? 1 : 0;
25
+ });
26
+ let sum = zero;
27
+ const terms = k === m ? [] : ordered.slice(0, m - k).map(({ entry, p }, j) => {
28
+ const coefficient = choose(m - j - 1, k), contribution = mul(p, q(coefficient));
29
+ sum = add(sum, contribution);
30
+ return { id: entry.id, subsets: String(coefficient), contribution: pack(contribution) };
31
+ });
32
+ const trivial = sum[0] >= sum[1], upper = trivial ? one : sum;
33
+ return { model: 'declared-failure-subset-bound@1', status: 'conditional-bound',
34
+ unit: 'probability', probabilitySpace, declarations: base.declarations,
35
+ allowedFailures: k, totalDeclarations: m, conditions: ['common-probability-space', 'declared-marginal-upper-bounds'],
36
+ referencesVerified: false, terms, uncappedFailureBound: pack(sum), failureUpperBound: pack(upper),
37
+ value: pack(sub(one, upper)), trivial };
38
+ }
39
+ export function independentCountConfidence(failures, k, declaration) {
40
+ if (!declaration || declaration.jointIndependence !== true)
41
+ refuse('joint-independence-required');
42
+ if (typeof declaration.justification !== 'string' || declaration.justification.trim() === '')
43
+ refuse('joint-independence-justification-required');
44
+ const { base, m } = inputs(failures, k, declaration.probabilitySpace);
45
+ let distribution = [one];
46
+ for (const entry of base.declarations) {
47
+ const p = rational(entry.p), next = Array.from({ length: distribution.length + 1 }, () => zero);
48
+ for (let j = 0; j < distribution.length; j++) {
49
+ next[j] = add(next[j], mul(distribution[j], sub(one, p)));
50
+ next[j + 1] = add(next[j + 1], mul(distribution[j], p));
51
+ }
52
+ distribution = next;
53
+ }
54
+ const upper = distribution.slice(k + 1).reduce(add, zero);
55
+ return { model: 'declared-joint-independent-count-bound@1', status: 'conditional-bound',
56
+ unit: 'probability', probabilitySpace: declaration.probabilitySpace, declarations: base.declarations,
57
+ allowedFailures: k, totalDeclarations: m, jointIndependence: { declared: true, justification: declaration.justification },
58
+ referencesVerified: false, bernoulliEnvelope: distribution.map(pack), failureUpperBound: pack(upper),
59
+ value: pack(sub(one, upper)), trivial: upper[0] === upper[1] };
60
+ }
package/docs/measures.md CHANGED
@@ -211,3 +211,11 @@ These operations compute conditional probability bounds. They select neither a g
211
211
  At n=4,c=1,q=1/4 the bound is exactly zero; q=0 gives log2(4/3), and q=1 gives two bits. Missing q refuses. The operational declaration or detection of activation remains open in identification.model. Unconditioned coincidence does not identify q.
212
212
 
213
213
  M/3 and M/4 retain their existing definitions. Partial-factor governance proposals do not supply a conditional joint observation and selection law. The information carried by dissent, including a bottom symbol, is open for those unspecified proposals.
214
+
215
+ ## Obligations 0.4.3 — proposed conditional measures
216
+
217
+ L7: conditional bound on one declared common probability space: P(N>k)<=min(1,sum over |S|=k+1 of min p_i), with rational declared marginal failure upper bounds and 0<=k<=m. Trivial iff computed upper bound is one. Counterexamples refute the former top-k+1 success guarantee. Joint-independent Bernoulli convolution is a separate declared hypothesis; rho=0 and pairwise independence do not supply it. Existing stronger 0.4.2 count bound is unchanged and needs no joint independence.
218
+
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
+
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.
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@lapxo/obligations","version":"0.4.2","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"],"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"}}
1
+ {"name":"@lapxo/obligations","version":"0.4.3","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"],"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"}}