Documentation

CslibFrontier.Foundations.LinearAlgebra.MultivariateQuadratic

Vector-valued multivariate quadratic maps #

This file packages a family of quadratic forms as a vector-valued quadratic map. It uses Mathlib's QuadraticMap throughout, including in characteristic two: no division by two and no choice of a symmetric matrix representative is required.

The API isolates the algebra shared by multivariate post-quantum signature proposals. In the Oil and Vinegar construction a central quadratic map vanishes on the oil subspace. Its value at v + o, for an oil vector o, is therefore its value at v plus the polar form at (v, o), which is linear in o. A linear change of variables hides the central map while transporting the vanishing subspace by Submodule.comap.

Main definitions #

Main results #

References #

@[reducible, inline]
abbrev Cslib.MultivariateQuadraticMap (R : Type u_1) (I : Type u_2) (O : Type u_3) [CommRing R] :
Type (max (max u_1 u_2) u_1 u_3)

A vector-valued multivariate quadratic map with input coordinates I and output coordinates O over R. This is only a scheme-facing name for Mathlib's QuadraticMap.

def Cslib.MultivariateQuadraticMap.ofCoordinates {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] (Q : O → QuadraticForm R M) :
QuadraticMap R M (O → R)

Assemble one scalar quadratic form per output coordinate into a vector-valued quadratic map.

@[simp]
theorem Cslib.MultivariateQuadraticMap.ofCoordinates_apply {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] (Q : O → QuadraticForm R M) (x : M) (o : O) :
(ofCoordinates Q) x o = (Q o) x
@[simp]
theorem Cslib.MultivariateQuadraticMap.polar_ofCoordinates_apply {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] (Q : O → QuadraticForm R M) (x y : M) (o : O) :
def Cslib.MultivariateQuadraticMap.coordinate {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] (P : QuadraticMap R M (O → R)) (o : O) :

The scalar quadratic form at one output coordinate.

@[simp]
theorem Cslib.MultivariateQuadraticMap.coordinate_apply {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] (P : QuadraticMap R M (O → R)) (o : O) (x : M) :
(coordinate P o) x = P x o
@[simp]
theorem Cslib.MultivariateQuadraticMap.coordinate_ofCoordinates {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] (Q : O → QuadraticForm R M) (o : O) :
theorem Cslib.MultivariateQuadraticMap.ext {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] {P Q : QuadraticMap R M (O → R)} (h : ∀ (o : O) (x : M), P x o = Q x o) :
P = Q

Vector-valued quadratic maps are equal when all scalar coordinates agree.

theorem Cslib.MultivariateQuadraticMap.ext_iff {R : Type u_1} {O : Type u_3} {M : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] {P Q : QuadraticMap R M (O → R)} :
P = Q ↔ ∀ (o : O) (x : M), P x o = Q x o
def Cslib.MultivariateQuadraticMap.ofMatrices {R : Type u_1} {I : Type u_2} {O : Type u_3} [CommRing R] [Fintype I] [DecidableEq I] (A : O → Matrix I I R) :

Construct a multivariate quadratic map from one coefficient matrix per output coordinate. The matrices need not be symmetric, which is important in characteristic two.

@[simp]
theorem Cslib.MultivariateQuadraticMap.ofMatrices_apply {R : Type u_1} {I : Type u_2} {O : Type u_3} [CommRing R] [Fintype I] [DecidableEq I] (A : O → Matrix I I R) (x : I → R) (o : O) :
(ofMatrices A) x o = x ⬝ᵥ (A o).mulVec x
@[simp]
theorem Cslib.MultivariateQuadraticMap.polar_ofMatrices_apply {R : Type u_1} {I : Type u_2} {O : Type u_3} [CommRing R] [Fintype I] [DecidableEq I] (A : O → Matrix I I R) (x y : I → R) (o : O) :
QuadraticMap.polar (⇑(ofMatrices A)) x y o = x ⬝ᵥ (A o).mulVec y + y ⬝ᵥ (A o).mulVec x

The polar form of a matrix presentation is the sum of its two cross terms. This formula is valid in every characteristic.

@[simp]
theorem Cslib.MultivariateQuadraticMap.ofMatrices_comp_mulVecLin {R : Type u_1} {I : Type u_2} {O : Type u_3} [CommRing R] [Fintype I] [DecidableEq I] {J : Type u_6} [Fintype J] [DecidableEq J] (A : O → Matrix I I R) (M : Matrix I J R) :

Hiding a matrix-presented quadratic map by the input transformation M replaces every coefficient matrix Aₒ by the congruent matrix Mᵀ Aₒ M. This is valid in every characteristic.

def Cslib.MultivariateQuadraticMap.VanishesOn {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] (P : QuadraticMap R M N) (S : Submodule R M) :

A quadratic map vanishes on a submodule. Oil spaces in UOV-type constructions satisfy this property.

theorem Cslib.MultivariateQuadraticMap.VanishesOn.mono {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] {P : QuadraticMap R M N} {S T : Submodule R M} (hP : VanishesOn P S) (hTS : T ≤ S) :
theorem Cslib.MultivariateQuadraticMap.vanishesOn_zero {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] (S : Submodule R M) :
theorem Cslib.MultivariateQuadraticMap.VanishesOn.polarBilin_eq_zero {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] {P : QuadraticMap R M N} {S : Submodule R M} (hP : VanishesOn P S) {o₁ o₂ : M} (ho₁ : o₁ ∈ S) (ho₂ : o₂ ∈ S) :
(P.polarBilin o₁) o₂ = 0

If P vanishes on a submodule, its bilinear polar form vanishes when both arguments lie in that submodule.

theorem Cslib.MultivariateQuadraticMap.map_add_of_mem {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] {P : QuadraticMap R M N} {S : Submodule R M} (hP : VanishesOn P S) (v : M) {o : M} (ho : o ∈ S) :
P (v + o) = P v + (P.polarBilin v) o

If P vanishes on S, evaluating at a public part plus a vector in S reduces to a value independent of that vector plus a linear function of it.

theorem Cslib.MultivariateQuadraticMap.VanishesOn.compQuadraticMap {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] {P : QuadraticMap R M N} {S : Submodule R M} (hP : VanishesOn P S) {N' : Type u_6} [AddCommGroup N'] [Module R N'] (L : N →ₗ[R] N') :

A linear change of output variables preserves vanishing on a submodule.

theorem Cslib.MultivariateQuadraticMap.VanishesOn.comp_comap {R : Type u_1} {M : Type u_4} {N : Type u_5} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] {P : QuadraticMap R M N} {S : Submodule R M} (hP : VanishesOn P S) {M' : Type u_6} [AddCommGroup M'] [Module R M'] (T : M' →ₗ[R] M) :

A linear change of input variables transports a vanishing subspace by preimage.