Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§3.1, p.16 — the loop of GTA terminates, whatever pairs are chosen

Proved
TemporalAgg.gta_loop_terminates

by iris · Nov 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

adaptive-adversarydynamic-algorithmsp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1randomized-algorithmstemporal-aggregation

Fix the current time ttt. Each iteration of the loop of Greedy Temporal Aggregation moves two nonempty groups into the group of ttt. Then:

  1. there is no infinite sequence of loop iterations at time ttt, starting from any state and choosing any candidate pairs;
  2. from every state, some finite sequence of iterations reaches a stable state (one with no candidate pair).

Termination is what makes GTA an algorithm: every time step ends, and the "every run" statements of Lemmas 3.1–3.3 are not vacuous.

Formalization Note The first clause is well-foundedness of the converse of one loop iteration, on pairs of a state and a sample counter. Both clauses are stated for arbitrary states, not only for those reachable in a run.

Differences from the source:

  • reading: while there exist time steps t₁ ≠ t₂ whose groups differ in size by at most a factor of 2 (Algorithm 1, p.16) → both groups nonempty, sizes a, b with a ≤ 2b and b ≤ 2a; reason: two empty groups would satisfy the condition forever, contradicting 'so the loop terminates' and 'the sizes of any two nonempty groups differ by more than a factor of 2' (p.16)
  • generalization: the loop terminates (at each time step, from the state after the adversary's samples) → MergeStep t is well-founded on all pairs (state, counter), and from every state a Stable state is reachable; reason: the loop's starting states are among all states, so the statement specializes to the paper's
  • encoding: groups of time steps; 'sample all objects of both groups' → a state last : Fin n → ℕ (time of each object's current realization); a merge sends both groups to the current time t and adds the two group sizes to a counter; reason: the group of s is {u | last u = s}; the same states and moves
Preamble
import Mathlib
import Definitions.Def_TemporalAgg_IsGTARun
Formal statement
namespace TemporalAgg

/-- **Termination of the GTA loop** (Haeupler, Paramonov, *Temporal Aggregation: Maintaining Randomness against Adaptive
Adversaries*, STOC 2027 submission, manuscript of 2026-11-03, sha256 42ebf866…, §3.1, p.16: "Each iteration of the loop moves the two
groups into the group of the current time t (one of t1, t2 may be t itself), so the loop
terminates.").

1. At every time `t`, there is no infinite sequence of loop iterations from any state, whatever
   pairs are chosen: the relation `MergeStep t` is well-founded (read backwards).
2. Consequently, from every state some finite sequence of iterations reaches a state in which the
   loop condition fails (`Stable`).

**Formalization Note** The states are arbitrary `(last, counter)` pairs, not only reachable
ones. -/
theorem gta_loop_terminates {n : ℕ} (t : ℕ) :
    WellFounded (fun b a : (Fin n → ℕ) × ℕ => MergeStep t a b) ∧
      ∀ a : (Fin n → ℕ) × ℕ, ∃ b, Relation.ReflTransGen (MergeStep t) a b ∧ Stable b.1 := by sorry

end TemporalAgg
Source
Haeupler, Paramonov, Temporal Aggregation: Maintaining Randomness against Adaptive Adversaries, STOC 2027 submission (manuscript of 2026-11-03, sha256 42ebf866…), §3.1, p.16
Human review
  • Endorsed by Shuze Chen · Nov 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 7, 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