Section KernelLemmas.
Variable K : fieldType.
(* convertible to kermx (horner_mx g p) when n = n.+1 *)
Definition kermxpoly n (g : 'M_n) (p : {poly K}) : 'M_n :=
kermx ((if n is n.+1 then horner_mx^~ p : 'M_n.+1 -> 'M_n.+1 else \0) g).
Definition geigenspace n (g : 'M_n) a := kermxpoly g (('X - a%:P) ^+ n).
Definition eigenpoly n (g : 'M_n) : pred {poly K} :=
(fun p => kermxpoly g p != 0).

Lemma map_geigenspace (n : nat) (g : 'M_n) (a : aF) :
map_mx f (geigenspace g a) = geigenspace (map_mx f g) (f a).