File: Mathlib/NumberTheory/NumberField/Basic.lean

full_name: NumberField
code: /-- A number field is a field which has characteristic zero and is finite
dimensional over ℚ. -/
class NumberField (K : Type*) [Field K] : Prop where
  [to_charZero : CharZero K]
  [to_finiteDimensional : FiniteDimensional ℚ K]
goal: Prop

full_name: NumberField.to_charZero
code: /-- A number field is a field which has characteristic zero and is finite
dimensional over ℚ. -/
class NumberField (K : Type*) [Field K] : Prop where
  [to_charZero : CharZero K]
  [to_finiteDimensional : FiniteDimensional ℚ K]
goal: CharZero K

full_name: NumberField.to_finiteDimensional
code: /-- A number field is a field which has characteristic zero and is finite
dimensional over ℚ. -/
class NumberField (K : Type*) [Field K] : Prop where
  [to_charZero : CharZero K]
  [to_finiteDimensional : FiniteDimensional ℚ K]
goal: FiniteDimensional ℚ K

full_name: Int.not_isField
code: /-- `ℤ` with its usual ring structure is not a field. -/
theorem Int.not_isField : ¬IsField ℤ 
goal: ¬IsField ℤ

full_name: NumberField.isAlgebraic
code: protected theorem isAlgebraic : Algebra.IsAlgebraic ℚ K 
goal: Algebra.IsAlgebraic ℚ K

full_name: NumberField.instFiniteDimensional
code: instance [NumberField L] [Algebra K L] : FiniteDimensional K L 
goal: FiniteDimensional K L

full_name: NumberField.RingOfIntegers
code: /-- The ring of integers (or number ring) corresponding to a number field
is the integral closure of ℤ in the number field.

This is defined as its own type, rather than a `Subalgebra`, for performance reasons:
looking for instances of the form `SMul (RingOfIntegers _) (RingOfIntegers _)` makes
much more effective use of the discrimination tree than instances of the form
`SMul (Subtype _) (Subtype _)`.
The drawback is we have to copy over instances manually.
-/
def RingOfIntegers : Type _ 
goal: Type u_1

full_name: NumberField._aux_Mathlib_NumberTheory_NumberField_Basic___unexpand_NumberField_RingOfIntegers_1
code: @[inherit_doc] scoped notation "𝓞" => NumberField.RingOfIntegers
goal: Lean.PrettyPrinter.Unexpander

full_name: NumberField._aux_Mathlib_NumberTheory_NumberField_Basic___macroRules_NumberField_term𝓞_1
code: @[inherit_doc] scoped notation "𝓞" => NumberField.RingOfIntegers
goal: Lean.Macro

full_name: NumberField.RingOfIntegers.instCommRing
code: instance : CommRing (𝓞 K) 
goal: CommRing (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instIsDomain
code: instance : IsDomain (𝓞 K) 
goal: IsDomain (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instCharZero
code: instance : CharZero (𝓞 K) 
goal: CharZero (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instAlgebra
code: instance : Algebra (𝓞 K) K 
goal: Algebra (NumberField.RingOfIntegers K) K

full_name: NumberField.RingOfIntegers.instNoZeroSMulDivisors
code: instance : NoZeroSMulDivisors (𝓞 K) K 
goal: NoZeroSMulDivisors (NumberField.RingOfIntegers K) K

full_name: NumberField.RingOfIntegers.instNontrivial
code: instance : Nontrivial (𝓞 K) 
goal: Nontrivial (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instAlgebra_1
code: instance {L : Type*} [Ring L] [Algebra K L] : Algebra (𝓞 K) L 
goal: Algebra (NumberField.RingOfIntegers K) L

full_name: NumberField.RingOfIntegers.instIsScalarTower
code: instance {L : Type*} [Ring L] [Algebra K L] :  IsScalarTower (𝓞 K) K L 
goal: IsScalarTower (NumberField.RingOfIntegers K) K L

full_name: NumberField.RingOfIntegers.val
code: /-- The canonical coercion from `𝓞 K` to `K`. -/
@[coe]
abbrev val (x : 𝓞 K) : K 
goal: K

full_name: NumberField.RingOfIntegers.instCoeHead
code: /-- This instance has to be `CoeHead` because we only want to apply it from `𝓞 K` to `K`. -/
instance : CoeHead (𝓞 K) K 
goal: CoeHead (NumberField.RingOfIntegers K) K

full_name: NumberField.RingOfIntegers.coe_eq_algebraMap
code: lemma coe_eq_algebraMap (x : 𝓞 K) : (x : K) = algebraMap _ _ x 
goal: ↑x = (algebraMap (NumberField.RingOfIntegers K) K) x

full_name: NumberField.RingOfIntegers.ext
code: @[ext] theorem ext {x y : 𝓞 K} (h : (x : K) = (y : K)) : x = y 
goal: x = y

full_name: NumberField.RingOfIntegers.ext_iff
code: theorem ext_iff {x y : 𝓞 K} : x = y ↔ (x : K) = (y : K) 
goal: x = y ↔ ↑x = ↑y

full_name: NumberField.RingOfIntegers.eq_iff
code: @[norm_cast]
theorem eq_iff {x y : 𝓞 K} : (x : K) = (y : K) ↔ x = y 
goal: ↑x = ↑y ↔ x = y

full_name: NumberField.RingOfIntegers.map_mk
code: @[simp] lemma map_mk (x : K) (hx) : algebraMap (𝓞 K) K ⟨x, hx⟩ = x 
goal: (algebraMap (NumberField.RingOfIntegers K) K) ⟨x, hx⟩ = x

full_name: NumberField.RingOfIntegers.coe_mk
code: lemma coe_mk {x : K} (hx) : ((⟨x, hx⟩ : 𝓞 K) : K) = x 
goal: ↑⟨x, hx⟩ = x

full_name: NumberField.RingOfIntegers.mk_eq_mk
code: lemma mk_eq_mk (x y : K) (hx hy) : (⟨x, hx⟩ : 𝓞 K) = ⟨y, hy⟩ ↔ x = y 
goal: ⟨x, hx⟩ = ⟨y, hy⟩ ↔ x = y

full_name: NumberField.RingOfIntegers.mk_one
code: @[simp] lemma mk_one : (⟨1, one_mem _⟩ : 𝓞 K) = 1 
goal: ⟨1, ⋯⟩ = 1

full_name: NumberField.RingOfIntegers.mk_zero
code: @[simp] lemma mk_zero : (⟨0, zero_mem _⟩ : 𝓞 K) = 0 
goal: ⟨0, ⋯⟩ = 0

full_name: NumberField.RingOfIntegers.mk_add_mk
code: @[simp] lemma mk_add_mk (x y : K) (hx hy) : (⟨x, hx⟩ : 𝓞 K) + ⟨y, hy⟩ = ⟨x + y, add_mem hx hy⟩ 
goal: ⟨x, hx⟩ + ⟨y, hy⟩ = ⟨x + y, ⋯⟩

full_name: NumberField.RingOfIntegers.mk_mul_mk
code: @[simp] lemma mk_mul_mk (x y : K) (hx hy) : (⟨x, hx⟩ : 𝓞 K) * ⟨y, hy⟩ = ⟨x * y, mul_mem hx hy⟩ 
goal: ⟨x, hx⟩ * ⟨y, hy⟩ = ⟨x * y, ⋯⟩

full_name: NumberField.RingOfIntegers.mk_sub_mk
code: @[simp] lemma mk_sub_mk (x y : K) (hx hy) : (⟨x, hx⟩ : 𝓞 K) - ⟨y, hy⟩ = ⟨x - y, sub_mem hx hy⟩ 
goal: ⟨x, hx⟩ - ⟨y, hy⟩ = ⟨x - y, ⋯⟩

full_name: NumberField.RingOfIntegers.neg_mk
code: @[simp] lemma neg_mk (x : K) (hx) : (-⟨x, hx⟩ : 𝓞 K) = ⟨-x, neg_mem hx⟩ 
goal: -⟨x, hx⟩ = ⟨-x, ⋯⟩

full_name: NumberField.inst_ringOfIntegersAlgebra
code: /-- Given an algebra between two fields, create an algebra between their two rings of integers. -/
instance inst_ringOfIntegersAlgebra [Algebra K L] : Algebra (𝓞 K) (𝓞 L) 
goal: Algebra (NumberField.RingOfIntegers K) (NumberField.RingOfIntegers L)

full_name: NumberField.RingOfIntegers.coe_injective
code: /-- The canonical map from `𝓞 K` to `K` is injective.

This is a convenient abbreviation for `NoZeroSMulDivisors.algebraMap_injective`.
-/
lemma coe_injective : Function.Injective (algebraMap (𝓞 K) K) 
goal: Function.Injective ⇑(algebraMap (NumberField.RingOfIntegers K) K)

full_name: NumberField.RingOfIntegers.coe_eq_zero_iff
code: /-- The canonical map from `𝓞 K` to `K` is injective.

This is a convenient abbreviation for `map_eq_zero_iff` applied to
`NoZeroSMulDivisors.algebraMap_injective`.
-/
@[simp] lemma coe_eq_zero_iff {x : 𝓞 K} : algebraMap _ K x = 0 ↔ x = 0 
goal: (algebraMap (NumberField.RingOfIntegers K) K) x = 0 ↔ x = 0

full_name: NumberField.RingOfIntegers.coe_ne_zero_iff
code: /-- The canonical map from `𝓞 K` to `K` is injective.

This is a convenient abbreviation for `map_ne_zero_iff` applied to
`NoZeroSMulDivisors.algebraMap_injective`.
-/
lemma coe_ne_zero_iff {x : 𝓞 K} : algebraMap _ K x ≠ 0 ↔ x ≠ 0 
goal: (algebraMap (NumberField.RingOfIntegers K) K) x ≠ 0 ↔ x ≠ 0

full_name: NumberField.RingOfIntegers.isIntegral_coe
code: theorem isIntegral_coe (x : 𝓞 K) : IsIntegral ℤ (algebraMap _ K x) 
goal: IsIntegral ℤ ((algebraMap (NumberField.RingOfIntegers K) K) x)

full_name: NumberField.RingOfIntegers.isIntegral
code: theorem isIntegral (x : 𝓞 K) : IsIntegral ℤ x 
goal: IsIntegral ℤ x

full_name: NumberField.RingOfIntegers.instIsFractionRing
code: instance [NumberField K] : IsFractionRing (𝓞 K) K 
goal: IsFractionRing (NumberField.RingOfIntegers K) K

full_name: NumberField.RingOfIntegers.instIsIntegralClosureInt
code: instance : IsIntegralClosure (𝓞 K) ℤ K 
goal: IsIntegralClosure (NumberField.RingOfIntegers K) ℤ K

full_name: NumberField.RingOfIntegers.instIsIntegrallyClosed
code: instance [NumberField K] : IsIntegrallyClosed (𝓞 K) 
goal: IsIntegrallyClosed (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.equiv
code: /-- The ring of integers of `K` are equivalent to any integral closure of `ℤ` in `K` -/
protected noncomputable def equiv (R : Type*) [CommRing R] [Algebra R K]
    [IsIntegralClosure R ℤ K] : 𝓞 K ≃+* R 
goal: NumberField.RingOfIntegers K ≃+* R

full_name: NumberField.RingOfIntegers.instCharZero_1
code: instance [CharZero K] : CharZero (𝓞 K) 
goal: CharZero (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instIsNoetherianInt
code: instance : IsNoetherian ℤ (𝓞 K) 
goal: IsNoetherian ℤ (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.not_isField
code: /-- The ring of integers of a number field is not a field. -/
theorem not_isField : ¬IsField (𝓞 K) 
goal: ¬IsField (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instIsDedekindDomain
code: instance : IsDedekindDomain (𝓞 K) 
goal: IsDedekindDomain (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instFreeInt
code: instance : Free ℤ (𝓞 K) 
goal: Module.Free ℤ (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.instIsLocalizationAlgebraMapSubmonoidIntNonZeroDivisors
code: instance : IsLocalization (Algebra.algebraMapSubmonoid (𝓞 K) ℤ⁰) K 
goal: IsLocalization (Algebra.algebraMapSubmonoid (NumberField.RingOfIntegers K) ℤ⁰) K

full_name: NumberField.RingOfIntegers.basis
code: /-- A ℤ-basis of the ring of integers of `K`. -/
noncomputable def basis : Basis (Free.ChooseBasisIndex ℤ (𝓞 K)) ℤ (𝓞 K) 
goal: Basis (Module.Free.ChooseBasisIndex ℤ (NumberField.RingOfIntegers K)) ℤ (NumberField.RingOfIntegers K)

full_name: NumberField.RingOfIntegers.restrict
code: /-- Given `f : M → K` such that `∀ x, IsIntegral ℤ (f x)`, the corresponding function
`M → 𝓞 K`. -/
def restrict (f : M → K) (h : ∀ x, IsIntegral ℤ (f x)) (x : M) : 𝓞 K 
goal: NumberField.RingOfIntegers K

full_name: NumberField.RingOfIntegers.restrict_addMonoidHom
code: /-- Given `f : M →+ K` such that `∀ x, IsIntegral ℤ (f x)`, the corresponding function
`M →+ 𝓞 K`. -/
def restrict_addMonoidHom [AddZeroClass M] (f : M →+ K) (h : ∀ x, IsIntegral ℤ (f x)) :
    M →+ 𝓞 K 
goal: M →+ NumberField.RingOfIntegers K

full_name: NumberField.RingOfIntegers.restrict_monoidHom
code: /-- Given `f : M →* K` such that `∀ x, IsIntegral ℤ (f x)`, the corresponding function
`M →* 𝓞 K`. -/
@[to_additive existing] -- TODO: why doesn't it figure this out by itself?
def restrict_monoidHom [MulOneClass M] (f : M →* K) (h : ∀ x, IsIntegral ℤ (f x)) : M →* 𝓞 K 
goal: M →* NumberField.RingOfIntegers K

full_name: NumberField.integralBasis
code: /-- A basis of `K` over `ℚ` that is also a basis of `𝓞 K` over `ℤ`. -/
noncomputable def integralBasis : Basis (Free.ChooseBasisIndex ℤ (𝓞 K)) ℚ K 
goal: Basis (Module.Free.ChooseBasisIndex ℤ (NumberField.RingOfIntegers K)) ℚ K

full_name: NumberField.integralBasis_apply
code: @[simp]
theorem integralBasis_apply (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
    integralBasis K i = algebraMap (𝓞 K) K (RingOfIntegers.basis K i) 
goal: (NumberField.integralBasis K) i = (algebraMap (NumberField.RingOfIntegers K) K) ((NumberField.RingOfIntegers.basis K) i)

full_name: NumberField.integralBasis_repr_apply
code: @[simp]
theorem integralBasis_repr_apply (x : (𝓞 K)) (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
    (integralBasis K).repr (algebraMap _ _ x) i =
      (algebraMap ℤ ℚ) ((RingOfIntegers.basis K).repr x i) 
goal: ((NumberField.integralBasis K).repr ((algebraMap (NumberField.RingOfIntegers K) K) x)) i =
  (algebraMap ℤ ℚ) (((NumberField.RingOfIntegers.basis K).repr x) i)

full_name: NumberField.mem_span_integralBasis
code: theorem mem_span_integralBasis {x : K} :
    x ∈ Submodule.span ℤ (Set.range (integralBasis K)) ↔ x ∈ (algebraMap (𝓞 K) K).range 
goal: x ∈ Submodule.span ℤ (Set.range ⇑(NumberField.integralBasis K)) ↔
  x ∈ (algebraMap (NumberField.RingOfIntegers K) K).range

full_name: NumberField.RingOfIntegers.rank
code: theorem RingOfIntegers.rank : FiniteDimensional.finrank ℤ (𝓞 K) = FiniteDimensional.finrank ℚ K 
goal: FiniteDimensional.finrank ℤ (NumberField.RingOfIntegers K) = FiniteDimensional.finrank ℚ K

full_name: Rat.numberField
code: instance numberField : NumberField ℚ 
goal: NumberField ℚ

full_name: Rat.ringOfIntegersEquiv
code: /-- The ring of integers of `ℚ` as a number field is just `ℤ`. -/
noncomputable def ringOfIntegersEquiv : 𝓞 ℚ ≃+* ℤ 
goal: NumberField.RingOfIntegers ℚ ≃+* ℤ

full_name: AdjoinRoot.instNumberFieldRat
code: /-- The quotient of `ℚ[X]` by the ideal generated by an irreducible polynomial of `ℚ[X]`
is a number field. -/
instance {f : Polynomial ℚ} [hf : Fact (Irreducible f)] : NumberField (AdjoinRoot f) 
goal: NumberField (AdjoinRoot f)