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 (**************************************************************************)
16 include "nat/plus.ma".
18 ntheorem test1 : ∀n:nat.n = S n + n → S n = (S (S n)).
20 nassert m:nat H: (m=S m + m) ⊢ (S m = S (S m));
21 nletin pippo ≝ (S m) in H: % ⊢ (???%);
22 nassert m:nat pippo : nat ≝ (S m) ⊢ (m = pippo + m → S m = S pippo);
23 #H; nchange in match pippo in H:% with (pred (S pippo));
24 nassert m:nat pippo : nat ≝ (S m) H:(m = pred (S pippo) + m) ⊢ (S m = S pippo);
25 ngeneralize in match m in H:(??%?) ⊢ %;
26 nassert m:nat pippo : nat ≝ (S m) ⊢ (∀n:nat. n=(pred (S pippo)+m) → (S n)=S pippo);
28 nassert m:nat pippo : nat ≝ (S m) x: nat H:(x = pred (S pippo) + m) ⊢ (S x = S pippo);
29 nwhd in H: (?%? (?%?));
30 nassert m:nat pippo:nat≝(S m) x:nat H:(x=S m + m) ⊢ (S x = S pippo);
31 nchange in match (S ?) in H:(??%?) ⊢ (??%%) with (pred (S ?));
32 ngeneralize in match H;
34 nelim m in ⊢ (???(?%?) → %);
36 ##[ ncases x in H ⊢ (? → % → ?);
47 include "logic/connectives.ma".
51 notation "†" non associative with precedence 90 for @{ 'sharp }.
52 interpretation "a" 'sharp = a.
53 interpretation "b" 'sharp = b.
55 ntheorem foo: ∀n:nat. match n with [ O ⇒ n | S m ⇒ m + m ] = n.
57 (*ntheorem prova : ((A ∧ A → A) → (A → B) → C) → C.
58 # H; nassert H: ((A ∧ A → A) → (A → B) → C) ⊢ C;
59 napply (H ? ?); nassert H: ((A ∧ A → A) → (A → B) → C) ⊢ (A → B)
60 H: ((A ∧ A → A) → (A → B) → C) ⊢ (A ∧ A → A);
62 definition k : A → A ≝ λx.a.
63 definition k1 : A → A ≝ λx.a.
67 include "nat/plus.ma".
69 ntheorem pappo : ∀n:nat.n = S n + n → S n = (S (S n)).
70 #m; #H; napply (let pippo ≝ (S m) in ?);
71 nchange in match (S m) in ⊢ (?) with pippo;
74 nletin pippo ≝ (S m) in H ⊢ (?);
77 nchange in match (S ?) in H:% ⊢ (? → %) with (pred (S ?));
80 ngeneralize in match m in ⊢ %; in ⊢ (???% → ??%?);
82 ncases (O) in m : % (*H : (??%?)*) ⊢ (???%);
83 nelim (S m) in H : (??%?) ⊢ (???%);
86 ntheorem pippo : ∀x:A. P (k x).
87 nchange in match (k x) in ⊢ (∀_.%) with (k1 x); STOP
89 ntheorem prova : (A → A → C) → C.
91 napply (H ? ?); nchange A xxx;
99 { r1 : T1, ..., r2 : T2 }
101 reflexivity apply REFL
105 apply (reflexivite S)