Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

M05 — Streaming accumulator invariant

Proved
VathekProof.M05_tile_accum_partition

by ajax · Sep 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

formal-verificationgradient-descentmachine-learning

The streaming accumulator computes plain finite sums, independent of the tile decomposition. For any two valid partitions B,B′\mathcal{B}, \mathcal{B}'B,B′ of the same occurrence set, the executable left-to-right fold over tiles — accumulating loss, direct gradient contribution, and shared cotangent — yields exactly

(∑i∈Iαivi,  ∑i∈Iαiai,  ∑i∈Iαici),\Big( \sum_{i \in I} \alpha_i v_i,\; \sum_{i \in I} \alpha_i a_i,\; \sum_{i \in I} \alpha_i c_i \Big),(i∈I∑​αi​vi​,i∈I∑​αi​ai​,i∈I∑​αi​ci​),

for both partitions alike, and it satisfies the prefix law: folding B1+B2\mathcal{B}_1 + \mathcal{B}_2B1​+B2​ is folding B1\mathcal{B}_1B1​ and continuing with B2\mathcal{B}_2B2​ from the intermediate accumulator. In exact arithmetic the accumulated result is therefore independent of tile order and of tile shape; a finite-precision schedule may differ, and that refinement is deliberately out of scope.

Preamble
import Definitions.Def_VathekFrame
import Definitions.Def_VathekState
import Definitions.Def_VathekAdamW
import Definitions.Def_VathekWitness
Formal statement
namespace VathekProof

/-- **M05 — Streaming accumulator invariant.**  The executable left-to-right fold over
the tiles (loss, direct gradient, shared cotangent) equals, after every prefix, the
plain finite sums over the occurrences visited; consequently in exact arithmetic the
accumulated result is independent of the tile decomposition and of the tile order:
any two valid partitions of the same occurrence set give the same accumulator. -/
theorem M05_tile_accum_partition {ι : Type*} [DecidableEq ι] {W V : Type*}
    [NormedAddCommGroup W] [NormedAddCommGroup V] [NormedSpace ℝ W] [NormedSpace ℝ V]
    {I : Finset ι}
    {ℬ ℬ' : List (Finset ι)} (α : ι → ℝ) (val : ι → ℝ) (a : ι → W) (c : ι → V)
    (h : IsTilePartition I ℬ) (h' : IsTilePartition I ℬ') :
    tileAccum α val a c ℬ = tileAccum α val a c ℬ'
    ∧ (tileAccum α val a c ℬ).loss = ∑ i ∈ I, α i * val i
    ∧ (tileAccum α val a c ℬ).direct = ∑ i ∈ I, α i • a i
    ∧ (tileAccum α val a c ℬ).shared = ∑ i ∈ I, α i • c i
    ∧ ∀ ℬ₁ ℬ₂ : List (Finset ι),
        tileAccum α val a c (ℬ₁ ++ ℬ₂)
          = tileAccumFold α val a c ℬ₂ (tileAccum α val a c ℬ₁) := by sorry

end VathekProof
Source
Vathek Graft: A Proof and Evidence Programme, mission-source white paper v1.0, 22 September 2026 (Thomas Davis). Section 4.4 (streaming accumulator) and Section 6, milestone M05.
Read-back

What the Lean code literally says, in plain math · glm-5.3 (independent auditor subagent)

{"text": "{\n "data": "Declaration (single theorem). Let iota\\\\iotaiota be an arbitrary type equipped with decidable equality (this assumption underwrites the finite-set union appearing below), and let WWW and VVV be arbitrary types carrying the structure of real normed vector spaces \u2014 a normed abelian group with a compatible mathbbR\\\\mathbb{R}mathbbR-scalar multiplication; only the induced addition, zero, and scalar multiplication appear in the assertion itself, the norm plays no role. Universally quantified over all of these, and over:\n\n- a finite set IsubseteqiotaI \\\\subseteq \\\\iotaIsubseteqiota (the occurrence set);\n- two finite lists of finite subsets of iota\\\\iotaiota, mathcalB=[B1,dots,Bk]\\\\mathcal{B} = [B_1, \\\\dots, B_k]mathcalB=[B1​,dots,Bk​] and mathcalB′=[B1′,dots,Bk′′]\\\\mathcal{B}' = [B'_1, \\\\dots, B'_{k'}]mathcalB′=[B1′​,dots,Bk′′​] (the tile lists);\n- functions alpha:iotatomathbbR\\\\alpha : \\\\iota \\\\to \\\\mathbb{R}alpha:iotatomathbbR (weights), mathrmval:iotatomathbbR\\\\mathrm{val} : \\\\iota \\\\to \\\\mathbb{R}mathrmval:iotatomathbbR (values), a:iotatoWa : \\\\iota \\\\to Wa:iotatoW and c:iotatoVc : \\\\iota \\\\to Vc:iotatoV (per-occurrence contributions),\n\nthe theorem assumes, as hypotheses hhh and h′h'h′, that each of mathcalB\\\\mathcal{B}mathcalB and mathcalB′\\\\mathcal{B}'mathcalB′ is a valid tile partition of III, which literally means two things: first,\n

B1cupB2cupcdotscupBk;=;IB_1 \\\\cup B_2 \\\\cup \\\\cdots \\\\cup B_k \\\\;=\\\\; IB1​cupB2​cupcdotscupBk​;=;I

\n(the fold of set union over the list, starting from emptyset\\\\emptysetemptyset, equals III exactly \u2014 so every tile is contained in III and every element of III lies in some tile); and second, the list is pairwise disjoint: any two tiles occupying distinct positions in the list are disjoint finite sets, i.e. no index belongs to two different tiles of the list. Together these force every iinIi \\\\in IiinI to lie in exactly one tile of mathcalB\\\\mathcal{B}mathcalB (and exactly one of mathcalB′\\\\mathcal{B}'mathcalB′). What the quantifier thereby silently includes: empty tiles are permitted, in any number and at any position (an empty tile is disjoint from everything and does not change the union); a nonempty tile cannot appear twice in one list, since it is not disjoint from itself; the empty list is a valid partition only of I=emptysetI = \\\\emptysetI=emptyset; and the hypotheses are always satisfiable (e.g. the one-tile list [I][I][I]), so the statement is not vacuous. In particular mathcalB\\\\mathcal{B}mathcalB and mathcalB′\\\\mathcal{B}'mathcalB′ may differ in the number of tiles, in the tiles themselves, and in their order.\n\nThe constructions the assertion refers to, unfolded: an accumulator is a triple with three data fields and nothing else,\n

x;=;big(,x.mathrmlossinmathbbR,;;x.mathrmdirectinW,;;x.mathrmsharedinV,big)x \\\\;=\\\\; \\\\big(\\\\, x.\\\\mathrm{loss} \\\\in \\\\mathbb{R},\\\\;\\\\; x.\\\\mathrm{direct} \\\\in W,\\\\;\\\\; x.\\\\mathrm{shared} \\\\in V \\\\,\\\\big)x;=;big(,x.mathrmlossinmathbbR,;;x.mathrmdirectinW,;;x.mathrmsharedinV,big)

\n(a running weighted loss, a running direct parameter-gradient contribution, and a running shared-state contribution). One streaming step over a finite tile BsubseteqiotaB \\\\subseteq \\\\iotaBsubseteqiota sends\n

x;mapsto;Big(x.mathrmloss+sumiinBalphai,mathrmvali,quadx.mathrmdirect+sumiinBalphaicdotai,quadx.mathrmshared+sumiinBalphaicdotciBig),x \\\\;\\\\mapsto\\\\; \\\\Big( x.\\\\mathrm{loss} + \\\\sum_{i \\\\in B} \\\\alpha_i \\\\, \\\\mathrm{val}_i,\\\\quad x.\\\\mathrm{direct} + \\\\sum_{i \\\\in B} \\\\alpha_i \\\\cdot a_i,\\\\quad x.\\\\mathrm{shared} + \\\\sum_{i \\\\in B} \\\\alpha_i \\\\cdot c_i \\\\Big),x;mapsto;Big(x.mathrmloss+sumiinB​alphai​,mathrmvali​,quadx.mathrmdirect+sumiinB​alphai​cdotai​,quadx.mathrmshared+sumiinB​alphai​cdotci​Big),

\nwhere the sums are finite sums over the finite set BBB (an empty sum is 000), alphai,mathrmvali\\\\alpha_i\\\\,\\\\mathrm{val}_ialphai​,mathrmvali​ is an ordinary product in mathbbR\\\\mathbb{R}mathbbR, and cdot\\\\cdotcdot is the mathbbR\\\\mathbb{R}mathbbR-scalar multiplication on WWW and on VVV; the data (alpha,mathrmval,a,c)(\\\\alpha, \\\\mathrm{val}, a, c)(alpha,mathrmval,a,c) is fixed for the whole computation \u2014 no field is updated between tiles. The fold processes a tile list strictly left to right (the head tile is consumed first, then the tail), returning its starting accumulator unchanged on the empty list. Write A(mathcalC)A(\\\\mathcal{C})A(mathcalC) for the fold over the list mathcalC\\\\mathcal{C}mathcalC started from the zero accumulator (0,0,0)(0,0,0)(0,0,0), and operatornameFold(mathcalC,x)\\\\operatorname{Fold}(\\\\mathcal{C}, x)operatornameFold(mathcalC,x) for the same fold started from an arbitrary accumulator xxx.\n\nUnder these hypotheses the theorem asserts the conjunction of five claims:\n\n1. Order- and decomposition-independence. A(mathcalB)=A(mathcalB′)A(\\\\mathcal{B}) = A(\\\\mathcal{B}')A(mathcalB)=A(mathcalB′). This is an equality of accumulator structures; since an accumulator is nothing but the three data components above, it holds exactly when all three fields agree \u2014 A(mathcalB).mathrmloss=A(mathcalB′).mathrmlossA(\\\\mathcal{B}).\\\\mathrm{loss} = A(\\\\mathcal{B}').\\\\mathrm{loss}A(mathcalB).mathrmloss=A(mathcalB′).mathrmloss in mathbbR\\\\mathbb{R}mathbbR, A(mathcalB).mathrmdirect=A(mathcalB′).mathrmdirectA(\\\\mathcal{B}).\\\\mathrm{direct} = A(\\\\mathcal{B}').\\\\mathrm{direct}A(mathcalB).mathrmdirect=A(mathcalB′).mathrmdirect in WWW, and A(mathcalB).mathrmshared=A(mathcalB′).mathrmsharedA(\\\\mathcal{B}).\\\\mathrm{shared} = A(\\\\mathcal{B}').\\\\mathrm{shared}A(mathcalB).mathrmshared=A(mathcalB′).mathrmshared in VVV. Because mathcalB′\\\\mathcal{B}'mathcalB′ may be any valid partition of III \u2014 a coarser or finer decomposition, or a reordering of mathcalB\\\\mathcal{B}mathcalB (a reordering is again a valid partition) \u2014 this says the final accumulator is the same whatever the tile decomposition and whatever the order of the tiles.\n\n2. Loss field equals the plain sum. A(mathcalB).mathrmloss=displaystylesumiinIalphai,mathrmvaliA(\\\\mathcal{B}).\\\\mathrm{loss} = \\\\displaystyle\\\\sum_{i \\\\in I} \\\\alpha_i \\\\, \\\\mathrm{val}_iA(mathcalB).mathrmloss=displaystylesumiinI​alphai​,mathrmvali​: the tile-by-tile streamed accumulation of the loss reproduces the single finite sum over all of III.\n\n3. Direct field equals the plain sum. A(mathcalB).mathrmdirect=displaystylesumiinIalphaicdotaiA(\\\\mathcal{B}).\\\\mathrm{direct} = \\\\displaystyle\\\\sum_{i \\\\in I} \\\\alpha_i \\\\cdot a_iA(mathcalB).mathrmdirect=displaystylesumiinI​alphai​cdotai​ in WWW.\n\n4. Shared field equals the plain sum. A(mathcalB).mathrmshared=displaystylesumiinIalphaicdotciA(\\\\mathcal{B}).\\\\mathrm{shared} = \\\\displaystyle\\\\sum_{i \\\\in I} \\\\alpha_i \\\\cdot c_iA(mathcalB).mathrmshared=displaystylesumiinI​alphai​cdotci​ in VVV.\n\nClaims 2\u20134 are stated only for the list mathcalB\\\\mathcal{B}mathcalB; by claim 1 they hold verbatim with mathcalB\\\\mathcal{B}mathcalB replaced by mathcalB′\\\\mathcal{B}'mathcalB′.\n\n5. Prefix (splitting) law. For all lists of finite subsets mathcalB1,mathcalB2\\\\mathcal{B}_1, \\\\mathcal{B}_2mathcalB1​,mathcalB2​ of iota\\\\iotaiota \u2014 arbitrary lists carrying no partition, disjointness, or subset assumption whatsoever (repetitions and overlapping tiles included), so this clause does not depend on the hypotheses h,h′h, h'h,h′ at all \u2014\n

Abig(mathcalB1mathbin+!!+mathcalB2big);=;operatornameFoldbig(mathcalB2,;A(mathcalB1)big),A\\\\big(\\\\mathcal{B}_1 \\\\mathbin{+\\\\!\\\\!+} \\\\mathcal{B}_2\\\\big) \\\\;=\\\\; \\\\operatorname{Fold}\\\\big(\\\\mathcal{B}_2,\\\\; A(\\\\mathcal{B}_1)\\\\big),Abig(mathcalB1​mathbin+!!+mathcalB2​big);=;operatornameFoldbig(mathcalB2​,;A(mathcalB1​)big),

\nwhere mathbin+!!+\\\\mathbin{+\\\\!\\\\!+}mathbin+!!+ is concatenation of lists: folding over the concatenated stream in one pass from zero yields the same accumulator (again, field by field, all three components) as first folding over the first block from zero and then resuming the fold over the second block from that intermediate checkpoint. Its endpoint instances are degenerate and hold by the definition of the fold alone (mathcalB1\\\\mathcal{B}_1mathcalB1​ empty: both sides are A(mathcalB2)A(\\\\mathcal{B}_2)A(mathcalB2​); mathcalB2\\\\mathcal{B}_2mathcalB2​ empty: both sides are A(mathcalB1)A(\\\\mathcal{B}_1)A(mathcalB1​)).\n\nEdge cases of the whole statement: if I=emptysetI = \\\\emptysetI=emptyset, every valid partition consists only of empty tiles (or is the empty list), all finite sums vanish, and claims 1\u20134 reduce to saying the resulting accumulator is (0,0,0)(0,0,0)(0,0,0) in each field; claim 5, being quantified over all tile lists, holds regardless of III. No metric, limit, or analytic operation occurs anywhere in the assertion \u2014 it is a statement about finite sums, additions, and scalar multiples in mathbbR\\\\mathbb{R}mathbbR, WWW, and VVV."\n}", "details": {"resolvedPath": "/home/ajax/.omp/agent/sessions/-math/2026-09-22T19-31-08-510Z_01a0ca99-be5e-7000-93c6-dac7c74cc004/RB-M05.md", "contentType": "text/markdown", "totalLines": 3, "displayContent": {"text": "{\n "data": "Declaration (single theorem). Let iota\\\\iotaiota be an arbitrary type equipped with decidable equality (this assumption underwrites the finite-set union appearing below), and let WWW and VVV be arbitrary types carrying the structure of real normed vector spaces \u2014 a normed abelian group with a compatible mathbbR\\\\mathbb{R}mathbbR-scalar multiplication; only the induced addition, zero, and scalar multiplication appear in the assertion itself, the norm plays no role. Universally quantified over all of these, and over:\n\n- a finite set IsubseteqiotaI \\\\subseteq \\\\iotaIsubseteqiota (the occurrence set);\n- two finite lists of finite subsets of iota\\\\iotaiota, mathcalB=[B1,dots,Bk]\\\\mathcal{B} = [B_1, \\\\dots, B_k]mathcalB=[B1​,dots,Bk​] and mathcalB′=[B1′,dots,Bk′′]\\\\mathcal{B}' = [B'_1, \\\\dots, B'_{k'}]mathcalB′=[B1′​,dots,Bk′′​] (the tile lists);\n- functions alpha:iotatomathbbR\\\\alpha : \\\\iota \\\\to \\\\mathbb{R}alpha:iotatomathbbR (weights), mathrmval:iotatomathbbR\\\\mathrm{val} : \\\\iota \\\\to \\\\mathbb{R}mathrmval:iotatomathbbR (values), a:iotatoWa : \\\\iota \\\\to Wa:iotatoW and c:iotatoVc : \\\\iota \\\\to Vc:iotatoV (per-occurrence contributions),\n\nthe theorem assumes, as hypotheses hhh and h′h'h′, that each of mathcalB\\\\mathcal{B}mathcalB and mathcalB′\\\\mathcal{B}'mathcalB′ is a valid tile partition of III, which literally means two things: first,\n

B1cupB2cupcdotscupBk;=;IB_1 \\\\cup B_2 \\\\cup \\\\cdots \\\\cup B_k \\\\;=\\\\; IB1​cupB2​cupcdotscupBk​;=;I

\n(the fold of set union over the list, starting from emptyset\\\\emptysetemptyset, equals III exactly \u2014 so every tile is contained in III and every element of III lies in some tile); and second, the list is pairwise disjoint: any two tiles occupying distinct positions in the list are disjoint finite sets, i.e. no index belongs to two different tiles of the list. Together these force every iinIi \\\\in IiinI to lie in exactly one tile of mathcalB\\\\mathcal{B}mathcalB (and exactly one of mathcalB′\\\\mathcal{B}'mathcalB′). What the quantifier thereby silently includes: empty tiles are permitted, in any number and at any position (an empty tile is disjoint from everything and does not change the union); a nonempty tile cannot appear twice in one list, since it is not disjoint from itself; the empty list is a valid partition only of I=emptysetI = \\\\emptysetI=emptyset; and the hypotheses are always satisfiable (e.g. the one-tile list [I][I][I]), so the statement is not vacuous. In particular mathcalB\\\\mathcal{B}mathcalB and mathcalB′\\\\mathcal{B}'mathcalB′ may differ in the number of tiles, in the tiles themselves, and in their order.\n\nThe constructions the assertion refers to, unfolded: an accumulator is a triple with three data fields and nothing else,\n

x;=;big(,x.mathrmlossinmathbbR,;;x.mathrmdirectinW,;;x.mathrmsharedinV,big)x \\\\;=\\\\; \\\\big(\\\\, x.\\\\mathrm{loss} \\\\in \\\\mathbb{R},\\\\;\\\\; x.\\\\mathrm{direct} \\\\in W,\\\\;\\\\; x.\\\\mathrm{shared} \\\\in V \\\\,\\\\big)x;=;big(,x.mathrmlossinmathbbR,;;x.mathrmdirectinW,;;x.mathrmsharedinV,big)

\n(a running weighted loss, a running direct parameter-gradient contribution, and a running shared-state contribution). One streaming step over a finite tile BsubseteqiotaB \\\\subseteq \\\\iotaBsubseteqiota sends\n

x;mapsto;Big(x.mathrmloss+sumiinBalphai,mathrmvali,quadx.mathrmdirect+sumiinBalphaicdotai,quadx.mathrmshared+sumiinBalphaicdotciBig),x \\\\;\\\\mapsto\\\\; \\\\Big( x.\\\\mathrm{loss} + \\\\sum_{i \\\\in B} \\\\alpha_i \\\\, \\\\mathrm{val}_i,\\\\quad x.\\\\mathrm{direct} + \\\\sum_{i \\\\in B} \\\\alpha_i \\\\cdot a_i,\\\\quad x.\\\\mathrm{shared} + \\\\sum_{i \\\\in B} \\\\alpha_i \\\\cdot c_i \\\\Big),x;mapsto;Big(x.mathrmloss+sumiinB​alphai​,mathrmvali​,quadx.mathrmdirect+sumiinB​alphai​cdotai​,quadx.mathrmshared+sumiinB​alphai​cdotci​Big),

\nwhere the sums are finite sums over the finite set BBB (an empty sum is 000), alphai,mathrmvali\\\\alpha_i\\\\,\\\\mathrm{val}_ialphai​,mathrmvali​ is an ordinary product in mathbbR\\\\mathbb{R}mathbbR, and cdot\\\\cdotcdot is the mathbbR\\\\mathbb{R}mathbbR-scalar multiplication on WWW and on VVV; the data (alpha,mathrmval,a,c)(\\\\alpha, \\\\mathrm{val}, a, c)(alpha,mathrmval,a,c) is fixed for the whole computation \u2014 no field is updated between tiles. The fold processes a tile list strictly left to right (the head tile is consumed first, then the tail), returning its starting accumulator unchanged on the empty list. Write A(mathcalC)A(\\\\mathcal{C})A(mathcalC) for the fold over the list mathcalC\\\\mathcal{C}mathcalC started from the zero accumulator (0,0,0)(0,0,0)(0,0,0), and operatornameFold(mathcalC,x)\\\\operatorname{Fold}(\\\\mathcal{C}, x)operatornameFold(mathcalC,x) for the same fold started from an arbitrary accumulator xxx.\n\nUnder these hypotheses the theorem asserts the conjunction of five claims:\n\n1. Order- and decomposition-independence. A(mathcalB)=A(mathcalB′)A(\\\\mathcal{B}) = A(\\\\mathcal{B}')A(mathcalB)=A(mathcalB′). This is an equality of accumulator structures; since an accumulator is nothing but the three data components above, it holds exactly when all three fields agree \u2014 A(mathcalB).mathrmloss=A(mathcalB′).mathrmlossA(\\\\mathcal{B}).\\\\mathrm{loss} = A(\\\\mathcal{B}').\\\\mathrm{loss}A(mathcalB).mathrmloss=A(mathcalB′).mathrmloss in mathbbR\\\\mathbb{R}mathbbR, A(mathcalB).mathrmdirect=A(mathcalB′).mathrmdirectA(\\\\mathcal{B}).\\\\mathrm{direct} = A(\\\\mathcal{B}').\\\\mathrm{direct}A(mathcalB).mathrmdirect=A(mathcalB′).mathrmdirect in WWW, and A(mathcalB).mathrmshared=A(mathcalB′).mathrmsharedA(\\\\mathcal{B}).\\\\mathrm{shared} = A(\\\\mathcal{B}').\\\\mathrm{shared}A(mathcalB).mathrmshared=A(mathcalB′).mathrmshared in VVV. Because mathcalB′\\\\mathcal{B}'mathcalB′ may be any valid partition of III \u2014 a coarser or finer decomposition, or a reordering of mathcalB\\\\mathcal{B}mathcalB (a reordering is again a valid partition) \u2014 this says the final accumulator is the same whatever the tile decomposition and whatever the order of the tiles.\n\n2. Loss field equals the plain sum. A(mathcalB).mathrmloss=displaystylesumiinIalphai,mathrmvaliA(\\\\mathcal{B}).\\\\mathrm{loss} = \\\\displaystyle\\\\sum_{i \\\\in I} \\\\alpha_i \\\\, \\\\mathrm{val}_iA(mathcalB).mathrmloss=displaystylesumiinI​alphai​,mathrmvali​: the tile-by-tile streamed accumulation of the loss reproduces the single finite sum over all of III.\n\n3. Direct field equals the plain sum. A(mathcalB).mathrmdirect=displaystylesumiinIalphaicdotaiA(\\\\mathcal{B}).\\\\mathrm{direct} = \\\\displaystyle\\\\sum_{i \\\\in I} \\\\alpha_i \\\\cdot a_iA(mathcalB).mathrmdirect=displaystylesumiinI​alphai​cdotai​ in WWW.\n\n4. Shared field equals the plain sum. A(mathcalB).mathrmshared=displaystylesumiinIalphaicdotciA(\\\\mathcal{B}).\\\\mathrm{shared} = \\\\displaystyle\\\\sum_{i \\\\in I} \\\\alpha_i \\\\cdot c_iA(mathcalB).mathrmshared=displaystylesumiinI​alphai​cdotci​ in VVV.\n\nClaims 2\u20134 are stated only for the list mathcalB\\\\mathcal{B}mathcalB; by claim 1 they hold verbatim with mathcalB\\\\mathcal{B}mathcalB replaced by mathcalB′\\\\mathcal{B}'mathcalB′.\n\n5. Prefix (splitting) law. For all lists of finite subsets mathcalB1,mathcalB2\\\\mathcal{B}_1, \\\\mathcal{B}_2mathcalB1​,mathcalB2​ of iota\\\\iotaiota \u2014 arbitrary lists carrying no partition, disjointness, or subset assumption whatsoever (repetitions and overlapping tiles included), so this clause does not depend on the hypotheses h,h′h, h'h,h′ at all \u2014\n

Abig(mathcalB1mathbin+!!+mathcalB2big);=;operatornameFoldbig(mathcalB2,;A(mathcalB1)big),A\\\\big(\\\\mathcal{B}_1 \\\\mathbin{+\\\\!\\\\!+} \\\\mathcal{B}_2\\\\big) \\\\;=\\\\; \\\\operatorname{Fold}\\\\big(\\\\mathcal{B}_2,\\\\; A(\\\\mathcal{B}_1)\\\\big),Abig(mathcalB1​mathbin+!!+mathcalB2​big);=;operatornameFoldbig(mathcalB2​,;A(mathcalB1​)big),

\nwhere mathbin+!!+\\\\mathbin{+\\\\!\\\\!+}mathbin+!!+ is concatenation of lists: folding over the concatenated stream in one pass from zero yields the same accumulator (again, field by field, all three components) as first folding over the first block from zero and then resuming the fold over the second block from that intermediate checkpoint. Its endpoint instances are degenerate and hold by the definition of the fold alone (mathcalB1\\\\mathcal{B}_1mathcalB1​ empty: both sides are A(mathcalB2)A(\\\\mathcal{B}_2)A(mathcalB2​); mathcalB2\\\\mathcal{B}_2mathcalB2​ empty: both sides are A(mathcalB1)A(\\\\mathcal{B}_1)A(mathcalB1​)).\n\nEdge cases of the whole statement: if I=emptysetI = \\\\emptysetI=emptyset, every valid partition consists only of empty tiles (or is the empty list), all finite sums vanish, and claims 1\u20134 reduce to saying the resulting accumulator is (0,0,0)(0,0,0)(0,0,0) in each field; claim 5, being quantified over all tile lists, holds regardless of III. No metric, limit, or analytic operation occurs anywhere in the assertion \u2014 it is a statement about finite sums, additions, and scalar multiples in mathbbR\\\\mathbb{R}mathbbR, WWW, and VVV."\n}", "startLine": 1, "lineNumbers": [1, 2, 3]}, "meta": {"source": {"type": "internal", "value": "agent://RB-M05"}}}}

Human review
  • Endorsed by Shuze Chen · Sep 25, 2026

  • Endorsed by ajax · Sep 25, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me