Section Maps.
Variable A B : Setoid.
Definition Map_law (f : elem A -> elem B) :=
forall x y : elem A, equal _ x y -> equal _ (f x) (f y).
Inductive Map : Type :=
Build_Map : forall (f : elem A -> elem B) (p : Map_law f), Map.
Definition explicit_ap (m : Map) :=
match m return (elem A -> elem B) with
| Build_Map f p => f
end.
Definition ext (f g : Map) :=
forall x : elem A, equal _ (explicit_ap f x) (explicit_ap g x).
Definition Map_setoid := Build_Setoid Map ext Equiv_map_eq.
End Maps.
Notation ap := (explicit_ap _ _).
(* <Warning> : Grammar is replaced by Notation *)
Definition ap2 (A B C : Setoid) (f : elem (Map_setoid A (Map_setoid B C)))
(a : elem A) := ap (ap f a).
(*****    posint     ******)
Inductive posint : Type :=
| Z : posint
| Suc : posint -> posint.
Axiom
f_equal : forall (A B : Type) (f : A -> B) (x y : A), x = y -> f x = f y.
(* The predecessor function *)
Definition pred (n : posint) : posint :=
match n return posint with
| Z => (* Z *)  Z
(* Suc u *)
| Suc u => u
end.

Axiom pred_Sucn : forall m : posint, m = pred (Suc m).
Axiom eq_add_Suc : forall n m : posint, Suc n = Suc m -> n = m.
Axiom not_eq_Suc : forall n m : posint, n <> m -> Suc n <> Suc m.