Notation fun_of_fin := FunFinfun.fun_of_fin.
Notation finfun := FunFinfun.finfun.
Coercion fun_of_fin : finfun_type >-> Funclass.
Canonical fun_of_fin_unlock := Unlockable FunFinfun.fun_of_finE.
Canonical finfun_unlock := Unlockable FunFinfun.finfunE.
Notation "[ 'ffun' x : aT => F ]" := (finfun (fun x : aT => F))
(at level 0, x ident, only parsing) : fun_scope.
Notation "[ 'ffun' : aT => F ]" := (finfun (fun _ : aT => F))
(at level 0, only parsing) : fun_scope.
Notation "[ 'ffun' x => F ]" := [ffun x : _ => F]
(at level 0, x ident, format "[ 'ffun'  x  =>  F ]") : fun_scope.
Notation "[ 'ffun' => F ]" := [ffun : _ => F]
(at level 0, format "[ 'ffun' =>  F ]") : fun_scope.
(* Helper for defining notation for function families. *)
Definition fmem aT rT (pT : predType rT) (f : aT -> pT) := [fun x => mem (f x)].
(* Lemmas on the correspondance between finfun_type and CiC functions. *)
Section PlainTheory.
Variables (aT : finType) (rT : Type).
Notation fT := {ffun aT -> rT}.
Implicit Types (f : fT) (R : pred rT).
Canonical finfun_of_subType := Eval hnf in [subType of fT].

(* Specifications: *)
Lemma tnth_fgraph f i : tnth (fgraph f) i = f (enum_val i).
Lemma fgraph_codom f : fgraph f = codom_tuple f.
Lemma codom_ffun f : codom f = val f.
Lemma ffunK : cancel (@fun_of_fin aT rT) (@finfun aT rT).
Section Support.