File: Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean

full_name: ZMod.χ₄_apply
code: /-- Define the nontrivial quadratic character on `ZMod 4`, `χ₄`.
It corresponds to the extension `ℚ(√-1)/ℚ`. -/
@[simps]
def χ₄ : MulChar (ZMod 4) ℤ 
goal: ZMod.χ₄ a =
  match a with
  | 0 => 0
  | 2 => 0
  | 1 => 1
  | 3 => -1

full_name: ZMod.χ₄
code: /-- Define the nontrivial quadratic character on `ZMod 4`, `χ₄`.
It corresponds to the extension `ℚ(√-1)/ℚ`. -/
@[simps]
def χ₄ : MulChar (ZMod 4) ℤ 
goal: MulChar (ZMod 4) ℤ

full_name: ZMod.isQuadratic_χ₄
code: /-- `χ₄` takes values in `{0, 1, -1}` -/
theorem isQuadratic_χ₄ : χ₄.IsQuadratic 
goal: ZMod.χ₄.IsQuadratic

full_name: ZMod.χ₄_nat_mod_four
code: /-- The value of `χ₄ n`, for `n : ℕ`, depends only on `n % 4`. -/
theorem χ₄_nat_mod_four (n : ℕ) : χ₄ n = χ₄ (n % 4 : ℕ) 
goal: ZMod.χ₄ ↑n = ZMod.χ₄ ↑(n % 4)

full_name: ZMod.χ₄_int_mod_four
code: /-- The value of `χ₄ n`, for `n : ℤ`, depends only on `n % 4`. -/
theorem χ₄_int_mod_four (n : ℤ) : χ₄ n = χ₄ (n % 4 : ℤ) 
goal: ZMod.χ₄ ↑n = ZMod.χ₄ ↑(n % 4)

full_name: ZMod.χ₄_int_eq_if_mod_four
code: /-- An explicit description of `χ₄` on integers / naturals -/
theorem χ₄_int_eq_if_mod_four (n : ℤ) :
    χ₄ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 
goal: ZMod.χ₄ ↑n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1

full_name: ZMod.χ₄_nat_eq_if_mod_four
code: theorem χ₄_nat_eq_if_mod_four (n : ℕ) :
    χ₄ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 
goal: ZMod.χ₄ ↑n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1

full_name: ZMod.χ₄_eq_neg_one_pow
code: /-- Alternative description of `χ₄ n` for odd `n : ℕ` in terms of powers of `-1` -/
theorem χ₄_eq_neg_one_pow {n : ℕ} (hn : n % 2 = 1) : χ₄ n = (-1) ^ (n / 2) 
goal: ZMod.χ₄ ↑n = (-1) ^ (n / 2)

full_name: ZMod.χ₄_nat_one_mod_four
code: /-- If `n % 4 = 1`, then `χ₄ n = 1`. -/
theorem χ₄_nat_one_mod_four {n : ℕ} (hn : n % 4 = 1) : χ₄ n = 1 
goal: ZMod.χ₄ ↑n = 1

full_name: ZMod.χ₄_nat_three_mod_four
code: /-- If `n % 4 = 3`, then `χ₄ n = -1`. -/
theorem χ₄_nat_three_mod_four {n : ℕ} (hn : n % 4 = 3) : χ₄ n = -1 
goal: ZMod.χ₄ ↑n = -1

full_name: ZMod.χ₄_int_one_mod_four
code: /-- If `n % 4 = 1`, then `χ₄ n = 1`. -/
theorem χ₄_int_one_mod_four {n : ℤ} (hn : n % 4 = 1) : χ₄ n = 1 
goal: ZMod.χ₄ ↑n = 1

full_name: ZMod.χ₄_int_three_mod_four
code: /-- If `n % 4 = 3`, then `χ₄ n = -1`. -/
theorem χ₄_int_three_mod_four {n : ℤ} (hn : n % 4 = 3) : χ₄ n = -1 
goal: ZMod.χ₄ ↑n = -1

full_name: ZMod.neg_one_pow_div_two_of_one_mod_four
code: /-- If `n % 4 = 1`, then `(-1)^(n/2) = 1`. -/
theorem neg_one_pow_div_two_of_one_mod_four {n : ℕ} (hn : n % 4 = 1) : (-1 : ℤ) ^ (n / 2) = 1 
goal: (-1) ^ (n / 2) = 1

full_name: ZMod.neg_one_pow_div_two_of_three_mod_four
code: /-- If `n % 4 = 3`, then `(-1)^(n/2) = -1`. -/
theorem neg_one_pow_div_two_of_three_mod_four {n : ℕ} (hn : n % 4 = 3) : (-1 : ℤ) ^ (n / 2) = -1 
goal: (-1) ^ (n / 2) = -1

full_name: ZMod.χ₈
code: /-- Define the first primitive quadratic character on `ZMod 8`, `χ₈`.
It corresponds to the extension `ℚ(√2)/ℚ`. -/
@[simps]
def χ₈ : MulChar (ZMod 8) ℤ 
goal: MulChar (ZMod 8) ℤ

full_name: ZMod.χ₈_apply
code: /-- Define the first primitive quadratic character on `ZMod 8`, `χ₈`.
It corresponds to the extension `ℚ(√2)/ℚ`. -/
@[simps]
def χ₈ : MulChar (ZMod 8) ℤ 
goal: ZMod.χ₈ a =
  match a with
  | 0 => 0
  | 2 => 0
  | 4 => 0
  | 6 => 0
  | 1 => 1
  | 7 => 1
  | 3 => -1
  | 5 => -1

full_name: ZMod.isQuadratic_χ₈
code: /-- `χ₈` takes values in `{0, 1, -1}` -/
theorem isQuadratic_χ₈ : χ₈.IsQuadratic 
goal: ZMod.χ₈.IsQuadratic

full_name: ZMod.χ₈_nat_mod_eight
code: /-- The value of `χ₈ n`, for `n : ℕ`, depends only on `n % 8`. -/
theorem χ₈_nat_mod_eight (n : ℕ) : χ₈ n = χ₈ (n % 8 : ℕ) 
goal: ZMod.χ₈ ↑n = ZMod.χ₈ ↑(n % 8)

full_name: ZMod.χ₈_int_mod_eight
code: /-- The value of `χ₈ n`, for `n : ℤ`, depends only on `n % 8`. -/
theorem χ₈_int_mod_eight (n : ℤ) : χ₈ n = χ₈ (n % 8 : ℤ) 
goal: ZMod.χ₈ ↑n = ZMod.χ₈ ↑(n % 8)

full_name: ZMod.χ₈_int_eq_if_mod_eight
code: /-- An explicit description of `χ₈` on integers / naturals -/
theorem χ₈_int_eq_if_mod_eight (n : ℤ) :
    χ₈ n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1 
goal: ZMod.χ₈ ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1

full_name: ZMod.χ₈_nat_eq_if_mod_eight
code: theorem χ₈_nat_eq_if_mod_eight (n : ℕ) :
    χ₈ n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1 
goal: ZMod.χ₈ ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1

full_name: ZMod.χ₈'_apply
code: /-- Define the second primitive quadratic character on `ZMod 8`, `χ₈'`.
It corresponds to the extension `ℚ(√-2)/ℚ`. -/
@[simps]
def χ₈' : MulChar (ZMod 8) ℤ 
goal: ZMod.χ₈' a =
  match a with
  | 0 => 0
  | 2 => 0
  | 4 => 0
  | 6 => 0
  | 1 => 1
  | 3 => 1
  | 5 => -1
  | 7 => -1

full_name: ZMod.χ₈'
code: /-- Define the second primitive quadratic character on `ZMod 8`, `χ₈'`.
It corresponds to the extension `ℚ(√-2)/ℚ`. -/
@[simps]
def χ₈' : MulChar (ZMod 8) ℤ 
goal: MulChar (ZMod 8) ℤ

full_name: ZMod.isQuadratic_χ₈'
code: /-- `χ₈'` takes values in `{0, 1, -1}` -/
theorem isQuadratic_χ₈' : χ₈'.IsQuadratic 
goal: ZMod.χ₈'.IsQuadratic

full_name: ZMod.χ₈'_int_eq_if_mod_eight
code: /-- An explicit description of `χ₈'` on integers / naturals -/
theorem χ₈'_int_eq_if_mod_eight (n : ℤ) :
    χ₈' n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1 
goal: ZMod.χ₈' ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1

full_name: ZMod.χ₈'_nat_eq_if_mod_eight
code: theorem χ₈'_nat_eq_if_mod_eight (n : ℕ) :
    χ₈' n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1 
goal: ZMod.χ₈' ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1

full_name: ZMod.χ₈'_eq_χ₄_mul_χ₈
code: /-- The relation between `χ₄`, `χ₈` and `χ₈'` -/
theorem χ₈'_eq_χ₄_mul_χ₈ : ∀ a : ZMod 8, χ₈' a = χ₄ (cast a) * χ₈ a 
goal: ZMod.χ₈' a = ZMod.χ₄ a.cast * ZMod.χ₈ a

full_name: ZMod.χ₈'_int_eq_χ₄_mul_χ₈
code: theorem χ₈'_int_eq_χ₄_mul_χ₈ (a : ℤ) : χ₈' a = χ₄ a * χ₈ a 
goal: ZMod.χ₈' ↑a = ZMod.χ₄ ↑a * ZMod.χ₈ ↑a