Legend
- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in Mathlib
Definition
1
We define \(\mathrm{MyNat}\) as the inductive type with two constructors:
a term \(0\) (called zero);
for every \(n \in \mathrm{MyNat}\), a term \(\mathrm{succ}(n)\) (the successor of \(n\)).
In other words, every natural number is obtained from \(0\) by applying the successor function a finite number of times. We write \(1\) for \(\mathrm{succ}(0)\).
Definition
103
Given \(x\) in \(\mathrm{MyRat}\), we say that \(x\) is nonnegative if it has a representative with nonnegative numerator and positive denominator: there exist \(a\) and \(b\) in \(\mathrm{MyInt}\) with \(0 \leq a\) and \(0 {\lt} b\) such that
\[ x = ⟦(a,b)⟧. \]
This is the usual condition \(0 \leq a/b\) after choosing a positive denominator.