Lemma ap_Z_irreflexive : irreflexive (A:=Z) ap_Z.
Lemma ap_Z_symmetric : Csymmetric ap_Z.
Lemma ap_Z_cotransitive : cotransitive (A:=Z) ap_Z.
Lemma ap_Z_tight : tight_apart (A:=Z) (eq (A:=Z)) ap_Z.
Definition ap_Z_is_apartness := Build_is_CSetoid Z (eq (A:=Z)) ap_Z
ap_Z_irreflexive ap_Z_symmetric ap_Z_cotransitive ap_Z_tight.
Definition Z_as_CSetoid := Build_CSetoid _ _ _ ap_Z_is_apartness.
Canonical Structure Z_as_CSetoid.
The term Z_as_CSetoid is of type CSetoid. Hence we have proven that Z is a constructive setoid.
Addition
We will prove now that the addition on the integers is a setoid function.Lemma Zplus_wd :
bin_fun_wd Z_as_CSetoid Z_as_CSetoid Z_as_CSetoid Zplus.
Lemma Zplus_strext :
bin_fun_strext Z_as_CSetoid Z_as_CSetoid Z_as_CSetoid Zplus.
Definition Zplus_is_bin_fun := Build_CSetoid_bin_fun
Z_as_CSetoid Z_as_CSetoid Z_as_CSetoid Zplus Zplus_strext.
Canonical Structure Zplus_is_bin_fun.
What's more: the addition is also associative and commutative.
Lemma Zplus_is_assoc : associative Zplus_is_bin_fun.
Lemma Zplus_is_commut : commutes Zplus_is_bin_fun.
Lemma Zopp_wd : fun_wd (S1:=Z_as_CSetoid) (S2:=Z_as_CSetoid) Zopp.
Lemma Zopp_strext :
fun_strext (S1:=Z_as_CSetoid) (S2:=Z_as_CSetoid) Zopp.
Definition Zopp_is_fun :=
Build_CSetoid_fun Z_as_CSetoid Z_as_CSetoid Zopp Zopp_strext.
Canonical Structure Zopp_is_fun.
Lemma Zmult_wd :
bin_fun_wd Z_as_CSetoid Z_as_CSetoid Z_as_CSetoid Zmult.
Lemma Zmult_strext :
bin_fun_strext Z_as_CSetoid Z_as_CSetoid Z_as_CSetoid Zmult.
Definition Zmult_is_bin_fun := Build_CSetoid_bin_fun
Z_as_CSetoid Z_as_CSetoid Z_as_CSetoid Zmult Zmult_strext.
Canonical Structure Zmult_is_bin_fun.
Lemma Zmult_is_assoc : associative Zmult_is_bin_fun.
Lemma Zmult_is_commut : commutes Zmult_is_bin_fun.