Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

A kernel pass is a `PassOK` step (round six, `kpass_ok`)

Proved
J6Seg.Ax.kpass_ok

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

complexity-theoryinteger-multiplicationkappa-improvement

A kernel pass is a PassOK step.

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

theorem J6Seg.Ax.kpass_ok {Pp : ℕ} {Isym : List Sym} {tbl : Fin Pp → IStmt HS Pp} {eF eB e eUp eDn : Fin Pp}
    {ρ : Fin 19 → Fin HS} {dT dF dA : Fin HS} {C₀ Cp : ℝ} {tabOf : ℕ → List ℤ}
    {Pre : List GI → Prop} {g : ℕ → List GI → List GI} {Ck : ℝ} {desc : List ℤ}
    (hR : RegOK ρ dT dF) (hFine : FineBody6 Isym tbl eF eB dF C₀)
    (hRow : RowBody6 Isym tbl e dT tabOf Pre g Ck)
    (w w' f pre nc post B Lmax : ℕ)
    (hSet : SetupBody6 Isym tbl eUp eDn ρ dA desc
      (kerRegs w w' f pre nc post (tabsT tabOf nc)) Cp)
    (hρA : ∀ i, ρ i ≠ dA) (hA0 : dA ≠ 0) (hTA : dT ≠ dA)
    (hB : 1 ≤ B) (hpost : 1 ≤ post)
    (hzw : zsz (w : ℤ) ≤ B) (hzw' : zsz (w' : ℤ) ≤ B) (hzf : zsz (f : ℤ) ≤ B)
    (hzA : zsz ((pre * nc : ℕ) : ℤ) ≤ B) (hzp : zsz (post : ℤ) ≤ B)
    (hzpre : zsz (pre : ℤ) ≤ B) (hznc : zsz (nc : ℤ) ≤ B)
    (hzm : zsz ((2 * 2 ^ f : ℕ) : ℤ) ≤ B) (hzN : zsz ((2 * (pre * nc * post * 2 ^ f) : ℕ) : ℤ) ≤ B)
    (hzT : zsz ((tabsT tabOf nc).length : ℤ) ≤ B) (hzL : zsz (Lmax : ℤ) ≤ B) (hw'B : w' ≤ B)
    (hg : ∀ q < nc, ∀ x, Pre x → x.length = 2 ^ f → (g q x).length = 2 ^ f ∧ GB w' (g q x))
    (hTB : ∀ q < nc, Bnd B (tabOf q)) (hTL : ∀ q < nc, (tabOf q).length ≤ Lmax) :
    PassOK Isym tbl (kpSt eUp eDn ρ dT dF eF eB e) dA desc
      (fun L => L.length = pre * nc * (2 ^ f * post) ∧ GB w L ∧
        ∀ b < pre * nc, ∀ c < post, Pre (lineAt (2 ^ f) post L b c))
      (kerPass (2 ^ f) post (pre * nc) (fun b => g (b % nc)))
      (2 * Cp + (C₀ * cFine w f (pre * nc) post + C₀ * cFine w' f (pre * nc) post +
        (kerC ⌊Ck⌋₊ B (2 ^ f) post Lmax nc (tabsT tabOf nc).length pre
          (2 * (pre * nc * post * 2 ^ f)) : ℝ)))

Context. B-line axis program (AxisU6), part 2: a kernel pass as a PassOK step

kpSt eUp eDn ρ dT dF eF eB e = call eUp; kerW ρ dT dF eF eB e; call eDn: the set-up of the register file kerRegs … from the descriptor (SetupBody6, B5), the kernel-pass wrapper (kerW_run, B2) with a row kernel (RowBody6), the tear-down.

kpass_ok: under the hypotheses of kerW_run (the row facts given by lineAt, the rows of the array), the step is PassOK for kerPass (2^f) post (pre·nc) (fun b => g (b % nc)), at cost 2 Cp + (the kerW_run bound).

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_R6_Defs66

set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000

open J6Seg J6Seg.Ax
open IntMul NLogN NLogN.KIL NLogN.KFB IntMul.Kappa.R6 Function
Formal statement
theorem J6Seg.Ax.kpass_ok {Pp : ℕ} {Isym : List Sym} {tbl : Fin Pp → IStmt HS Pp} {eF eB e eUp eDn : Fin Pp}
    {ρ : Fin 19 → Fin HS} {dT dF dA : Fin HS} {C₀ Cp : ℝ} {tabOf : ℕ → List ℤ}
    {Pre : List GI → Prop} {g : ℕ → List GI → List GI} {Ck : ℝ} {desc : List ℤ}
    (hR : RegOK ρ dT dF) (hFine : FineBody6 Isym tbl eF eB dF C₀)
    (hRow : RowBody6 Isym tbl e dT tabOf Pre g Ck)
    (w w' f pre nc post B Lmax : ℕ)
    (hSet : SetupBody6 Isym tbl eUp eDn ρ dA desc
      (kerRegs w w' f pre nc post (tabsT tabOf nc)) Cp)
    (hρA : ∀ i, ρ i ≠ dA) (hA0 : dA ≠ 0) (hTA : dT ≠ dA)
    (hB : 1 ≤ B) (hpost : 1 ≤ post)
    (hzw : zsz (w : ℤ) ≤ B) (hzw' : zsz (w' : ℤ) ≤ B) (hzf : zsz (f : ℤ) ≤ B)
    (hzA : zsz ((pre * nc : ℕ) : ℤ) ≤ B) (hzp : zsz (post : ℤ) ≤ B)
    (hzpre : zsz (pre : ℤ) ≤ B) (hznc : zsz (nc : ℤ) ≤ B)
    (hzm : zsz ((2 * 2 ^ f : ℕ) : ℤ) ≤ B) (hzN : zsz ((2 * (pre * nc * post * 2 ^ f) : ℕ) : ℤ) ≤ B)
    (hzT : zsz ((tabsT tabOf nc).length : ℤ) ≤ B) (hzL : zsz (Lmax : ℤ) ≤ B) (hw'B : w' ≤ B)
    (hg : ∀ q < nc, ∀ x, Pre x → x.length = 2 ^ f → (g q x).length = 2 ^ f ∧ GB w' (g q x))
    (hTB : ∀ q < nc, Bnd B (tabOf q)) (hTL : ∀ q < nc, (tabOf q).length ≤ Lmax) :
    PassOK Isym tbl (kpSt eUp eDn ρ dT dF eF eB e) dA desc
      (fun L => L.length = pre * nc * (2 ^ f * post) ∧ GB w L ∧
        ∀ b < pre * nc, ∀ c < post, Pre (lineAt (2 ^ f) post L b c))
      (kerPass (2 ^ f) post (pre * nc) (fun b => g (b % nc)))
      (2 * Cp + (C₀ * cFine w f (pre * nc) post + C₀ * cFine w' f (pre * nc) post +
        (kerC ⌊Ck⌋₊ B (2 ^ f) post Lmax nc (tabsT tabOf nc).length pre
          (2 * (pre * nc * post * 2 ^ f)) : ℝ))) := 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.Ax.kpass_ok`, Solutions/J6SegAxis2.lean (lines 63–140) 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