Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Moving a reversed list of pairs back (round six, `pairMove_runs`)

Proved
J6Seg.Slab.pairMove_runs

by xuanji · Oct 20, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theoryinteger-multiplicationkappa-improvement

Moving a reversed list of pairs back, rptX X (mv i j; mv i j).

The following holds (Lean statement, in the scope of module Solutions.J6SegILCtl3):

theorem J6Seg.Slab.pairMove_runs {i j X : Fin HS} (hij : i ≠ j) (hXA : X ≠ lA)
    (Φ : List ℤ → List ℤ → Fin HS → List ℤ) (hi : ∀ A B, Φ A B i = A) (hj : ∀ A B, Φ A B j = B)
    (hup : ∀ A B v w, update (update (Φ A B) i v) j w = Φ v w)
    (hA : ∀ A B, Φ A B lA = []) (hC : ∀ A B, Φ A B lC = []) (hD : ∀ A B, Φ A B lD = [])
    (L : ℕ) {LM : List ℤ} (hX : ∀ A B, Φ A B X = (L : ℤ) :: LM) (fc A0 B0 : List ℤ)
    (hfc : fc.length = 2 * L) {Z : ℕ} (hZ : ∀ y ∈ fc, zsz y ≤ Z) (s : IState HS) :
    IRuns I iprog (rptX X lA lC lD (.seq (.op (.mv i j)) (.op (.mv i j))))
      (encK s (Φ (fc.reverse ++ A0) B0)) (encK s (Φ A0 (fc ++ B0)))
      (L * (2 * cU Z) + 3000 * (L + 1))

Context. B-line IL, B1 follow-up: building the control list, §3 list facts and the pair transfer

  • pos src argOf j: the input position after the first j output slabs; pos_succ, pos_mono, pos_le_n, sum_tele (the drops of the entries telescope to pos).
  • length_ctlOf: |ctlOf n n' src argOf| = n + n' for a monotone source.
  • srcTab_drop: the table seen from entry j.
  • pairMove_runs: rptX X (mv i j; mv i j) moves a reversed list of 2L entries back in order.
  • cS_upd_G, cS_self: the builder state over other registers.

Formalization Note. Part of the Lean formalization of the round-six κ-improvement (integer-multiplication-kappa campaign, target IntMul.Kappa.jain_round6_framework). The statement is copied verbatim from the Lean development; the platform node carries the same declaration name. Definitions it mentions live in the IntMul_Kappa_R6_Defs* bundles (on top of the published κ bundles IntMul_Kappa_K_Defs*).

Preamble
-- Round-six κ development (integer-multiplication-kappa), generated by skeleton subtraction.

import Definitions.Def_IntMul_Kappa_K_Defs33
import Definitions.Def_IntMul_Kappa_R6_Defs1
import Mathlib
import Definitions.Def_IntMul_HvdH_M_Defs8
import Definitions.Def_IntMul_MultitapeModel
import Definitions.Def_IntMul_HvdH_Numeric
import Definitions.Def_IntMul_HvdH_ExpApprox
import Definitions.Def_IntMul_HvdH_RealExp
import Definitions.Def_IntMul_HvdH_MachineRef
import Definitions.Def_IntMul_HvdH_Twiddle
import Definitions.Def_IntMul_HvdH_SApprox
import Definitions.Def_IntMul_HvdH_DiagApprox
import Definitions.Def_IntMul_HvdH_EApprox
import Definitions.Def_IntMul_HvdH_JApprox
import Definitions.Def_IntMul_HvdH_BApprox
import Definitions.Def_IntMul_HvdH_FPApprox

set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000

set_option maxRecDepth 20000
open IntMul NLogN NLogN.KIL Function
open NLogN.KFUU (lA lC lD cU)
open NLogN.KFT (cf3 rptX)
variable {n n' : ℕ} {src : ℕ → Option ℕ} (argOf : ℕ → ℤ)
variable {P : ℕ} {I : List Sym} {iprog : Fin P → IStmt HS P}
Formal statement
theorem J6Seg.Slab.pairMove_runs {i j X : Fin HS} (hij : i ≠ j) (hXA : X ≠ lA)
    (Φ : List ℤ → List ℤ → Fin HS → List ℤ) (hi : ∀ A B, Φ A B i = A) (hj : ∀ A B, Φ A B j = B)
    (hup : ∀ A B v w, update (update (Φ A B) i v) j w = Φ v w)
    (hA : ∀ A B, Φ A B lA = []) (hC : ∀ A B, Φ A B lC = []) (hD : ∀ A B, Φ A B lD = [])
    (L : ℕ) {LM : List ℤ} (hX : ∀ A B, Φ A B X = (L : ℤ) :: LM) (fc A0 B0 : List ℤ)
    (hfc : fc.length = 2 * L) {Z : ℕ} (hZ : ∀ y ∈ fc, zsz y ≤ Z) (s : IState HS) :
    IRuns I iprog (rptX X lA lC lD (.seq (.op (.mv i j)) (.op (.mv i j))))
      (encK s (Φ (fc.reverse ++ A0) B0)) (encK s (Φ A0 (fc ++ B0)))
      (L * (2 * cU Z) + 3000 * (L + 1)) := by sorry
Source
S. Jain, round-six networks for the integer-multiplication κ-improvement campaign (https://github.com/Swapnil-jain/integer-mult-kappa, commit 5868dc7) and D. Colkitt, integer-mult-bounds (https://github.com/CrocSwap/integer-mult-bounds); target `IntMul.Kappa.jain_round6_framework`. Lean declaration `J6Seg.Slab.pairMove_runs`, Solutions/J6SegILCtl3.lean (lines 124–166) of the round-six development.

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