fact: Definition kap_smith (M : 'M[R]_2) : 'M[R]_2 * seq R * 'M[R]_2 := let: A := hermite M in let: a00 := A 0 0 in let: a01 := A 0 1 in let: a11 := A 1 1 in let: (d,_,_,_,a,b,c) := egcdr3 a00 a01 a11 in if d == 0 then (Bezout_mx (M 0 0) (M 1 0) 0,[::],1%:M) else let: (p,q) := kap a b c in let: (x1,y1) := kapW a b c in let: (x,y) := (a * x1 + y1 * b, c * y1) in (mx2 p q (- y) x *m Bezout_mx (M 0 0) (M 1 0) 0, map (fun x => d * x) [:: 1; - a * c], mx2 x1 (p * b + q * c) y1 (- p * a)).
imports: HB(structures) mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat div seq path) mathcomp(ssralg fintype matrix mxalgebra bigop zmodp perm choice) dvdring mxstructure minor stronglydiscrete coherent edr