Documentation

Mathlib.Data.Fin.Parity

Parity in Fin n #

In this file we prove that an element k : Fin n is even in Fin n iff n is odd or Fin.val k is even.

theorem Fin.even_of_val {n : } {k : Fin n} (h : Even k) :
theorem Fin.odd_of_val {n : } [NeZero n] {k : Fin n} (h : Odd k) :
Odd k
theorem Fin.even_of_odd {n : } (hn : Odd n) (k : Fin n) :
theorem Fin.odd_of_odd {n : } [NeZero n] (hn : Odd n) (k : Fin n) :
Odd k
theorem Fin.even_iff_of_even {n : } (hn : Even n) {k : Fin n} :
Even k Even k
theorem Fin.odd_iff_of_even {n : } [NeZero n] (hn : Even n) {k : Fin n} :
Odd k Odd k
theorem Fin.even_iff {n : } {k : Fin n} :
Even k Odd n Even k

In Fin n, all elements are even for odd n, otherwise an element is even iff its Fin.val value is even.

theorem Fin.even_iff_imp {n : } {k : Fin n} :
Even k Even nEven k
theorem Fin.odd_iff {n : } [NeZero n] {k : Fin n} :
Odd k Odd n Odd k

In Fin n, all elements are odd for odd n, otherwise an element is odd iff its Fin.val value is odd.

theorem Fin.odd_iff_imp {n : } [NeZero n] {k : Fin n} :
Odd k Even nOdd k
theorem Fin.even_iff_mod_of_even {n : } (hn : Even n) {k : Fin n} :
Even k k % 2 = 0
theorem Fin.odd_iff_mod_of_even {n : } [NeZero n] (hn : Even n) {k : Fin n} :
Odd k k % 2 = 1
theorem Fin.not_odd_iff_even_of_even {n : } [NeZero n] (hn : Even n) {k : Fin n} :
theorem Fin.not_even_iff_odd_of_even {n : } [NeZero n] (hn : Even n) {k : Fin n} :
theorem Fin.odd_add_one_iff_even {n : } [NeZero n] {k : Fin n} :
Odd (k + 1) Even k
theorem Fin.even_add_one_iff_odd {n : } [NeZero n] {k : Fin n} :
Even (k + 1) Odd k