Documentation
Mathlib
.
Algebra
.
Group
.
Int
.
Even
Search
return to top
source
Imports
Init
Mathlib.Data.Int.Sqrt
Mathlib.Algebra.Group.Int.Defs
Mathlib.Algebra.Group.Nat.Even
Mathlib.Algebra.Group.Nat.Units
Mathlib.Algebra.Group.Units.Basic
Imported by
Int
.
emod_two_ne_one
Int
.
one_emod_two
Int
.
emod_two_ne_zero
Int
.
even_iff
Int
.
not_even_iff
Int
.
two_dvd_ne_zero
Int
.
instDecidablePredEven
Int
.
instDecidablePredIsSquare
Int
.
not_even_one
Int
.
even_add
Int
.
two_not_dvd_two_mul_add_one
Int
.
even_sub
Int
.
even_add_one
Int
.
even_sub_one
Int
.
even_mul
Int
.
even_pow
Int
.
even_pow'
Int
.
even_coe_nat
Int
.
two_mul_ediv_two_of_even
Int
.
ediv_two_mul_two_of_even
Parity of integers
#
Parity
#
source
@[simp]
theorem
Int
.
emod_two_ne_one
{n :
ℤ
}
:
¬
n
%
2
=
1
↔
n
%
2
=
0
source
@[simp]
theorem
Int
.
one_emod_two
:
1
%
2
=
1
source
theorem
Int
.
emod_two_ne_zero
{n :
ℤ
}
:
¬
n
%
2
=
0
↔
n
%
2
=
1
source
theorem
Int
.
even_iff
{n :
ℤ
}
:
Even
n
↔
n
%
2
=
0
source
theorem
Int
.
not_even_iff
{n :
ℤ
}
:
¬
Even
n
↔
n
%
2
=
1
source
@[simp]
theorem
Int
.
two_dvd_ne_zero
{n :
ℤ
}
:
¬
2
∣
n
↔
n
%
2
=
1
source
instance
Int
.
instDecidablePredEven
:
DecidablePred
Even
Equations
x✝
.instDecidablePredEven
=
decidable_of_iff
(
x✝
%
2
=
0
)
⋯
source
instance
Int
.
instDecidablePredIsSquare
:
DecidablePred
IsSquare
IsSquare
can be decided on
ℤ
by checking against the square root.
Equations
m
.instDecidablePredIsSquare
=
decidable_of_iff'
(
Int.sqrt
m
*
Int.sqrt
m
=
m
)
⋯
source
@[simp]
theorem
Int
.
not_even_one
:
¬
Even
1
source
theorem
Int
.
even_add
{m n :
ℤ
}
:
Even
(
m
+
n
)
↔
(
Even
m
↔
Even
n
)
source
theorem
Int
.
two_not_dvd_two_mul_add_one
(n :
ℤ
)
:
¬
2
∣
2
*
n
+
1
source
theorem
Int
.
even_sub
{m n :
ℤ
}
:
Even
(
m
-
n
)
↔
(
Even
m
↔
Even
n
)
source
theorem
Int
.
even_add_one
{n :
ℤ
}
:
Even
(
n
+
1
)
↔
¬
Even
n
source
theorem
Int
.
even_sub_one
{n :
ℤ
}
:
Even
(
n
-
1
)
↔
¬
Even
n
source
theorem
Int
.
even_mul
{m n :
ℤ
}
:
Even
(
m
*
n
)
↔
Even
m
∨
Even
n
source
theorem
Int
.
even_pow
{m :
ℤ
}
{n :
ℕ
}
:
Even
(
m
^
n
)
↔
Even
m
∧
n
≠
0
source
theorem
Int
.
even_pow'
{m :
ℤ
}
{n :
ℕ
}
(h :
n
≠
0
)
:
Even
(
m
^
n
)
↔
Even
m
source
@[simp]
theorem
Int
.
even_coe_nat
(n :
ℕ
)
:
Even
↑
n
↔
Even
n
source
theorem
Int
.
two_mul_ediv_two_of_even
{n :
ℤ
}
:
Even
n
→
2
*
(
n
/
2
)
=
n
source
theorem
Int
.
ediv_two_mul_two_of_even
{n :
ℤ
}
:
Even
n
→
n
/
2
*
2
=
n