aboutsummaryrefslogtreecommitdiff
path: root/theories/Numbers/NatInt/NZAxioms.v
blob: 89f44fcd479093aae72d8352a7fa70d352717df8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Require Export NumPrelude.

Module Type NZAxiomsSig.

Parameter Inline NZ : Set.
Parameter Inline NZeq : NZ -> NZ -> Prop.
Parameter Inline NZ0 : NZ.
Parameter Inline NZsucc : NZ -> NZ.
Parameter Inline NZpred : NZ -> NZ.
Parameter Inline NZplus : NZ -> NZ -> NZ.
Parameter Inline NZminus : NZ -> NZ -> NZ.
Parameter Inline NZtimes : NZ -> NZ -> NZ.

Axiom NZE_equiv : equiv NZ NZeq.
Add Relation NZ NZeq
 reflexivity proved by (proj1 NZE_equiv)
 symmetry proved by (proj2 (proj2 NZE_equiv))
 transitivity proved by (proj1 (proj2 NZE_equiv))
as NZE_rel.

Add Morphism NZsucc with signature NZeq ==> NZeq as NZsucc_wd.
Add Morphism NZpred with signature NZeq ==> NZeq as NZpred_wd.
Add Morphism NZplus with signature NZeq ==> NZeq ==> NZeq as NZplus_wd.
Add Morphism NZminus with signature NZeq ==> NZeq ==> NZeq as NZminus_wd.
Add Morphism NZtimes with signature NZeq ==> NZeq ==> NZeq as NZtimes_wd.

Delimit Scope NatIntScope with NatInt.
Open Local Scope NatIntScope.
Notation "x == y"  := (NZeq x y) (at level 70) : NatIntScope.
Notation "x ~= y" := (~ NZeq x y) (at level 70) : NatIntScope.
Notation "0" := NZ0 : NatIntScope.
Notation S := NZsucc.
Notation P := NZpred.
Notation "1" := (S 0) : NatIntScope.
Notation "x + y" := (NZplus x y) : NatIntScope.
Notation "x - y" := (NZminus x y) : NatIntScope.
Notation "x * y" := (NZtimes x y) : NatIntScope.

Axiom NZpred_succ : forall n : NZ, P (S n) == n.

Axiom NZinduction :
  forall A : NZ -> Prop, predicate_wd NZeq A ->
    A 0 -> (forall n : NZ, A n <-> A (S n)) -> forall n : NZ, A n.

Axiom NZplus_0_l : forall n : NZ, 0 + n == n.
Axiom NZplus_succ_l : forall n m : NZ, (S n) + m == S (n + m).

Axiom NZminus_0_r : forall n : NZ, n - 0 == n.
Axiom NZminus_succ_r : forall n m : NZ, n - (S m) == P (n - m).

Axiom NZtimes_0_r : forall n : NZ, n * 0 == 0.
Axiom NZtimes_succ_r : forall n m : NZ, n * (S m) == n * m + n.

End NZAxiomsSig.

Module Type NZOrdAxiomsSig.
Declare Module Export NZAxiomsMod : NZAxiomsSig.
Open Local Scope NatIntScope.

Parameter Inline NZlt : NZ -> NZ -> Prop.
Parameter Inline NZle : NZ -> NZ -> Prop.

Add Morphism NZlt with signature NZeq ==> NZeq ==> iff as NZlt_wd.
Add Morphism NZle with signature NZeq ==> NZeq ==> iff as NZle_wd.

Notation "x < y" := (NZlt x y) : NatIntScope.
Notation "x <= y" := (NZle x y) : NatIntScope.
Notation "x > y" := (NZlt y x) (only parsing) : NatIntScope.
Notation "x >= y" := (NZle y x) (only parsing) : NatIntScope.

Axiom NZle_lt_or_eq : forall n m : NZ, n <= m <-> n < m \/ n == m.
Axiom NZlt_irrefl : forall n : NZ, ~ (n < n).
Axiom NZlt_succ_le : forall n m : NZ, n < S m <-> n <= m.
End NZOrdAxiomsSig.