Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: port NumberTheory.NumberField.Units (#5359)
- Loading branch information
1 parent
29c4785
commit 81c3108
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/- | ||
Copyright (c) 2023 Xavier Roblot. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Xavier Roblot | ||
! This file was ported from Lean 3 source module number_theory.number_field.units | ||
! leanprover-community/mathlib commit 00f91228655eecdcd3ac97a7fd8dbcb139fe990a | ||
! Please do not edit these lines, except to modify the commit id | ||
! if you have ported upstream changes. | ||
-/ | ||
import Mathlib.NumberTheory.NumberField.Norm | ||
|
||
/-! | ||
# Units of a number field | ||
We prove results about the group `(π K)Λ£` of units of the ring of integers `π K` of a number | ||
field `K`. | ||
## Main results | ||
* `isUnit_iff_norm`: an algebraic integer `x : π K` is a unit if and only if `|norm β x| = 1` | ||
## Tags | ||
number field, units | ||
-/ | ||
|
||
|
||
open scoped NumberField | ||
|
||
noncomputable section | ||
|
||
open NumberField Units | ||
|
||
section Rat | ||
|
||
theorem Rat.RingOfIntegers.isUnit_iff {x : π β} : IsUnit x β (x : β) = 1 β¨ (x : β) = -1 := by | ||
simp_rw [(isUnit_map_iff (Rat.ringOfIntegersEquiv : π β β+* β€) x).symm, Int.isUnit_iff, | ||
RingEquiv.coe_toRingHom, RingEquiv.map_eq_one_iff, RingEquiv.map_eq_neg_one_iff, β | ||
Subtype.coe_injective.eq_iff]; rfl | ||
#align rat.ring_of_integers.is_unit_iff Rat.RingOfIntegers.isUnit_iff | ||
|
||
end Rat | ||
|
||
variable (K : Type _) [Field K] | ||
|
||
section IsUnit | ||
|
||
attribute [local instance] NumberField.ringOfIntegersAlgebra | ||
|
||
variable {K} | ||
|
||
theorem isUnit_iff_norm [NumberField K] (x : π K) : | ||
IsUnit x β |(RingOfIntegers.norm β x : β)| = 1 := by | ||
convert (RingOfIntegers.isUnit_norm β (F := K)).symm | ||
rw [β abs_one, abs_eq_abs, β Rat.RingOfIntegers.isUnit_iff] | ||
#align is_unit_iff_norm isUnit_iff_norm | ||
|
||
end IsUnit |