Skip to content

Commit 96747a0

Browse files
mo271laughinggas
andcommitted
feat: Dirichlet character (#7010)
- [x] depends on: #7013 Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: laughinggas <58670661+laughinggas@users.noreply.github.com>
1 parent 904dc41 commit 96747a0

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,6 +2560,7 @@ import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots
25602560
import Mathlib.NumberTheory.Cyclotomic.Rat
25612561
import Mathlib.NumberTheory.Dioph
25622562
import Mathlib.NumberTheory.DiophantineApproximation
2563+
import Mathlib.NumberTheory.DirichletCharacter.Basic
25632564
import Mathlib.NumberTheory.Divisors
25642565
import Mathlib.NumberTheory.FLT.Basic
25652566
import Mathlib.NumberTheory.FLT.Four
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/-
2+
Copyright (c) 2023 Ashvni Narayanan. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Ashvni Narayanan, Moritz Firsching
5+
-/
6+
import Mathlib.Algebra.Periodic
7+
import Mathlib.NumberTheory.LegendreSymbol.MulCharacter
8+
import Mathlib.Data.ZMod.Algebra
9+
10+
/-!
11+
# Dirichlet Characters
12+
13+
Let `R` be a commutative monoid with zero. A Dirichlet character `χ` of level `n` over `R` is a
14+
multiplicative character from `ZMod n` to `R` sending non-units to 0. We then obtain some properties
15+
of `toUnitHom χ`, the restriction of `χ` to a group homomorphism `(ZMod n)ˣ →* Rˣ`.
16+
17+
Main definitions:
18+
19+
- `DirichletCharacter`: The type representing a Dirichlet character.
20+
21+
## TODO
22+
23+
- `change_level`: Extend the Dirichlet character χ of level `n` to level `m`, where `n` divides `m`.
24+
- definition of conductor
25+
26+
## Tags
27+
28+
dirichlet character, multiplicative character
29+
-/
30+
31+
/-- The type of Dirichlet characters of level `n`. -/
32+
abbrev DirichletCharacter (R : Type) [CommMonoidWithZero R] (n : ℕ) := MulChar (ZMod n) R
33+
34+
open MulChar
35+
variable {R : Type} [CommMonoidWithZero R] {n : ℕ} (χ : DirichletCharacter R n)
36+
37+
namespace DirichletCharacter
38+
lemma toUnitHom_eq_char' {a : ZMod n} (ha : IsUnit a) :
39+
χ a = χ.toUnitHom ha.unit := by simp
40+
41+
lemma toUnitHom_eq_iff (ψ : DirichletCharacter R n) :
42+
toUnitHom χ = toUnitHom ψ ↔ χ = ψ := by simp
43+
44+
lemma eval_modulus_sub (x : ZMod n) :
45+
χ (n - x) = χ (-x) := by simp
46+
47+
lemma periodic {m : ℕ} (hm : n ∣ m) : Function.Periodic χ m := by
48+
intro a
49+
rw [← ZMod.nat_cast_zmod_eq_zero_iff_dvd] at hm
50+
simp only [hm, add_zero]
51+
52+
end DirichletCharacter

Mathlib/NumberTheory/LegendreSymbol/MulCharacter.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ theorem equivToUnitHom_symm_coe (f : Rˣ →* R'ˣ) (a : Rˣ) : equivToUnitHom.s
237237
ofUnitHom_coe f a
238238
#align mul_char.equiv_unit_hom_symm_coe MulChar.equivToUnitHom_symm_coe
239239

240+
@[simp]
241+
lemma coe_toMonoidHom [CommMonoid R] (χ : MulChar R R')
242+
(x : R) : χ.toMonoidHom x = χ x := rfl
243+
240244
/-!
241245
### Commutative group structure on multiplicative characters
242246

0 commit comments

Comments
 (0)