diff options
| author | Cyril Cohen | 2019-03-21 00:25:56 +0100 |
|---|---|---|
| committer | Cyril Cohen | 2019-03-21 00:58:18 +0100 |
| commit | d08fafcab966bfc5dd16adcf028219a0c83bf035 (patch) | |
| tree | ff62601fee5371a5aa1039aa90287efa198e0a7c | |
| parent | 8b66255d1206368fec3b652aa2e3806d01193668 (diff) | |
adding ffun0
| -rw-r--r-- | mathcomp/ssreflect/finfun.v | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mathcomp/ssreflect/finfun.v b/mathcomp/ssreflect/finfun.v index db1a8e7..d3487f5 100644 --- a/mathcomp/ssreflect/finfun.v +++ b/mathcomp/ssreflect/finfun.v @@ -18,7 +18,8 @@ Require Import ssrfun ssrbool eqtype ssrnat seq choice fintype tuple. (* finfun lam == the f such that f =1 lam; this is the RECOMMENDED *) (* interface to build an element of {ffun aT -> rT}. *) (* [ffun x => expr] == finfun (fun x => expr) *) -(* [ffun => expr] == finfun (fun _ => expr) *) +(* [ffun=> expr] == finfun (fun _ => expr) *) +(* ffun0 aT0 == the trivial finfun, from a proof aT0 that #|aT| = 0 *) (* f \in ffun_on R == the range of f is a subset of R *) (* f \in family F == f belongs to the family F (f x \in F x for all x) *) (* y.-support f == the y-support of f, i.e., [pred x | f x != y]. *) @@ -107,6 +108,9 @@ Canonical finfun_of_subType := Eval hnf in [subType of fT]. Lemma tnth_fgraph f i : tnth (fgraph f) i = f (enum_val i). Proof. by rewrite [@fun_of_fin]unlock enum_valK. Qed. +Definition ffun0 (aT0 : #|aT| = 0) : {ffun aT -> rT} := + Finfun (ecast _ _ (esym aT0) (nil_tuple _)). + Lemma ffunE (g : aT -> rT) : finfun g =1 g. Proof. move=> x; rewrite [@finfun]unlock unlock tnth_map. |
