Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5.5 (All-candidate invariant): continuations preserve Reg\mathrm{Reg}Reg, and every candidate prefix is represented

Proved
TreeEquivalenceHORS.Equivalence.lemma_5_5

by mikedeng1 · Nov 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

compilerslogical-relationsp2o-batch-stoc27ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let G=GM⋄G=G^\diamond_MG=GM⋄​.

  1. Let i∈IMi\in I_Mi∈IM​ be a nonhalting state and t⃗\vec tt a closed argument tuple. One head step of Fi t⃗F_i\,\vec tFi​t gives b z c1 c2b\,z\,c_1\,c_2bzc1​c2​ with continuations ce=Fie^ t⃗ec_e=F_{\widehat{i_e}}\,\vec t_ece​=Fie​​​te​ (Figure 3). If Regm(t⃗;A,B,W)\mathrm{Reg}_m(\vec t;A,B,W)Regm​(t;A,B,W) holds, then each continuation argument tuple t⃗e\vec t_ete​ satisfies Regm+1\mathrm{Reg}_{m+1}Regm+1​ at the natural pairs ReR_eRe​ updated by Equation (21), for both choices e∈{1,2}e\in\{1,2\}e∈{1,2}.
  2. Hence every finite candidate prefix v∈CMv\in C_Mv∈CM​ has such a representation: the argument tuple reached along vvv from the start rule satisfies Reg∣v∣\mathrm{Reg}_{|v|}Reg∣v∣​ at the natural pairs reached along vvv.

There is no legality or nonzero-weight hypothesis: illegal candidates and zero weights are covered.

Differences from the source:

  • reading: "each continuation of the corresponding nonhalting state rule satisfies Reg_{m+1} for its updated natural pairs"; "every finite candidate prefix has such a representation" → the continuations are named explicitly: one head step of F_i t⃗ yields b z (F_{î₁} t⃗₁) (F_{î₂} t⃗₂) with t⃗_e = contArgs i e t⃗ (Figure 3), and Reg_{m+1}(t⃗_e; R_e) for each e; the representation of a candidate v is the tuple argsAlong v reached from the start rule, with Reg_{|v|}(argsAlong v; pairsAlong v); reason: makes the objects "continuation" and "representation" of the sentence concrete; the head-step clause is a fact about the Figure 3 templates
Preamble
import Mathlib
import Definitions.Def_TreeEquivalenceHORS_Equivalence_Compiler
Formal statement
namespace TreeEquivalenceHORS.Equivalence

/-- **Lemma 5.5 (All-candidate invariant)** (printed p. 19 / PDF p. 21). Let `G = G^⋄_M`. For a
nonhalting state `i ∈ I_M`, one head step of the call `Fᵢ t⃗` yields `b z c₁ c₂` whose
continuations are `c_e = F_{î_e} t⃗_e` with `t⃗_e = contArgs i e t⃗`; if `Reg_m(t⃗; A, B, W)` holds,
each continuation satisfies `Reg_{m+1}` at the updated natural pairs `R_e` of Equation (21). Hence
every finite candidate prefix `v ∈ C_M` has such a representation: the argument tuple reached
along `v` from the start rule satisfies `Reg_{|v|}` at the pairs reached along `v`. -/
theorem lemma_5_5 (side : Side) (M : Machine) :
    let G := compile side M
    (∀ (m i : ℕ) (t : StateArgs) (R : PairState), M.Active i → Reg G m t R →
      G.headStep (Tm.apps (.nt (iF i)) t.toList) =
          some (Tm.apps tb [tz, callF M (M.nextPos i .one) (M.contArgs i .one t).toList,
            callF M (M.nextPos i .two) (M.contArgs i .two t).toList]) ∧
        ∀ e : Choice, Reg G (m + 1) (M.contArgs i e t) (M.pairStep m i e R)) ∧
    (∀ v : List Choice, M.IsCand v → Reg G v.length (M.argsAlong v) (M.pairsAlong v)) := by sorry

end TreeEquivalenceHORS.Equivalence
Source
Mingkun Xiao, Yixuan Sun, Tree Equivalence of Higher-Order Recursion Schemes Is Undecidable, STOC 2027 submission #421 (October 2026), source.pdf SHA-256 e875d09ced029e3f5cb114abba049e4a2b1bdaa9b064c98b0d71f2ec7451c7af, Lemma 5.5, printed p. 19 / PDF p. 21
Human review
  • Endorsed by Shuze Chen · Nov 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Nov 8, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me