1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "lambda/terms/relocating_substitution.ma".
17 include "lambda/notation/functions/multiplicity_1.ma".
19 (* MULTIPLICITY *************************************************************)
21 (* Note: this gives the number of variable references in M *)
22 let rec mult M on M ≝ match M with
25 | Appl B A ⇒ (mult B) + (mult A)
28 interpretation "term multiplicity"
29 'Multiplicity M = (mult M).
31 lemma mult_positive: ∀M. 0 < ♯{M}.
32 #M elim M -M // /2 width=1/
35 lemma mult_lift: ∀h,M,d. ♯{↑[d, h] M} = ♯{M}.
36 #h #M elim M -M normalize //
39 theorem mult_dsubst: ∀D,M,d. ♯{[d ↙ D] M} ≤ ♯{M} * ♯{D}.
41 [ #i #d elim (lt_or_eq_or_gt i d) #Hid
42 [ >(dsubst_vref_lt … Hid) normalize //
43 | destruct >dsubst_vref_eq normalize //
44 | >(dsubst_vref_gt … Hid) normalize //
47 | normalize #B #A #IHB #IHA #d
48 >distributive_times_plus_r /2 width=1/