Section AHom.
Variable K : fieldType.
Section Class_Def.
Variables aT rT : FalgType K.
Definition ahom_in (U : {vspace aT}) (f : 'Hom(aT, rT)) :=
let fM_at x y := f (x * y) == f x * f y in
all (fun x => all (fM_at x) (vbasis U)) (vbasis U) && (f 1 == 1).

(* Specifications: *)
Lemma ahom_inP {f : 'Hom(aT, rT)} {U : {vspace aT}} :
reflect ({in U &, {morph f : x y / x * y >-> x * y}} * (f 1 = 1))
(ahom_in U f).
Lemma ahomP {f : 'Hom(aT, rT)} : reflect (lrmorphism f) (ahom_in {:aT} f).
Structure ahom := AHom {ahval :> 'Hom(aT, rT); _ : ahom_in {:aT} ahval}.