Skip to content

R-11: Alethe walker cong over built-in operators (not / + / <=) - #63

Merged
levineuwirth merged 1 commit into
mainfrom
rocq-walker-r11-cong-operators
May 30, 2026
Merged

R-11: Alethe walker cong over built-in operators (not / + / <=)#63
levineuwirth merged 1 commit into
mainfrom
rocq-walker-r11-cong-operators

Conversation

@levineuwirth

Copy link
Copy Markdown
Owner

R-11 — cong over built-in operators (the payoff)

Eleventh PR of the Rocq walker port arc (mirror of Lean #51). Real cvc5 LIA traces use cong to lift argument equalities through built-in operators (not, +, <=), not just UF symbols. This is the congruence shape that lets a real alethe-2024 trace walk end-to-end instead of falling through to lia — the capability the whole arc was building toward, now live via the R-9 closer wiring.

No elaborator change needed

The plan budgeted a Constr-level refactor of elab_cong here, but it landed early in R-5: Coq has no mkCongr, so elab_cong was open-coded at the Constr level from the start — translate LHS/RHS via sexp_to_constr, peel the app spine via decompose_app, per-argument f_equal + eq_trans chain. Operator heads (Zadd/Zle/not) decompose exactly like UF heads; there is no UF-specific assumption anywhere in the elaborator. So R-11 is purely the tests that confirm the operator cases.

Three tests (all axiom-free)

  • cong over not — unary, Prop → Prop: (~a) = (~b) from a = b
  • cong over + — binary over Z: x + z = y + w from x = y, z = w
  • cong over <= — binary, predicate-valued (result type Prop); the constant 5 position is carried by a refl premise

cong is f_equal/eq_trans/eq_refl throughout, so the footprint stays empty [].

This unlocks R-12 (snapshot test against a verbatim cvc5 trace), where the full operator+clausal+arithmetic pipeline walks a real refutation.

🤖 Generated with Claude Code

Mirror of Lean #51. Real cvc5 LIA traces use [cong] to lift
argument equalities through built-in operators (not / + / <=),
not just UF symbols. This is the congruence shape that lets a real
alethe-2024 trace walk end-to-end instead of falling through to
lia -- the capability the whole arc was building toward, now
wired live via R-9.

No elaborator change was needed. The plan budgeted a Constr-level
refactor of elab_cong here, but it landed early in R-5: because
Coq has no mkCongr, elab_cong was open-coded at the Constr level
from the start (translate LHS/RHS via sexp_to_constr, peel the
app spine via decompose_app, per-argument f_equal + eq_trans
chain). Operator heads (Zadd / Zle / not) decompose exactly like
UF heads -- no UF-specific assumption anywhere in the elaborator.

Three tests confirm the operator cases:
- cong over not (unary, Prop -> Prop)
- cong over + (binary over Z)
- cong over <= (binary, predicate-valued: result type Prop, the
  constant arg carried by a refl premise)
All axiom-free (cong is f_equal / eq_trans / eq_refl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@levineuwirth
levineuwirth merged commit 91a7b2c into main May 30, 2026
6 checks passed
@levineuwirth
levineuwirth deleted the rocq-walker-r11-cong-operators branch August 31, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant