Equations
-
Fin.coeToNat = { coe := fun v => v.val }
Equations
-
Fin.add x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := (a + b) % n, isLt := (_ : (a + b) % n < n) }
Equations
-
Fin.mul x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := a * b % n, isLt := (_ : a * b % n < n) }
Equations
-
Fin.sub x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } =>
{ val := (a + (n - b)) % n, isLt := (_ : (a + (n - b)) % n < n) }
Equations
-
Fin.mod x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := a % b % n, isLt := (_ : a % b % n < n) }
Equations
-
Fin.div x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := a / b % n, isLt := (_ : a / b % n < n) }
Equations
-
Fin.modn x x = match x, x with
| { val := a, isLt := h }, m => { val := a % m % n, isLt := (_ : a % m % n < n) }
Equations
-
Fin.land x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := Nat.land a b % n, isLt := (_ : Nat.land a b % n < n) }
Equations
-
Fin.lor x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := Nat.lor a b % n, isLt := (_ : Nat.lor a b % n < n) }
Equations
-
Fin.xor x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := Nat.xor a b % n, isLt := (_ : Nat.xor a b % n < n) }
Equations
-
Fin.shiftLeft x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := a <<< b % n, isLt := (_ : a <<< b % n < n) }
Equations
-
Fin.shiftRight x x = match x, x with
| { val := a, isLt := h }, { val := b, isLt := x } => { val := a >>> b % n, isLt := (_ : a >>> b % n < n) }
Equations
-
Fin.instAddFin = { add := Fin.add }
Equations
-
Fin.instSubFin = { sub := Fin.sub }
Equations
-
Fin.instMulFin = { mul := Fin.mul }
Equations
-
Fin.instModFin = { mod := Fin.mod }
Equations
-
Fin.instDivFin = { div := Fin.div }
Equations
-
Fin.instAndOpFin = { and := Fin.land }
Equations
-
Fin.instOrOpFin = { or := Fin.lor }
Equations
-
Fin.instXorFin = { xor := Fin.xor }
Equations
-
Fin.instShiftLeftFin = { shiftLeft := Fin.shiftLeft }
Equations
-
Fin.instShiftRightFin = { shiftRight := Fin.shiftRight }
Equations
-
Fin.instHModFinNat = { hMod := Fin.modn }
Equations
-
Fin.instOfNatFinHAddNatInstHAddInstAddNatOfNat = { ofNat := Fin.ofNat i }
Equations
-
Fin.instInhabitedFinHAddNatInstHAddInstAddNatOfNat = { default := 0 }