Gram row-span invariant for no-pivot Bareiss #
Row-vector interpretation of the trailing block during a no-pivot Bareiss
pass over a Gram matrix. Each active trailing row carries an explicit integer
coefficient vector coeff i such that the represented row is
Matrix.vecMul (coeff i) b, supported at coordinates ≤ i.val, and
each matrix entry in that trailing row is its inner product against the
corresponding original row.
Instances For
The initial no-pivot Gram state satisfies the row-coefficient invariant
with each row represented by the standard basis vector eᵢ.
Equations
Instances For
Coefficient witness produced by one regular Bareiss step on the row at
index i. The functional shape mirrors the row update on the matrix side.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Coefficient-level exact-division provenance for one regular Gram-row
Bareiss step. The quotient vector is kept separate from
bareissGramRowInvariantStepCoeff so later row-entry proofs can consume the
integer divisibility witness before projecting back to the existing exact-div
coefficient API.
Instances For
Canonical coefficient vector and canonicity predicate #
Canonical row-coefficient vector for the initial no-pivot Gram trajectory.
Base case: each row carries the standard basis vector e_i. Inductive step
(regular branch, active row): apply the fraction-free Bareiss row update via
exactDiv. Processed rows, singular branches, and done branches preserve the
previous vector unchanged — mirroring the row-invariant evolution in
bareissGramRowInvariant_noPivotLoop_initialAux.
Defined as a pure function of b and fuel (no BareissGramRowInvariant
argument), so the canonical coefficient is fixed by the matrix and step
count alone. Non-canonical row-coefficient witnesses are ruled out by the
IsCanonicalAt predicate consumed by StepWitness.
Equations
- One or more equations did not get rendered due to their size.
- Hex.GramSchmidt.Int.bareissGramCanonicalCoeff b 0 x✝ = Vector.ofFn fun (k : Fin n) => if x✝ = k then 1 else 0
Instances For
The canonical coefficient at fuel = 0 is the standard basis vector.
Recursion equation: regular-branch active-row case. With the branch
hypotheses in context, simp [*]/simp_all rewrites bareissGramCanonicalCoeff
at fuel + 1 to its explicit Bareiss exact-division update.
Recursion equation: regular-branch processed-row case. An already-processed
row (i ≤ step) keeps its previous coefficient vector, so the canonical
coefficient at fuel + 1 collapses to the one at fuel.
Recursion equation: singular branch (zero diagonal). A zero pivot skips the
update, so the canonical coefficient at fuel + 1 collapses to the one at
fuel.
Recursion equation: done branch (no further work possible). Once the loop can
take no further step (¬ step + 1 < n), the canonical coefficient at fuel + 1
collapses to the one at fuel.
A BareissGramRowInvariant on noPivotLoop fuel (noPivotInitialState …)
is canonical at fuel when every row's coefficient vector matches
bareissGramCanonicalCoeff. This is the soundness gate consumed by
StepWitness: non-canonical witnesses (which can shift coefficients by a
kernel vector while keeping entry_eq_dot satisfied) cannot invoke the
witness's quotient identity.
The SPEC counterexample at rows (1,1), (1,0), (-1,-1) (#6505) produces two
distinct BareissGramRowInvariant instances at the same loop state whose
coefficient vectors differ by the kernel vector. Both satisfy entry_eq_dot,
but only one (the canonical one) yields an integer Bareiss-step quotient.
Equations
- Hex.GramSchmidt.Int.IsCanonicalAt b fuel hinv = ∀ (i : Fin n), hinv.coeff i = Hex.GramSchmidt.Int.bareissGramCanonicalCoeff b fuel i
Instances For
The base-case row invariant at fuel = 0 carries the standard basis vectors
and is therefore canonical.
Transport along an equation of BareissStates preserves the coeff field
of a BareissGramRowInvariant. The field's type Fin n → Vector Int n does
not depend on the state index, so transport is the identity at that
projection. Used to discharge canonicity proofs after transporting an explicit
intermediate state back to the noPivotLoop fuel initial form.
One regular no-pivot Bareiss step preserves the Gram row-coefficient invariant, provided the later loop proof supplies the exact-division entry relation for the fraction-free updated row combinations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The coefficient vectors produced by bareissGramRowInvariant_regular_step
from a canonical input invariant match bareissGramCanonicalCoeff at the
next-step fuel index. Used to propagate canonicity through one regular Bareiss
step inside bareissGramRowInvariant_noPivotLoop_initialAux.
Per-step quotient package for the initial no-pivot Gram trajectory,
restricted to canonical row-coefficient witnesses via IsCanonicalAt.
StepWitness.Cell is an alias for BareissGramRegularStepQuotient whose
canonicity gate (h_canon) prevents non-canonical BareissGramRowInvariant
witnesses — which can shift coefficients by a kernel vector while still
satisfying entry_eq_dot — from supplying integer quotients. The kernel-shift
counterexample (SPEC #6505: rows (1,1), (1,0), (-1,-1) at row 2 step 1)
shows the restriction is necessary: distinct non-canonical witnesses produce
numerators differing by 1, which is not divisible by prevPivot = 2.
Equations
- Hex.GramSchmidt.Int.StepWitness.Cell b fuel hinv _h_canon hnext i hi = Hex.GramSchmidt.Int.BareissGramRegularStepQuotient hinv hnext i hi
Instances For
Quotient provenance for the initial no-pivot Gram trajectory, restricted
to canonical BareissGramRowInvariant witnesses via IsCanonicalAt. The
provider supplies, at every reachable regular Bareiss step, an integer
quotient q : Fin n → Int realising the Bareiss-row-update divisibility on
the canonical coefficient vectors.
Concrete providers are constructed in HexGramSchmidtMathlib, where the
Bareiss-Desnanot proof infrastructure on PSD Gram minors is available; the
Mathlib-free layer only consumes this abstraction.
Equations
- One or more equations did not get rendered due to their size.