Sampling affine solutions with bounded retries #
The MAYO SampleSolution subroutine takes a linear system A x = y and an explicit randomness
vector r. It solves the shifted system A x' = y - A r and returns x' + r; it reports failure
whenever A does not have full row rank, even when this particular target is in the range. MAYO
signing tries fresh componentwise randomness in order and keeps the first successful attempt
([BCC+26], Section 2.1.2, Algorithm 2, pp. 8--9, and
Section 2.1.5, Algorithm 7, p. 14).
Cslib.LinearAlgebra.AffineSolutionSolver records only the deterministic contract of the inner
solver. It deliberately leaves the elimination algorithm abstract; a concrete implementation can
reuse Matrix.GaussJordan. AffineSolutionSolver.sampleSolution implements the source's shift,
and retrySampleSolution reuses List.findSome? for ordered first-success semantics. The latter
returns the successful attempt data along with the solution, so a client does not lose separate
randomness components such as MAYO's vinegar vectors and solution shift.
This module proves deterministic equation and failure behavior only. It does not assert that a random input produces a uniform solution, that attempts are independent, or that a system is surjective with any particular probability.
Main definitions #
Cslib.LinearAlgebra.AffineSolutionSolver: a deterministic solver that succeeds exactly for surjective linear maps.Cslib.LinearAlgebra.AffineSolutionSolver.sampleSolution: solve after shifting by explicit randomness.Cslib.LinearAlgebra.retrySampleSolution: return the first successful attempt and solution.
Main results #
Cslib.LinearAlgebra.AffineSolutionSolver.map_eq_of_sampleSolution_eq_some: every returned sample solves the original affine system.Cslib.LinearAlgebra.AffineSolutionSolver.sampleSolution_eq_none_iff: sampling fails exactly when the linear map is not surjective.Cslib.LinearAlgebra.retrySampleSolution_eq_some_iff: a successful retry is the first successful element of the ordered attempt list.Cslib.LinearAlgebra.retrySampleSolution_eq_none_iff: retries fail exactly when every listed system is nonsurjective.
References #
- [W. Beullens, F. Campos, S. Celi, B. Hess, M. J. Kannwischer, MAYO: Round 3 Version] [BCC+26]
The deterministic contract of a solver for A x = y that accepts exactly when A is
surjective. In particular, a nonsurjective map is rejected even when the requested target happens
to lie in its range. This structure specifies correctness and failure, not an elimination
algorithm or a running-time bound.
- solve : V → Option U
Solve the affine system for a target, or report that
Ais not surjective. Every returned value solves the requested system.
Failure depends only on lack of surjectivity, not on consistency for the particular target.
Shift by explicit randomness r, solve A x' = y - A r, and return x' + r.
The randomness is data supplied by the caller. This definition makes no distributional claim.
Every successful shifted sample solves the original affine system.
Shifted sampling fails exactly when the linear map is not surjective. This preserves the source behavior that a consistent target still fails for a rank-deficient system.
Try explicit attempt data in list order and return the first successful attempt together with
its solution. The functions system, target, and randomness keep the attempt's components
separate; for example, a MAYO client can put all vinegar vectors and the solution-shift vector in
Attempt and recover them on success.
The empty list and a list whose systems are all nonsurjective return none.
Exact first-success semantics: a retry returns (a, x) exactly when the list splits at a,
all earlier systems are nonsurjective, and attempt a returns x.
A returned attempt belongs to the input list, and its returned vector solves that attempt's affine system.
Bounded retries fail exactly when every listed attempt has a nonsurjective system. No probability or independence premise is hidden in this deterministic statement.