]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/frees_fqup.ma
initial support for lfpx_drops ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / frees_fqup.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/s_computation/fqup_weight.ma".
16 include "basic_2/static/frees.ma".
17
18 (* CONTEXT-SENSITIVE FREE VARIABLES *****************************************)
19
20 (* Advanced properties ******************************************************)
21
22 (* Note: this replaces lemma 1400 concluding the "big tree" theorem *)
23 lemma frees_total: ∀L,T. ∃f. L ⊢ 𝐅*⦃T⦄ ≡ f.
24 #L #T @(fqup_wf_ind_eq … (⋆) L T) -L -T
25 #G0 #L0 #T0 #IH #G #L *
26 [ cases L -L /3 width=2 by frees_atom, ex_intro/
27   #L #I #V *
28   [ #s #HG #HL #HT destruct
29     elim (IH G L (⋆s)) -IH /3 width=2 by frees_sort_gen, fqu_fqup, fqu_drop, lifts_sort, ex_intro/
30   | * [2: #i ] #HG #HL #HT destruct
31     [ elim (IH G L (#i)) -IH /3 width=2 by frees_lref, fqu_fqup, ex_intro/
32     | elim (IH G L V) -IH /3 width=2 by frees_zero, fqu_fqup, fqu_lref_O, ex_intro/
33     ]
34   | #l #HG #HL #HT destruct
35     elim (IH G L (§l)) -IH /3 width=2 by frees_gref_gen, fqu_fqup, fqu_drop, lifts_gref, ex_intro/
36   ]
37 | * [ #p ] #I #V #T #HG #HL #HT destruct elim (IH G L V) // #f1 #HV
38   [ elim (IH G (L.ⓑ{I}V) T) -IH // #f2 #HT
39     elim (sor_isfin_ex f1 (⫱f2))
40     /3 width=6 by frees_fwd_isfin, frees_bind, isfin_tl, ex_intro/
41   | elim (IH G L T) -IH // #f2 #HT
42     elim (sor_isfin_ex f1 f2)
43     /3 width=6 by frees_fwd_isfin, frees_flat, ex_intro/ 
44   ]
45 ]
46 qed-.