Squares, even and odd elements #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file proves some general facts about squares, even and odd elements of semirings.
In the implementation, we define is_square
and we let even
be the notion transported by
to_additive
. The definition are therefore as follows:
Odd elements are not unified with a multiplicative notion.
Future work #
- TODO: Try to generalize further the typeclass assumptions on
is_square/even
. For instance, in some cases, there aresemiring
assumptions that I (DT) am not convinced are necessary. - TODO: Consider moving the definition and lemmas about
odd
to a separate file. - TODO: The "old" definition of
even a
asked for the existence of an elementc
such thata = 2 * c
. For this reason, several fixes introduce an extratwo_mul
or← two_mul
. It might be the case that by making a careful choice ofsimp
lemma, this can be avoided.
Alias of the reverse direction of is_square_iff_exists_sq
.
Alias of the forward direction of is_square_iff_exists_sq
.
Alias of the forwards direction of
even_iff_exists_two_nsmul
.
Alias of the backwards direction of
even_iff_exists_two_nsmul
.
Alias of the reverse direction of is_square_inv
.
Alias of the reverse direction of is_square_inv
.
Alias of the forward direction of even_iff_exists_bit0
.
Alias of the forward direction of even_iff_two_dvd
.
Alias of the forward direction of odd_iff_exists_bit1
.