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.
theorem
is_square_op_iff
{α : Type u_2}
[has_mul α]
(a : α) :
is_square (mul_opposite.op a) ↔ is_square a
theorem
is_square.map
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[mul_one_class α]
[mul_one_class β]
[monoid_hom_class F α β]
{m : α}
(f : F) :
theorem
even.map
{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[add_zero_class α]
[add_zero_class β]
[add_monoid_hom_class F α β]
{m : α}
(f : F) :
Alias of the forwards direction of
even_iff_exists_two_nsmul
.
Alias of the backwards direction of
even_iff_exists_two_nsmul
.
@[simp]
@[simp]
Alias of the reverse direction of is_square_inv
.
Alias of the reverse direction of is_square_inv
.
theorem
even.neg_one_zpow
{α : Type u_2}
[division_monoid α]
[has_distrib_neg α]
{n : ℤ}
(h : even n) :
theorem
is_square.div
{α : Type u_2}
[division_comm_monoid α]
{a b : α}
(ha : is_square a)
(hb : is_square b) :
theorem
even.tsub
{α : Type u_2}
[canonically_linear_ordered_add_monoid α]
[has_sub α]
[has_ordered_sub α]
[contravariant_class α α has_add.add has_le.le]
{m n : α}
(hm : even m)
(hn : even n) :
Alias of the forward direction of even_iff_two_dvd
.
theorem
odd.pos
{α : Type u_2}
[canonically_ordered_comm_semiring α]
[nontrivial α]
{n : α}
(hn : odd n) :
0 < n
theorem
even.pow_pos
{R : Type u_4}
[linear_ordered_ring R]
{a : R}
{n : ℕ}
(hn : even n)
(ha : a ≠ 0) :
theorem
odd.pow_nonpos
{R : Type u_4}
[linear_ordered_ring R]
{a : R}
{n : ℕ}
(hn : odd n)
(ha : a ≤ 0) :
theorem
odd.pow_neg
{R : Type u_4}
[linear_ordered_ring R]
{a : R}
{n : ℕ}
(hn : odd n)
(ha : a < 0) :
theorem
odd.strict_mono_pow
{R : Type u_4}
[linear_ordered_ring R]
{n : ℕ}
(hn : odd n) :
strict_mono (λ (a : R), a ^ n)