Fin is a group #
This file contains the additive and multiplicative monoid instances on Fin n
.
See note [foundational algebra order theory].
Instances #
Equations
- Fin.addCommSemigroup n = { toAdd := Fin.instAdd, add_assoc := ⋯, add_comm := ⋯ }
Equations
- Fin.instAddCommSemigroup n = { toAdd := Fin.instAdd, add_assoc := ⋯, add_comm := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
This is not a global instance, but can introduced locally using open Fin.NatCast in ...
.
This is not an instance because the binop%
elaborator assumes that
there are no non-trivial coercion loops,
but this instance would introduce a coercion from Nat
to Fin n
and back.
Non-trivial loops lead to undesirable and counterintuitive elaboration behavior.
For example, for x : Fin k
and n : Nat
,
it causes x < n
to be elaborated as x < ↑n
rather than ↑x < n
,
silently introducing wraparound arithmetic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Note this is more general than Fin.addCommGroup
as it applies (vacuously) to Fin 0
too.
Equations
- Fin.instInvolutiveNeg n = { toNeg := Fin.neg n, neg_neg := ⋯ }
Note this is more general than Fin.addCommGroup
as it applies (vacuously) to Fin 0
too.
Note this is more general than Fin.addCommGroup
as it applies (vacuously) to Fin 0
too.
Equations
- Fin.instAddLeftCancelSemigroup n = { toAddSemigroup := (Fin.addCommSemigroup n).toAddSemigroup, add_left_cancel := ⋯ }
Note this is more general than Fin.addCommGroup
as it applies (vacuously) to Fin 0
too.
Equations
- Fin.instAddRightCancelSemigroup n = { toAddSemigroup := (Fin.addCommSemigroup n).toAddSemigroup, add_right_cancel := ⋯ }