Definition add_lfun f g := linfun (f \+ g).
Definition opp_lfun f := linfun (-%R \o f).
Fact lfun_addA : associative add_lfun.
Definition lfun_vectMixin := VectMixin lfun_vect_iso.
Canonical lfun_vectType := VectType R 'Hom(aT, rT) lfun_vectMixin.
End LfunVectType.
Section CompLfun.
Variables (R : ringType) (wT aT vT rT : vectType R).
Implicit Types (f : 'Hom(vT, rT)) (g : 'Hom(aT, vT)) (h : 'Hom(wT, aT)).

(* Specifications: *)
Lemma id_lfunE u: \1%VF u = u :> aT. Proof. exact: lfunE. Qed.
Lemma comp_lfunE f g u : (f \o g)%VF u = f (g u). Proof. exact: lfunE. Qed.
Lemma comp_lfunA f g h : (f \o (g \o h) = (f \o g) \o h)%VF.
Lemma limg0 f : (f @: 0 = 0)%VS. Proof. by rewrite limg_line linear0. Qed.
Lemma memv_img f v U : v \in U -> f v \in (f @: U)%VS.
Lemma lim0g U : (0 @: U = 0 :> {vspace rT})%VS.
Lemma eq_in_limg V f g : {in V, f =1 g} -> (f @: V = g @: V)%VS.
Lemma limg_add f : {morph lfun_img f : U V / U + V}%VS.
Lemma limg_sum f I r (P : pred I) Us :
(f @: (\sum_(i <- r | P i) Us i) = \sum_(i <- r | P i) f @: Us i)%VS.
Lemma limg_span f X : (f @: <<X>> = <<map f X>>)%VS.
Lemma lfunPn f g : reflect (exists u, f u != g u) (f != g).
Lemma inv_lfun_def f : (f \o f^-1 \o f)%VF = f.
Lemma limg_lfunVK f : {in limg f, cancel f^-1%VF f}.
Lemma memv_ker f v : (v \in lker f) = (f v == 0).
Lemma limg_ker_dim f U : (\dim (U :&: lker f) + \dim (f @: U) = \dim U)%N.
Lemma limg_dim_eq f U : (U :&: lker f = 0)%VS -> \dim (f @: U) = \dim U.
Lemma lker0P f : reflect (injective f) (lker f == 0%VS).
Lemma limg_ker0 f U V : lker f == 0%VS -> (f @: U <= f @: V)%VS = (U <= V)%VS.
Lemma eq_limg_ker0 f U V : lker f == 0%VS -> (f @: U == f @: V)%VS = (U == V).
Lemma lker0_compVf f : lker f == 0%VS -> (f^-1 \o f = \1)%VF.
Lemma fixedSpacesP f U : reflect {in U, f =1 id} (U <= fixedSpace f)%VS.
Lemma fixedSpace_id : fixedSpace \1 = {:vT}%VS.
End FixedSpace.