Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/bpd-lg02-kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: BPD-LG-02 counterfactual Lean kernel and refutation audit

on:
push:
paths:
- 'experiments/bpd_lean_curriculum_v2/**'
- '.github/workflows/bpd-lg02-kernel.yml'
pull_request:
paths:
- 'experiments/bpd_lean_curriculum_v2/**'
- '.github/workflows/bpd-lg02-kernel.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
six-file-kernel-audit:
runs-on: ubuntu-24.04
timeout-minutes: 18
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Independently audit every finite model and export source
run: |
python -m unittest experiments.bpd_lean_curriculum_v2.test_generate -v
python -m experiments.bpd_lean_curriculum_v2.generate --out /tmp/bpd-lg02
- name: Install pinned Lean 4.19.0
run: |
curl --fail --location --retry 3 https://github.com/leanprover/lean4/releases/download/v4.19.0/lean-4.19.0-linux.tar.zst -o /tmp/lean.tar.zst
tar --zstd -xf /tmp/lean.tar.zst -C /tmp
echo '/tmp/lean-4.19.0-linux/bin' >> "$GITHUB_PATH"
- name: Kernel-check all 192 proof witnesses and 192 negative refutations
run: |
python -m experiments.bpd_lean_curriculum_v2.verify_kernel --source-dir /tmp/bpd-lg02
- name: Archive source, all six axiom outputs and exact receipts
if: always()
uses: actions/upload-artifact@v4
with:
name: bpd-lg02-six-file-lean-${{ github.run_id }}
path: /tmp/bpd-lg02/
retention-days: 30
if-no-files-found: warn
22 changes: 22 additions & 0 deletions experiments/bpd_lean_curriculum_v2/KERNEL_AUDIT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# BPD-LG-02 independent six-file Lean kernel audit

**Date:** 2026-11-15. **Evidence:** [EvalMath CI run 43705790859](https://github.com/MoralityLabAI/EvalMath/actions/runs/43705790859). Public independent replay of the same generator blobs committed in the private LoopedTransformers branch.

- Exact source: EvalMath branch commit `a3032ba2055bd4847075bf8531fa133daecb18fb`.
- Lean: `Lean (version 4.19.0, x86_64-unknown-linux-gnu, commit 6caaee842e94, Release)`.
- All 7 independent Python source tests passed.
- 384 generated examples: 256 train, 64 dev, 64 test.
- **192 positive theorem scripts** and **192 negative refutation theorems** kernel-checked, six Lean source files.
- **384/384 empty axiom inventories**, each checked individually with `#print axioms`.
- All structural-role digests were unique across cases and no digest/group crossed the train/dev/test boundary under the generator's declared normalization. This does **not** establish general graph-isomorphism or semantic disjointness.
- The negative theorem has the form `¬ (∀ parameters, premises → goal)`, witnessed by an explicit satisfying assignment that falsifies the goal. This gives a Lean kernel-checked negation for the original universal claim, not a proof of irrelevance of a particular model component.

| Split | Positive proofs | Negative refutations | Positive source SHA-256 | Refutation source SHA-256 |
|---|---:|---:|---|---|
| train | 128 | 128 | `cfc85e99132c536d29e3c63751446f746068c8c012f2647c8a8f1c56e5fd21fe` | `ad52ba622b846f9b8da54779c6e51e5b3eb41eda673d7402812569be82430ef8` |
| dev | 32 | 32 | `63d7c17ecdd0319a3a2ef582dd958c39caf84a066de4bcad7d59de58eaf687e8` | `0b148f8b033cb515e625c10ea86bef3c4ccd6961f991fa3dcec51d5f3a85654c` |
| test | 32 | 32 | `05cdfa2c84286c32c91205dc373ffcae757067a794c168c83b5098270dcbd407` | `99bfb562599a200fb8a3a58c72a51a58bfcb6c0255624da3f7c0860d8447807f` |

The first CI attempt caught a missing parenthesis around the final `rcases` conjunct. The second revealed a negative-induction theorem parser defect and an unwanted use of `propext` by `simp` in the refutation witnesses. Both issues were repaired before this independent successful replay. Negative refutations now use constructive proof terms built from `True.intro`, `False.elim`, `And.intro`, and `rfl`.

**Research boundary:** finite Horn/equality reasoning proofs are kernel-certified. The curriculum has never trained a BPD/VPD neural decomposition and cannot distinguish latent mechanisms without measured model interventions. The exact symbolic graph algorithm is an expected 100% baseline. The original BPD-LG-01 training/test split remained defective despite an earlier successful Lean proof audit.
58 changes: 58 additions & 0 deletions experiments/bpd_lean_curriculum_v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# BPD-LG-02: independent structural audit and repair of the Lean curriculum

**Status, 2026-11-15:** generator, finite-model checker, split audit, and seven independent CPU tests passed. [Independent Lean 4.19.0 replay](https://github.com/MoralityLabAI/EvalMath/actions/runs/43705790859) kernel-checked **192 positive proofs and 192 negative refutations**, with **384 empty axiom inventories**. See [KERNEL_AUDIT.md](KERNEL_AUDIT.md) for source hashes and claim boundaries. No neural training, BPD decomposition, or capability result is asserted.

## Why this exists

Fable's review of BPD-01 identified a failure in the original BPD-LG-01 corpus: its six roots per template varied only in binder names, the label was a directly accessible `critical` generator toggle, depth was irrelevant to `rw` and `induction` proof scripts, and the nuisance was an unused `(noise : Nat)` binder. The original kernel audit was valid for those synthetic statements and remains archived. The earlier corpus is **a failed mechanism-separation benchmark** even though its proofs compiled.

This successor builds distinct typed *premise graphs*, preserves multiple deceptive but valid hypotheses, and exports student-visible statements in a separate file from host-only labels and witnesses. Every negative replaces **an interior dependency** of a real proof chain and is accompanied by a fully enumerated satisfying interpretation of the premises with a false target. Some positive examples also lack the straightforward path and require an active detour through a distractor node. Every split contains both kinds of positive proof structures.

## Corpus contract

Four tactic-witness families are covered, with nominal depth 3–6 and six graph shapes per family/depth. For each shape the generator emits positive/negative minimal contrasts with two nuisance-graph variants: **384 cases** (192 label-positive and 192 label-negative), divided **256/64/64** train/dev/test. The split is by a digest of the **role-labelled structural scaffold**, before constructing minimal pairs. Every one of 96 structural groups stays in exactly one partition. Each source formula's role-labelled premise-graph digest is audited against every other split, producing 384 distinct fingerprints and zero cross-split duplicates in the present deterministic set.

The graph digest ignores theorem identifiers, renamed propositional/Nat variables and shuffled hypothesis binders. It preserves the source/target and dependency relation. This is a **conservative role-labelled structural normalization**, not a complete decision procedure for logical equivalence or arbitrary graph isomorphism. Do not claim the grammar is out-of-distribution in meaning without testing alternative structural baselines.

- `exact` uses a computed chain of real implications.
- `rw` uses a `calc` proof that rewrites each required equality; the number of rewrites grows with path length.
- `rcases` deconstructs a nested conjunction of shuffled implication premises before rebuilding the dependency chain.
- `induction` proves a property of arbitrary Nat-indexed predicates. The base case requires actual Horn-chain propagation, and the successor case uses a recurrent step from the prior proof; longer chains require more proof applications.

The visible payload has just `case_id` and `lean_statement`. It exposes no generator `critical`, `variant`, nuisance, or gold label flags. Host-only JSONL includes targets, finite countermodels, proofs, original role-graphs, and structural fingerprints. Model input code must read only `*_public.jsonl`, and any selection/evaluation process must treat `*_host.jsonl` as privileged scorer data.

No claim of tactic-family uniqueness is made. The family is one witness, and another tactic or a symbolic graph algorithm can solve these tasks. A straightforward BFS/union-find oracle has 100% correctness on this deterministic Horn/equality fragment. It is an **essential strong zero-neural baseline**; the generator itself computes such a label.

## Negative certificates

A positive Lean theorem is saved to `*_positives.lean`. Each negative's original universal claim is separately refuted in `*_refutations.lean`: an explicit interpretation of every theorem parameter satisfies its hypotheses while making its goal false. Proving the negation of a universal theorem is stronger evidence than checking only a Python Boolean countermodel. All six generated Lean files need independent kernel replay and axiom inventory checks.

For induction, the finite model assigns every Nat-indexed predicate a constant truth value. This is an explicit countermodel for **all** natural numbers rather than a bounded simulation of the induction statement. The finite proof generator still has to pass the Lean kernel before it can be called certified.

## Mechanism separation and the next experiment

The mathematical BPD-01 minimax and set-cover results remain correct. Their use as a decomposition claim depends on measured interventions. The original curriculum's contrast was insufficient to distinguish proof-chain following from noticing the only critical premise. BPD-LG-02 addresses obvious corpus shortcuts but **does not yet establish T1 separation of any two trained mechanisms**.

For a genuinely discriminative neural experiment, prespecify a base/unrolled-VPD/lookup/rotation-null comparison and a **fourth-family-held-out** test. Fit components from three of `exact`, `rw`, `rcases`, `induction`, then predict single-cut and joint-cut intervention effects on the fourth. Freeze per-pass readout labels at the *next readout*, track source and state separately, and run a cue-conflict swap: perturb carried state with input fixed, then perturb input with carried state fixed. Hold matched compute and rank; compare component stability across seeds. Preregister tolerances for continuous-state matching and report held-out predictive error over a tolerance sweep. The trivial discrete fibre-error floor from T3 is only a diagnostic of a specified information interface.

For an open-set decomposition, include an explicit `none of the candidates` outcome, measure whether the intervention coordinates are comparable, and require parsimony within each observational equivalence class. If routing depends on mechanism, treat the route as an observable response or a measured missingness channel.

FC-12's separate original MathCan training-incidence data and held-out source proofs remain unchanged. The Hall deficit applies to quota feasibility for *verified positive tactic edges*, whereas BPD-01's mechanism-pair cover optimizes causal distinguishability. Its 117 suggestions are unknown compiler outcomes and carry no estimated success rate from the current graph.

## Reproduce (without Lean)

```bash
python -m unittest experiments.bpd_lean_curriculum_v2.test_generate -v
python -m experiments.bpd_lean_curriculum_v2.generate --out /tmp/bpd-lg02
```

Then, with Lean 4.19.0 installed:

```bash
for s in train dev test; do
lean "/tmp/bpd-lg02/${s}_positives.lean"
lean "/tmp/bpd-lg02/${s}_refutations.lean"
done
```

The CI validator should also append `#print axioms` for each declaration to a *second* file and require every statement to be axiom-free. CI must report success by split and by sign, and archive original generated source digests, stdout/stderr, and failure receipts.
Loading
Loading