Source: LinearAlgebra at 3303f96b37b4.

Phase 2: proposed LinearAlgebra rule inventory#

Design for review only. No rule below is an implemented OSR rule, a generated Lean theorem, a numerical test result or a certification. Every item is a forward rewrite proposal with a mathematical statement, domain and preconditions. The existing v1 fragment cannot express all of these rules or their types and assumptions: see schema proposal.

Shared conventions#

F is ℝ or ℂ unless restricted below. Matrices are finite and symbolic; A:m×n, B:n×p, C:p×q have entries in the same field. Square matrices are n×n, with n ≥ 1 in this proposed OpenMath fragment. I_n is the identity on the specified space. T is transpose, not Hermitian adjoint. Inverse means a partial mathematical inverse, defined only for an invertible square matrix; k⁻¹ requires k ≠ 0. A^2 means AA and requires square A. For 3D vectors use an oriented real 3D Euclidean inner product space, with cross product defined by that orientation and metric. det[u v w] means the determinant with columns in a positively oriented orthonormal basis; it equals the orientation-compatible volume form, independent of that choice. For matrix exponential, use finite square matrices over ℝ or ℂ with the usual analytic exponential. No complex Euclidean norm claim is made.

plus and times in the inventory are notation, not an invented OpenMath symbol. Candidate existing symbols are arith1#plus, arith1#times, arith1#power, linalg1#transpose, linalg1#determinant, linalg1#vectorproduct, linalg1#scalarproduct, and experimental linalg5#identity. Trace, inverse, matrix exponential, type and assumption vocabulary require a CD survey and reviewed interpretation; they are not silently assigned fabricated CD names. The current arith1#power evaluator is scalar-only, so matrix powers require a separate reviewed typed mapping.

Proposed directional entries#

Exactly 28 independent mathematical identities / 28 proposed directed entries follow: transpose 5, trace 4, determinant 5, inverse 3, vectors 6, matrix exponential 2, associativity/distribution 3. Each entry still needs a typed OSR encoding. Compiled mathematical counterparts are listed in the status report. The alternate orientation (A^T)⁻¹ → (A⁻¹)^T is the reverse of T5 and is not a 29th identity; enabling both would create a loop. Existing proofs in Mathlib would not by themselves prove a faithful OSR-to-Lean mapping.

IDForward rule and explicit assumptionsOrientation and proposed check
T1(AB)^T → B^T A^T; A:m×n, B:n×pPush transpose to leaves; order reverses; reject mismatched inner dimensions.
T2(A+B)^T → A^T+B^T; same shapePush to leaves; expansion; opt-in normalization profile.
T3(kA)^T → k A^T; k∈FPush to leaves; preserves shape.
T4(A^T)^T → A; A:m×nRemoves two operations.
T5(A⁻¹)^T → (A^T)⁻¹; A:n×n, invertibleOne canonical orientation only; reject unknown invertibility.
R1tr(A+B) → tr(A)+tr(B); square same sizeExposes linearity; expands; optional profile.
R2tr(kA) → k tr(A); A:n×nExtract scalar.
R3tr(AB) → tr(BA); A:m×n, B:n×mEquality is valid for unequal m,n; enable only under a strict canonical order to avoid a loop, otherwise manual one-shot.
R4tr(A^T) → tr(A); square ARemoves transpose.
D1det(AB) → det(A)det(B); same-size square A,BExposes multiplicativity; can increase size.
D2det(A^T) → det(A); square ARemoves transpose.
D3det(kA) → k^n det(A); A:n×nExposes dimension-dependent scalar factor.
D4det(A⁻¹) → (det A)⁻¹; square invertible AInvertibility is essential to intended partial semantics.
D5det(I_n) → 1; n≥1Removes determinant; identity constructor’s CD dimension convention applies.
I1(AB)⁻¹ → B⁻¹A⁻¹; same-size square, A,B invertibleReverses order, expands; optional profile.
I2(A⁻¹)⁻¹ → A; square invertible ARemoves inverse pair; no reliance on totalized inverse at singular matrices.
I3(kA)⁻¹ → k⁻¹A⁻¹; square invertible A, k≠0Extract factor; conditions must be decided.
V1u×v → −(v×u) only when v precedes u in a fixed order; real oriented Euclidean 3-spaceCanonicalizes operand order; plain unconditional anticommutativity is a loop.
V2u×u → 0_V; same 3D settingRemoves product; typed vector zero.
V3u·(v×w) → det[u v w]; same setting, determinant convention aboveExposes oriented scalar volume; requires a reviewed determinant-of-vectors representation.
V4u×(v×w) → v(u·w)−w(u·v); same settingExpands a nested cross product; opt-in profile, not a universal size reduction.
V5u×(v×w)+v×(w×u)+w×(u×v) → 0_V; same settingWhole-pattern Jacobi simplification; matching must preserve structure.
V6‖u×v‖² → ‖u‖²‖v‖²−(u·v)²; same real settingRemoves cross/norm nesting; not the same formula for an arbitrary complex inner product.
E1exp(0_(n×n)) → I_n; real/complex square matrix, n≥1Removes exponential; typed zero and identity.
E2exp(A+B) → exp(A)exp(B); same-size square A,B, AB=BAExpansion; opt-in/one-shot, never unconditional.
M1(AB)C → A(BC); A:m×n, B:n×p, C:p×qChosen right association; inverse direction disabled.
M2A(B+C) → AB+AC; B,C:n×p, A:m×nExpansion; separate profile with bounded strategy.
M3(A+B)C → AC+BC; A,B:m×n, C:n×pExpansion; separate profile with bounded strategy.

Use profiles and a documented well-founded strategy; neither the identity nor these orientations establishes termination of a combined rewrite system. In particular, do not include both expansion and factoring in the same unguarded normalizer, or both transpose/inverse orientations. Explicit, proposed positive and negative applicability checks for the type/condition system are listed in schema-proposal.md. The wider set of 15 cross-domain conceptual examples has its own positive and negative tests in architecture-research.md.

Six false candidates and exact witnesses#

The counterexample catalogue links the compiled Lean witnesses for these six proposals. Each witness satisfies the stated domain and makes the two sides unequal.

  1. Square expansion: take A=[[0,1],[0,0]], B=[[0,0],[1,0]]. Then (A+B)^2=I, but A²+2AB+B²=diag(2,0). The missing term is BA.
  2. Unconditional exponential: use the same A,B. Since A²=B²=0, exp(A)exp(B)=[[2,1],[1,1]], whereas exp(A+B) has diagonal cosh(1) and off-diagonal sinh(1) (approximately 1.543081 and 1.175201). The exact Lean proof uses commutation with the sum to distinguish the two sides.
  3. Determinant of a sum: for A=B=I₂, det(A+B)=4 and det(A)+det(B)=2.
  4. Incorrect scalar determinant: for A=I₂, k=2, det(kA)=4 but k det(A)=2; the correct factor is k².
  5. Inverse product order: let A=[[1,1],[0,1]] and B=[[1,0],[1,1]]. Both are invertible; (AB)⁻¹=[[1,-1],[-1,2]] but A⁻¹B⁻¹=[[2,-1],[-1,1]].
  6. Multiplicative trace: for A=B=I₂, tr(AB)=2 whereas tr(A)tr(B)=4.

All witness entries are rational. The numerical suite exercises each witness and the Lean proofs establish the six inequalities exactly.

Phase-2 report#

The design specifies dimensions, assumptions and orientations for 28 directed identities. Six further proposals have concrete counterexamples. Reviewing the typed vocabulary and its interpretation is the next step toward an OSR export. The status report tracks proof coverage.