"""Executable examples for Chapters 13-16. Shows (a) what the engine records when Isabelle and SageMath are absent and (b) the L0 declared-binding audit for three Lorentz claims. Run from the repository root: PYTHONPATH=src uv run python content/examples/math/tool-chapters/ch13_16_probe_and_audit_demo.py Illustrative teaching script, not an evidence-bundle producer. """ from pathlib import Path from math_engine.adapters.external import ExternalProofAdapter, default_tool_specs from math_engine.equivalence import audit_claim_bindings from math_engine.experiments.lorentz import load_math01_claims from math_engine.models import Claim root = Path(__file__).resolve().parents[3] print("== Chapters 13/14: probes for tools that may be absent") claims = {c.claim_id: c for c in load_math01_claims(root)} for spec in default_tool_specs(): if spec.system not in ("isabelle", "sagemath"): continue adapter = ExternalProofAdapter(spec) cap = adapter.probe() print(spec.system, "available:", cap.available, "| reason:", cap.reason) if spec.claim_id: r = adapter.verify(claims[spec.claim_id], root) print(" ", r.result_id, "|", r.status.value, "|", r.execution_status.value) print("== Chapter 15: L0 declared-binding audit") for name in ("lorentz-algebraic", "gamma-relation-1.1.0", "lorentz-physical-1.1.0"): path = root / "experiments/relativity/special" / f"{name}.claim.json" claim = Claim.model_validate_json(path.read_text(encoding="utf-8")) print(claim.key) for f in audit_claim_bindings(claim): print(" ", f.left_binding, "<->", f.right_binding, f.conclusion, list(f.mismatches), len(f.unresolved_obligations))