NLA-lib Explorer

Givens rotations

Library · Source module

Givens rotations

The Givens rotation NLAlib.givens i j c s acts on the coordinates i and j by the matrix \begin{\mathbf{b}matri\mathbf{x}} c & s \\ -\bar{s} & \bar{c} \end{\mathbf{b}matri\mathbf{x}} and fixes the others. It is unitary when \lvert c \rvert^2 + \lvert s \rvert^2 = 1, and for every vector there is a rotation that clears coordinate j into coordinate i: NLAlib.givensOf, with the coefficients NLAlib.givensCoeffs.

Givens QR of an upper Hessenberg matrix is a total recursion indexed by the step, as Householder QR in NLAlib/Matrix/Factorizations/Householder.lean: step k rotates rows k and k + 1 to clear the subdiagonal entry of column k. It never breaks down (a zero pair gives the identity).

Main definitions

* NLAlib.givens: the rotation in the coordinate plane (i, j). * NLAlib.givensCoeffs, NLAlib.givensOf: the clearing rotation of a vector. * NLAlib.givensHessenbergStep, NLAlib.givensHessenbergState, NLAlib.givensHessenbergQ, NLAlib.givensHessenbergR: Givens QR, step by step.

Main results

* NLAlib.givens_apply: the entries. * NLAlib.hasOrthonormalCols_givens: unitarity. * NLAlib.det_givens_eq_mul_star_add_mul_star, NLAlib.det_givens: the determinant. * NLAlib.givens_mulVec_apply_left, …_right, …_of_ne: the action on a vector. * NLAlib.exists_givens_mulVec_apply_eq_zero: clearing an entry. * NLAlib.norm_givensCoeffs_fst_sq_add, NLAlib.givensOf_mulVec_apply_right, NLAlib.givensOf_mulVec_apply_left: the clearing rotation is unitary and clears. * NLAlib.hasOrthonormalCols_givensHessenbergState_fst, NLAlib.givensHessenbergState_fst_mul_snd: every step of Givens QR factors the matrix with a unitary first factor. * NLAlib.givensHessenbergState_apply_of_lt, NLAlib.givensHessenbergState_apply_eq_zero_of_le, NLAlib.givensHessenbergState_snd_apply_eq_zero_of_col: later steps leave the leading rows alone, and trailing zero rows and zero columns stay zero (the freeze of Givens QR past a breakdown).

Declarations