Skip to content

Commit f64a2aa

Browse files
feat(epac): falsify replacement tuple minimality
- Exhaustive subset test over (period, group, valence_electrons), keeping B + layer prefix: the tuple is NOT minimal - Single-component drops: dropping period breaks separation; dropping group or valence each still separates, so group and valence are dispensable - Minimal subsets are exactly (period, group) and (period, valence); period is necessary - The tuple remains a chemistry identifier; its separating power is B + layer + period plus one of {group, valence} - Electron-configuration occupancy sums do NOT separate, so the tuple is not interchangeable with arbitrary declared periodic structure - Receipt 4f8396569d339e9d6996092be5bc3cc217a6bd79fc17aab2338fd44923fc2830
1 parent 8b149dc commit f64a2aa

2 files changed

Lines changed: 143 additions & 1 deletion

File tree

‎research/epac/epac_carrier_falsification.py‎

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
# then: neither is found to derive the richer coordinate structure independently, and EPAC coordinates are not imported upward
4444
# class: doctrine
4545
# since: 2026-09-17
46+
#
47+
# id: carrier_falsification_replacement_minimality
48+
# given: the replacement tuple (period, group, valence_electrons)
49+
# then: every single-component drop must break separation, the tuple must be strictly finer than sigma at molecule scale, and the electron-occupancy alternative must fail
50+
# class: correctness
51+
# since: 2026-09-17
4652
# === END CONTRACTS ===
4753

4854
"""Falsify the constitutive carrier and its coordinates.
@@ -156,7 +162,6 @@ def _sigma_replacement(states: dict[str, ConstitutivePoint]) -> dict[str, Any]:
156162

157163

158164
def _sigma_identity_serialization_audit(states: dict[str, ConstitutivePoint]) -> dict[str, Any]:
159-
bare_symbols = [s.split(":", 1)[1] for s in states if ":" in s and not s.startswith("molecule")]
160165
molecule_sigmas = {
161166
states[f"molecule:{formula}"].coordinates[4] for formula, _ in LOCKED_FORMULAS
162167
}
@@ -174,6 +179,118 @@ def _sigma_identity_serialization_audit(states: dict[str, ConstitutivePoint]) ->
174179
}
175180

176181

182+
def _replacement_minimality_audit(states: dict[str, ConstitutivePoint]) -> dict[str, Any]:
183+
"""Test whether (period, group, valence_electrons) is minimal or merely
184+
another redundant chemistry identifier."""
185+
186+
components = ("period", "group", "valence_electrons")
187+
188+
def tuple_for(name: str) -> tuple[int, int, int, int, tuple[int, int, int]]:
189+
point = states[name]
190+
return _replacement_point(point)
191+
192+
def separates(mapping: dict[str, tuple]) -> bool:
193+
groups: dict[tuple, list[str]] = {}
194+
for name, coords in mapping.items():
195+
groups.setdefault(coords, []).append(name)
196+
return all(len(group) == 1 for group in groups.values())
197+
198+
# Full replacement point separation: B + layer + periodic tuple.
199+
full = {name: tuple_for(name) for name in states}
200+
full_separates = separates(full)
201+
202+
# Minimality: drop each single periodic component, keeping B and layer.
203+
drops: dict[str, dict[str, Any]] = {}
204+
for drop_index, drop_name in enumerate(components):
205+
kept = [i for i in range(3) if i != drop_index]
206+
reduced = {
207+
name: (coords[0], coords[1], coords[2], coords[3], tuple(coords[4][i] for i in kept))
208+
for name, coords in full.items()
209+
}
210+
collisions = {}
211+
groups: dict[tuple, list[str]] = {}
212+
for name, coords in reduced.items():
213+
groups.setdefault(coords, []).append(name)
214+
for coords, group in sorted(groups.items()):
215+
if len(group) > 1:
216+
collisions[str(coords)] = group
217+
drops[drop_name] = {
218+
"kept": [components[i] for i in kept],
219+
"separation_survives": not collisions,
220+
"collisions": collisions,
221+
}
222+
minimal = all(not entry["separation_survives"] for entry in drops.values())
223+
224+
# Exhaustive subset minimality over the three components, keeping the
225+
# B + layer prefix.
226+
minimal_subsets: list[list[str]] = []
227+
for mask in range(1, 8):
228+
kept_indices = [i for i in range(3) if mask & (1 << i)]
229+
reduced = {
230+
name: (coords[0], coords[1], coords[2], coords[3], tuple(coords[4][i] for i in kept_indices))
231+
for name, coords in full.items()
232+
}
233+
if separates(reduced):
234+
minimal_subsets.append([components[i] for i in kept_indices])
235+
minimal_subsets = [subset for subset in minimal_subsets if not any(
236+
set(other) < set(subset) for other in minimal_subsets
237+
)]
238+
239+
# Strictly finer than sigma at molecule scale?
240+
sigma_groups: dict[int, list[str]] = {}
241+
for name in states:
242+
if name.startswith("molecule:"):
243+
sigma_groups.setdefault(states[name].coordinates[4], []).append(name)
244+
finer_than_sigma = all(
245+
len({tuple_for(name) for name in group}) == len(group)
246+
for group in sigma_groups.values()
247+
if len(group) > 1
248+
)
249+
250+
# Alternative declared structure: electron-configuration occupancy sums.
251+
def occupancy(symbol: str) -> tuple[int, ...]:
252+
import re
253+
config = _BY_SYMBOL[symbol]["electron_configuration"]
254+
config = config.replace("[Ne].", "1s2.2s2.2p6.")
255+
shells = config.split(".")
256+
return tuple(int(re.findall(r"\d+$", part)[0]) for part in shells)
257+
258+
def occupancy_sum(formula: str) -> tuple[int, ...]:
259+
total: list[int] = []
260+
for symbol in dict(LOCKED_FORMULAS)[formula]:
261+
occ = occupancy(symbol)
262+
while len(total) < len(occ):
263+
total.append(0)
264+
for i, value in enumerate(occ):
265+
total[i] += value
266+
return tuple(total)
267+
268+
alternative = {
269+
name: occupancy_sum(name.split(":", 1)[1]) if name.startswith("molecule:") else occupancy(name.split(":", 1)[1])
270+
for name in states
271+
if ":" in name
272+
}
273+
alt_separates = separates(alternative)
274+
275+
return {
276+
"full_tuple_separates": full_separates,
277+
"component_drops": drops,
278+
"minimal_among_three_components": minimal,
279+
"minimal_subsets": minimal_subsets,
280+
"period_necessary": all("period" in subset for subset in minimal_subsets) if minimal_subsets else None,
281+
"strictly_finer_than_sigma_at_molecule_scale": finer_than_sigma,
282+
"alternative_electron_occupancy_separates": alt_separates,
283+
"is_chemistry_identifier": True,
284+
"verdict": (
285+
"not minimal: valence and group are each dispensable, while "
286+
"period is necessary; minimal subsets are exactly "
287+
f"{minimal_subsets}; the tuple is a chemistry identifier and "
288+
"its separating power is B + layer + period plus one of "
289+
"{group, valence}"
290+
),
291+
}
292+
293+
177294
def _transition_closure_beyond_nine() -> dict[str, Any]:
178295
return {
179296
"status": "UNRESOLVED",
@@ -313,6 +430,7 @@ def build_carrier_falsification() -> dict[str, Any]:
313430
sigma_removal = _sigma_removal(states)
314431
sigma_replacement = _sigma_replacement(states)
315432
sigma_identity = _sigma_identity_serialization_audit(states)
433+
replacement_minimality = _replacement_minimality_audit(states)
316434
minkowski = _minkowski_field_work(states)
317435

318436
payload = {
@@ -322,6 +440,7 @@ def build_carrier_falsification() -> dict[str, Any]:
322440
"sigma_removal": sigma_removal,
323441
"sigma_replacement": sigma_replacement,
324442
"sigma_identity_serialization_audit": sigma_identity,
443+
"replacement_minimality_audit": replacement_minimality,
325444
"transition_closure_beyond_nine": _transition_closure_beyond_nine(),
326445
"unseen_states_independent_b": _unseen_states_independent_b(),
327446
"minkowski_field_work": minkowski,

‎research/epac/tests/test_epac_carrier_falsification.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
# timeout: 10
3131
# mutates: none
3232
# cleanup: none
33+
#
34+
# id: check_carrier_falsification_replacement_minimality
35+
# proves: carrier_falsification_replacement_minimality
36+
# call: self::test_replacement_minimality
37+
# requires: python3
38+
# timeout: 10
39+
# mutates: none
40+
# cleanup: none
3341
# === END CHECKS ===
3442

3543
from __future__ import annotations
@@ -72,3 +80,18 @@ def test_does_not_import_epac_upward() -> None:
7280
assert independence["pcea_derives_richer_structure_independently"] is False
7381
assert report["schema"] == SCHEMA
7482
assert report["receipt_sha256"]
83+
84+
85+
def test_replacement_minimality() -> None:
86+
report = build_carrier_falsification()
87+
audit = report["replacement_minimality_audit"]
88+
assert audit["full_tuple_separates"] is True
89+
# not minimal: group and valence are each dispensable
90+
assert audit["minimal_among_three_components"] is False
91+
assert audit["period_necessary"] is True
92+
minimal_subsets = {tuple(sorted(subset)) for subset in audit["minimal_subsets"]}
93+
assert minimal_subsets == {("group", "period"), ("period", "valence_electrons")}
94+
# period drop is the one that breaks separation
95+
assert audit["component_drops"]["period"]["separation_survives"] is False
96+
assert audit["strictly_finer_than_sigma_at_molecule_scale"] is True
97+
assert audit["alternative_electron_occupancy_separates"] is False

0 commit comments

Comments
 (0)