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 "Unified-Sub/Lift/defs.ma".
17 (* Inversion properties *****************************************************)
19 theorem lift_inv_sort_1: \forall l, i, h, x.
20 Lift l i (sort h) x \to
22 intros. inversion H; clear H; intros; destruct. autobatch.
25 theorem lift_inv_lref_1: \forall l, i, j1, x.
26 Lift l i (lref j1) x \to
27 (i > j1 \land x = lref j1) \lor
29 \exists j2. (l + j1 == j2) \land x = lref j2
31 intros. inversion H; clear H; intros; destruct; autobatch depth = 5 size = 7.
34 theorem lift_inv_bind_1: \forall l, i, r, u1, t1, x.
35 Lift l i (intb r u1 t1) x \to
38 Lift l (succ i) t1 t2 \land
40 intros. inversion H; clear H; intros; destruct; autobatch depth = 5 size = 7.
43 theorem lift_inv_flat_1: \forall l, i, r, u1, t1, x.
44 Lift l i (intf r u1 t1) x \to
49 intros. inversion H; clear H; intros; destruct. autobatch depth = 5 size = 7.
52 theorem lift_inv_sort_2: \forall l, i, x, h.
53 Lift l i x (sort h) \to
55 intros. inversion H; clear H; intros; destruct. autobatch.
58 theorem lift_inv_lref_2: \forall l, i, x, j2.
59 Lift l i x (lref j2) \to
60 (i > j2 \land x = lref j2) \lor
62 \exists j1. (l + j1 == j2) \land x = lref j1
64 intros. inversion H; clear H; intros; destruct; autobatch depth = 5 size = 10.
67 theorem lift_inv_bind_2: \forall l, i, r, x, u2, t2.
68 Lift l i x (intb r u2 t2) \to
71 Lift l (succ i) t1 t2 \land
73 intros. inversion H; clear H; intros; destruct. autobatch depth = 5 size = 7.
76 theorem lift_inv_flat_2: \forall l, i, r, x, u2, t2.
77 Lift l i x (intf r u2 t2) \to
82 intros. inversion H; clear H; intros; destruct. autobatch depth = 5 size = 7.
85 (* Corollaries of inversion properties ***************************************)
87 theorem lift_inv_lref_1_gt: \forall l, i, j1, x.
88 Lift l i (lref j1) x \to
89 i > j1 \to x = lref j1.
91 lapply linear lift_inv_lref_1 to H. decompose; destruct;
93 | lapply linear nle_false to H2, H1. decompose
97 theorem lift_inv_lref_1_le: \forall l, i, j1, x.
98 Lift l i (lref j1) x \to i <= j1 \to
99 \exists j2. (l + j1 == j2) \land x = lref j2.
101 lapply linear lift_inv_lref_1 to H. decompose; destruct;
102 [ lapply linear nle_false to H1, H2. decompose
107 theorem lift_inv_lref_1_le_nplus: \forall l, i, j1, x.
108 Lift l i (lref j1) x \to
109 i <= j1 \to \forall j2. (l + j1 == j2) \to
112 lapply linear lift_inv_lref_1 to H. decompose; destruct;
113 [ lapply linear nle_false to H1, H3. decompose
114 | lapply linear nplus_mono to H2, H4. destruct. autobatch
118 theorem lift_inv_lref_2_gt: \forall l, i, x, j2.
119 Lift l i x (lref j2) \to
120 i > j2 \to x = lref j2.
122 lapply linear lift_inv_lref_2 to H. decompose; destruct;
124 | lapply linear nle_false to H2, H1. decompose
128 theorem lift_inv_lref_2_le: \forall l, i, x, j2.
129 Lift l i x (lref j2) \to i <= j2 \to
130 \exists j1. (l + j1 == j2) \land x = lref j1.
132 lapply linear lift_inv_lref_2 to H. decompose; destruct;
133 [ lapply linear nle_false to H1, H2. decompose
138 theorem lift_inv_lref_2_le_nplus: \forall l, i, x, j2.
139 Lift l i x (lref j2) \to
140 i <= j2 \to \forall j1. (l + j1 == j2) \to
143 lapply linear lift_inv_lref_2 to H. decompose; destruct;
144 [ lapply linear nle_false to H1, H3. decompose
145 | lapply linear nplus_inj_2 to H2, H4. destruct. autobatch