Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Named source locations for Strassen matrix multiplication

Definition
CLRS_Chapter4_Algo2LeanExamples_MatrixStrassenPoints

by Chutong · Oct 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

algo2leanalgo2lean-clrs-chapter4-fd33cf9algorithmsclrsrunning-timetextbook

These observations identify named source locations and local variables in one supplied configuration of the compiled Strassen matrix multiplication program. A location predicate expresses program position only: it does not imply reachability from function entry or fix a transcript. The interface supports local loop contracts while leaving the generated algorithm definitions independent of label changes.

Formalization Note. This content is transcribed from Algo2Lean development snapshot fd33cf959b39f9e4a9fcfda4ef31d5a36b784d41, with explicit platform import and namespace adaptation. It is not attributed to public compiler v0.1.4. The submitted definition bundle must be checked without unfinished-proof assumptions.

Definition code
import Definitions.Def_CLRS_Chapter4_Algo2Lean
import Definitions.Def_CLRS_Chapter4_Algo2LeanExamples_MatrixStrassenGenerated
import Std

set_option autoImplicit false
set_option backward.isDefEq.respectTransparency false
set_option backward.defeqAttrib.useBackward true

namespace CLRS

-- Generated by Algo2Lean 0.1.1 https://github.com/lunjiah/algo2lean

namespace «MatrixStrassenLibrary»

open _root_.CLRS.Algo2LeanGenerated


open Algo2LeanGenerated

-- Named-line observations; changing labels leaves the imported algorithm unchanged.

-- Before source line 9, column 5; location only, not reachability.
def matrix_linear_row.At.loop : Configuration → Prop
  | .active _ (.fn_matrix_linear_row 4 _) _ => True
  | _ => False
def matrix_linear_row.Local.a : Configuration → Option SeqRef
  | .active _ (.fn_matrix_linear_row pc s) _ => if pc = 4 then some s.v0 else none
  | _ => none

def matrix_linear_row.Local.b : Configuration → Option SeqRef
  | .active _ (.fn_matrix_linear_row pc s) _ => if pc = 4 then some s.v1 else none
  | _ => none

def matrix_linear_row.Local.count : Configuration → Option Int
  | .active _ (.fn_matrix_linear_row pc s) _ => if pc = 4 then some s.v2 else none
  | _ => none
def matrix_linear_row.Local.sign : Configuration → Option Int
  | .active _ (.fn_matrix_linear_row pc s) _ => if pc = 4 then some s.v3 else none
  | _ => none
def matrix_linear_row.Local.c : Configuration → Option SeqRef
  | .active _ (.fn_matrix_linear_row pc s) _ => if pc = 4 then some s.v4 else none
  | _ => none

def matrix_linear_row.Local.i : Configuration → Option Int
  | .active _ (.fn_matrix_linear_row pc s) _ => if pc = 4 then some s.v5 else none
  | _ => none

-- Before source line 20, column 5; location only, not reachability.











-- Before source line 30, column 5; location only, not reachability.









-- Before source line 41, column 5; location only, not reachability.











-- Before source line 51, column 5; location only, not reachability.










-- Before source line 63, column 5; location only, not reachability.















end «MatrixStrassenLibrary»

end CLRS
Source
Algo2Lean Chapter 4 development, module Algo2LeanExamples.MatrixStrassenPoints, immutable source fd33cf959b39f9e4a9fcfda4ef31d5a36b784d41: https://github.com/chutongyang98/Lean_formalization/blob/fd33cf959b39f9e4a9fcfda4ef31d5a36b784d41/examples/matrix_strassen.algo; https://github.com/chutongyang98/Lean_formalization/blob/fd33cf959b39f9e4a9fcfda4ef31d5a36b784d41/examples/analysis/matrix_strassen.lean

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