(* Julien Narboux *)
(* Formalization of *)
(* Tarski's axiomatic *)
(* Some general tactics *)
Ltac ex_elim H x := elim H; intros x ; intro; clear H.
Ltac DecompEx H P := elim H;intro P;intro;clear H.
Ltac DecompExAnd H P :=
elim H;intro P;let id:=fresh in
(intro id;decompose [and] id;clear id;clear H).
Ltac exist_hyp t := match goal with
| H1:t |- _ => idtac
end.
Ltac hyp_of_type t := match goal with
| H1:t |- _ => H1
end.
Ltac clean_duplicated_hyps :=
repeat match goal with
| H:?X1 |- _ => clear H; exist_hyp X1
end.
Ltac suppose H := cut H;[intro|idtac].
Ltac not_exist_hyp t := match goal with
| H1:t |- _ => fail 2
end || idtac.
Ltac DecompAndAll :=
repeat
match goal with
| H:(?X1 /\ ?X2) |- _ => decompose [and] H;clear H
end.
Ltac assert_if_not_exist H :=
not_exist_hyp H;assert H.
Ltac absurde :=
match goal with
|H : (?X <> ?X) |- _ => apply False_ind; apply H; reflexivity
end.
Ltac spliter := repeat
match goal with
| H:(?X1 /\ ?X2) |- _ => induction H
end.
Ltac ex_and H x := elim H; intro x; intros; clear H;spliter.
(* Ltac ex_and H x := ex_elim H x; spliter. *)
Ltac use H := decompose [and] H;clear H.
Ltac try_or T :=
match goal with
| |- ?A \/ ?B =>
(left; try_or T) || (right;try_or T)
| |- _ => T
end.
(* Tactics to hide and show hypothesis from context taken from libtactics of Software foundations. *)
Tactic Notation "generalizes" hyp(X) :=
generalize X; clear X.
Ltac sort_tactic :=
try match goal with H: ?T |- _ =>
match type of T with Prop =>
generalizes H; (try sort_tactic); intro
end end.
Tactic Notation "sort" :=
sort_tactic.
Definition ltac_something (P:Type) (e:P) := e.
Notation "'Something'" :=
(@ltac_something _ _).

Lemma ltac_something_hide : forall (e:Type),
e -> (@ltac_something _ e).