The natural numbers form a monoid #
This file contains the additive and multiplicative monoid instances on the natural numbers.
See note [foundational algebra order theory].
Instances #
Equations
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.
Equations
- Nat.instAddCommSemigroup = inferInstance
Miscellaneous lemmas #
Parity #
Equations
- x.instDecidablePredEven = decidable_of_iff (x % 2 = 0) ⋯
IsSquare
can be decided on ℕ
by checking against the square root.
Equations
- m.instDecidablePredIsSquare = decidable_of_iff' (m.sqrt * m.sqrt = m) ⋯
Units #
Equations
- Nat.unique_units = { default := 1, uniq := Nat.units_eq_one }
Equations
- Nat.unique_addUnits = { default := 0, uniq := Nat.addUnits_eq_zero }