What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)
Independent Mathematical Read-Back: Thm_NishtAbel2024_lemma_1_and_theorem_1.lean
The declaration NishtAbel2024.lemma_1_and_theorem_1 asserts the conjunction P1∧P2∧P3 of three propositions concerning invocation graphs, ordinal tuples, and the size-change termination (SCT) call relation.
Underlying Definitions.
- Edge labels and invocation graphs: An edge relation label r∈{lt,le} represents either a strict inequality (<) or a weak inequality (≤). Sequential composition of edge labels is defined by r1\fatsemir2=lt if r1=lt or r2=lt, and le\fatsemile=le. Combining optional edge labels o1⊕o2 yields some(lt) if either argument is some(lt), else some(le) if either argument is some(le), and none if both are none.
- An invocation graph G=(p,q,E) (
InvGraph) consists of a left arity p∈N, a right arity q∈N, and a finite list of directed labeled edges E∈List(N×N×{lt,le}). For any indices i,j∈N, the effective edge lookup G.edgeAt(i,j)∈Option{lt,le} filters E for all triples (i′,j′,r) with i′=i and j′=j and folds ⊕ over their labels starting from none (so lt dominates le when multiple edges share the same endpoints).
- Given p,q∈N and a lookup function L:N→N→Option{lt,le}, the canonical edge list canonicalEdges(p,q,L) enumerates i=0,…,p−1 and j=0,…,q−1 in order, emitting (i,j,r) whenever L(i,j)=some(r). The normalization of G=(p,q,E) is G.normalize=(p,q,canonicalEdges(p,q,G.edgeAt)).
- The composition G1∘G2 (
G₁.comp G₂) of two invocation graphs G1=(p1,q1,E1) and G2=(p2,q2,E2) is the invocation graph (p1,q2,canonicalEdges(p1,q2,LG1,G2)), where for each i,j∈N, LG1,G2(i,j) folds over k=0,1,…,q1−1, combining some(r1\fatsemir2) via ⊕ (starting from none) for every k<q1 such that G1.edgeAt(i,k)=some(r1) and G2.edgeAt(k,j)=some(r2).
- Graph conformance: Given any type S, binary relations <S,≤S on S, an invocation graph G=(p,q,E), and lists s,s′∈ListS, the conformance relation ConformsToGraph(<S,≤S,G,s,s′) holds if and only if:
- ∣s∣=p and ∣s′∣=q, and
- for all natural numbers i<∣s∣ and j<∣s′∣, if G.edgeAt(i,j)=some(lt) then s[i]<Ss′[j], and if G.edgeAt(i,j)=some(le) then s[i]≤Ss′[j].
- Size ordinals: A size ordinal α=(t,o)∈SizeOrd is a pair of natural numbers t,o∈N (representing tier t and offset o, corresponding to ω⋅t+o<ω2). They are ordered lexicographically:
α<ordβ⟺α.tier<β.tier∨(α.tier=β.tier∧α.offset<β.offset),
α≤ordβ⟺α.tier<β.tier∨(α.tier=β.tier∧α.offset≤β.offset).
For lists of size ordinals βs,αs∈ListSizeOrd, OrdConformsToGraph(G,βs,αs) is defined as ConformsToGraph(<ord,≤ord,G,βs,αs).
- Invocation graph families and SCT validity: Function names are natural numbers (FunName=N). An invocation graph family G=(arity,graphs) (
InvGraphFamily) consists of a total arity assignment arity:N→N and a total assignment graphs:N→N→ListInvGraph.
- G is arity-well-formed (G.ArityWf) if:
- there exists a finite domain list dom∈ListN such that for all f,g∈N, whenever G.graphs(f,g)=[], both f∈dom and g∈dom; and
- for all f,g∈N and every G∈G.graphs(f,g), G.leftArity=G.arity(g), G.rightArity=G.arity(f), and G=G.normalize.
- The closure InvGraphClosure(G,f,g,G) is the smallest relation on N×N×InvGraph such that: (i) if G∈G.graphs(f,g), then InvGraphClosure(G,f,g,G.normalize) holds; and (ii) if InvGraphClosure(G,h,g,G1) and InvGraphClosure(G,f,h,G2) hold, then InvGraphClosure(G,f,g,G1∘G2) holds.
- G is SCT-valid (SCTValid(G)) if G.ArityWf holds and for every function name f∈N and every graph G, whenever InvGraphClosure(G,f,f,G) holds and G∘G=G (equality of
InvGraph structures), there exists an index k<G.leftArity such that G.edgeAt(k,k)=some(lt).
- An SCT state is a pair (f,αs)∈N×ListSizeOrd. A step SCTStep(G,(f,αs),(g,βs)) holds if there exists G∈G.graphs(f,g) such that OrdConformsToGraph(G,βs,αs) holds. The call relation is SCTCallRel(G,u,v)⟺SCTStep(G,v,u).
Statement of the Three Conjuncts.
- First Conjunct (P1): For every type S (in
Type 0), all binary relations <S,≤S:S→S→Prop satisfying:
- ∀x,y∈S,x<Sy⟹x≤Sy,
- ∀x,y,z∈S,x≤Sy⟹y≤Sz⟹x≤Sz,
- ∀x,y,z∈S,x<Sy⟹y≤Sz⟹x<Sz,
- ∀x,y,z∈S,x≤Sy⟹y<Sz⟹x<Sz,
and for all invocation graphs G1,G2∈InvGraph and all lists a,b,c∈ListS, if ConformsToGraph(<S,≤S,G1,a,b) and ConformsToGraph(<S,≤S,G2,b,c) hold, then ConformsToGraph(<S,≤S,G1∘G2,a,c) holds.
- Second Conjunct (P2): For every initial invocation graph G1∈InvGraph, list of invocation graphs Gs∈ListInvGraph, endpoint size-ordinal lists s0,sn∈ListSizeOrd, and list of intermediate size-ordinal lists mid∈List(ListSizeOrd), let graphs=G1::Gs and chain=[s0]++mid++[sn]. If ∣mid∣=∣Gs∣ and for every k∈N with k<∣graphs∣ (and k<∣chain∣, k+1<∣chain∣),
OrdConformsToGraph(graphs[k],chain[k],chain[k+1])
holds, then OrdConformsToGraph(foldl(∘,G1,Gs),s0,sn) holds, where foldl(∘,G1,[G2,…,Gm])=(⋯((G1∘G2)∘G3)⋯∘Gm).
3. Third Conjunct (P3): For every invocation graph family G∈InvGraphFamily, if SCTValid(G) holds, then the relation SCTCallRel(G) is well-founded (i.e., there exists no infinite sequence of states (f0,αs0),(f1,αs1),(f2,αs2),… in N×ListSizeOrd such that SCTStep(G,(fm,αsm),(fm+1,αsm+1)) holds for all m∈N).
Edge Cases and Notes.
- Degenerate empty list in P2: When Gs=[] and mid=[], graphs=[G1], chain=[s0,sn], and foldl(∘,G1,[])=G1, so P2 reduces directly to the hypothesis at k=0.
- Zero-arity graphs in P3: If G has a self-loop G∈G.graphs(f,f) on a function f with G.arity(f)=0, then G=(0,0,[]) satisfies G∘G=G, and the condition ∃k<0,G.edgeAt(k,k)=some(lt) in
SCTValid is impossible, so SCTValid forbids self-loops on 0-arity functions.
Confirmed by the moderator at approval.