1 Section Base_Definitions.
3 Section inductive_sets.
5 Inductive Set Empty := .
7 Inductive Set List [S:Set] := empty: (List S) | fr: (List S) -> S -> (List S).
9 Inductive Id [S:Set; a:S]: S -> Set := id_r: (Id S a a).
11 Inductive Set Pi [S:Set; P:S->Set] := abst: ((a:S) (P a)) -> (Pi S P).
13 Inductive Set Sigma [S:Set; P:S->Set] := pair: (a:S) (P a) -> (Sigma S P).
15 Inductive Set Plus [S,T:Set] := in_l : S -> (Plus S T) | in_r : T -> (Plus S T).
17 Inductive SId [A:Set] : Set -> Set := sid_r: (SId A A).
23 Definition efq := Empty_rec.
25 Definition listrec := List_rec.
27 Definition idrec := Id_rec.
29 Definition fsplit := Pi_rec.
31 Definition psplit := Sigma_rec.
33 Definition when := Plus_rec.
35 Definition EmptyFam := Empty_rect.
37 Definition ListFam := List_rect.
39 Definition IdFam := Id_rect.
41 Definition PiFam := Pi_rect.
43 Definition SigmaFam := Sigma_rect.
45 Definition PlusFam := Plus_rect.
47 Definition ap: (S:Set; P:S->Set) (Pi S P) -> (a:S) (P a).
54 Definition sp: (S:Set; P:S->Set) (Sigma S P) -> S.
61 Definition sq: (S:Set; P:S->Set; p:(Sigma S P)) (P (sp S P p)).
74 Definition id: (S:Set) S -> S.
79 Definition comp: (R,S,T:Set) (R -> S) -> (S -> T) -> (R -> T).
92 Section general_results.
94 Theorem mcut: (S,T:Set) S -> (S -> T) -> T.
104 Theorem id_repl: (S:Set; a,b:S; P:S->Set) (Id ? b a) -> (P b) -> (P a).
110 Theorem id_comm: (S:Set; a,b:S) (Id ? b a) -> (Id ? a b).
112 Apply (id_repl S a b).
117 Theorem id_trans: (S:Set; c,a,b:S) (Id S a c) -> (Id S c b) -> (Id S a b).
119 Apply (id_repl S b c).
124 Theorem id_comp: (S,T:Set; f:S->T; a,b:S) (Id S a b) -> (Id T (f a) (f b)).
126 Apply (id_repl ? b a).
131 Axiom id_ext: (S,T:Set; f,g:S->T) ((a:S) (Id T (f a) (g a))) -> (Id S->T f g).
137 Theorem sid_repl: (A,B:Set; P:Set->Set) (SId B A) -> (P B) -> (P A).
143 Theorem sid_comp: (P:Set->Set; A,B:Set) (SId A B) -> (SId (P A) (P B)).
145 Apply (sid_repl B A).
150 Axiom sid_ext: (S:Set; P:(S->Set)->Set; Q,R:S->Set) ((a:S) (SId (Q a) (R a))) -> (SId (P Q) (P R)).
154 Section indipendence.
156 Axiom list_p4: (S:Set; l:(List S); a:S) (Id (List S) (empty S) (fr S l a)) -> Empty.
158 Axiom plus_p4: (S:Set; a:S; T:Set; b:T) (Id (Plus S T) (in_l S T a) (in_r S T b)) -> Empty.
160 Axiom id_ctt: (S:Set) (P:(a:S)(Id S a a) -> Set) ((a:S) (P a (id_r S a))) -> (a:S; p:(Id S a a)) (P a p).
166 Tactic Definition MTrivial := Try Apply id_r; (* Try Apply sid_r; *)
167 (*|*) Try Assumption; Try Apply id_comm;
168 Try Assumption; Try Apply id_comm.
170 Tactic Definition MFold := Idtac.
172 Tactic Definition MRed := Idtac.
174 Tactic Definition MAuto := MTrivial; MFold; MRed.
176 Tactic Definition MSimpl := Simpl; MAuto.
178 Tactic Definition MElim v e := Pattern v; Elim v using e; Simpl;
181 Tactic Definition MApply t := Apply t; Intros; MTrivial.
183 Tactic Definition MCut t := MApply '(mcut t).
185 Tactic Definition UnIntros T t := Apply (mcut T); Try Assumption; Clear t.