babylon.formulas.contradiction

Contradiction gap formulas for the Babylon simulation.

The Lawverian rewrite (Phase C) replaces the saturating, dollar-scale tension accumulator with scale-free wealth-asymmetry gaps recomputed fresh from current state every tick. The contradiction is the current relation between two poles: calculate_wealth_asymmetry_gap() reports how far the relation is from closure (0 = parity, 1 = one pole holds everything) and calculate_wealth_asymmetry_balance() reports which pole dominates. Because both divide by the pole sum, they are invariant under a change of monetary numeraire (dollars vs. cents) by construction.

The older calculate_contradiction_intensity() — which fed a raw dollar-scale divergence into a [0, 1] clamp and therefore pinned at 1.0 on any real wealth gap — is retained only for the deprecation window.

Functions

calculate_contradiction_intensity(...[, ...])

Calculate the emergent intensity of a contradiction edge.

calculate_wealth_asymmetry_balance(wealth_a, ...)

Signed dominance of pole B over pole A, in [-1, 1].

calculate_wealth_asymmetry_gap(wealth_a, ...)

Scale-free distance of a two-pole wealth relation from closure.

babylon.formulas.contradiction.calculate_wealth_asymmetry_gap(wealth_a, wealth_b, epsilon=1e-9)[source]

Scale-free distance of a two-pole wealth relation from closure.

The gap is the normalized absolute difference of the two poles’ wealth, \(|W_b - W_a| / (W_a + W_b)\), clamped to [0, 1]: 0 when the poles are at parity (the contradiction is resolved), approaching 1 as one pole holds all the wealth. Dividing by the pole sum makes it a pure number — multiplying both wealths by any k > 0 (a change of monetary numeraire) leaves it unchanged.

epsilon guards ONLY the degenerate all-zero case (both poles empty); it is deliberately NOT added into the ratio, so the measure stays exactly numeraire-invariant rather than invariant-up-to-epsilon (this is the difference that lets the property test hold to 1e-12).

Parameters:
  • wealth_a (float) – Wealth of pole A (non-negative).

  • wealth_b (float) – Wealth of pole B (non-negative).

  • epsilon (float) – Zero-guard threshold on the pole sum; below it the gap is 0.0 (an empty relation has no measurable contradiction).

Return type:

float

Returns:

The asymmetry gap in [0, 1]; 0.0 when both poles are empty.

Example

>>> calculate_wealth_asymmetry_gap(10.0, 30.0)
0.5
>>> calculate_wealth_asymmetry_gap(0.0, 0.0)
0.0
>>> round(calculate_wealth_asymmetry_gap(1.0, 3.0), 6) == round(
...     calculate_wealth_asymmetry_gap(1000.0, 3000.0), 6)
True

See also

calculate_wealth_asymmetry_balance(): the signed counterpart.

babylon.formulas.contradiction.calculate_wealth_asymmetry_balance(wealth_a, wealth_b, epsilon=1e-9)[source]

Signed dominance of pole B over pole A, in [-1, 1].

The signed counterpart of calculate_wealth_asymmetry_gap(): \((W_b - W_a) / (W_a + W_b)\), clamped to [-1, 1]. Positive means pole B (by convention the richer/target side) dominates; negative means pole A dominates; 0 is parity. Its magnitude equals the gap. Like the gap it is exactly numeraire-invariant.

Parameters:
  • wealth_a (float) – Wealth of pole A (non-negative).

  • wealth_b (float) – Wealth of pole B (non-negative).

  • epsilon (float) – Zero-guard threshold on the pole sum; below it the balance is 0.0.

Return type:

float

Returns:

The signed balance in [-1, 1]; 0.0 when both poles are empty.

Example

>>> calculate_wealth_asymmetry_balance(10.0, 30.0)
0.5
>>> calculate_wealth_asymmetry_balance(30.0, 10.0)
-0.5

See also

calculate_wealth_asymmetry_gap(): the unsigned magnitude.

babylon.formulas.contradiction.calculate_contradiction_intensity(divergence, centrality_a, centrality_b, sensitivity=1.0)[source]

Calculate the emergent intensity of a contradiction edge.

Deprecated since version spec-lawverian-C1: Superseded by calculate_wealth_asymmetry_gap(). This function fed a raw dollar-scale divergence into a [0, 1] clamp, which saturated to 1.0 on any real wealth gap and carried no information (the four-inertness-bugs “Formula” defect). Retained for the deprecation window; no production caller remains after Phase C.

Combines raw dialectical divergence (e.g. wealth gap, ideological distance) with the topological importance of the entities involved, scaling the divergence magnitude by their hypergraph centrality or degree.

Formula:

intensity = divergence * (1 + sqrt(Centrality_a * Centrality_b)) * sensitivity Bound to [0.0, 1.0]

Parameters:
  • divergence (float) – Raw difference between node states (typically [0, 1]).

  • centrality_a (float) – Network/Hypergraph centrality of node A (typically [0, 1]).

  • centrality_b (float) – Network/Hypergraph centrality of node B (typically [0, 1]).

  • sensitivity (float) – System or definition-level scaling factor.

Return type:

float

Returns:

Intensity scalar bounded [0.0, 1.0].

Example

>>> calculate_contradiction_intensity(0.5, 0.8, 0.2, 1.0)
0.7...