File: Mathlib/NumberTheory/Padics/PadicIntegers.lean

full_name: PadicInt
code: /-- The `p`-adic integers `ℤ_[p]` are the `p`-adic numbers with norm `≤ 1`. -/
def PadicInt (p : ℕ) [Fact p.Prime] 
goal: Type

full_name: _aux_Mathlib_NumberTheory_Padics_PadicIntegers___unexpand_PadicInt_1
code: /-- The ring of `p`-adic integers. -/
notation "ℤ_[" p "]" => PadicInt p
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_NumberTheory_Padics_PadicIntegers___macroRules_termℤ_[_]_1»
code: /-- The ring of `p`-adic integers. -/
notation "ℤ_[" p "]" => PadicInt p
goal: Lean.Macro

full_name: PadicInt.instCoePadic
code: instance : Coe ℤ_[p] ℚ_[p] 
goal: Coe ℤ_[p] ℚ_[p]

full_name: PadicInt.ext
code: theorem ext {x y : ℤ_[p]} : (x : ℚ_[p]) = y → x = y 
goal: ↑x = ↑y → x = y

full_name: PadicInt.subring
code: /-- The `p`-adic integers as a subring of `ℚ_[p]`. -/
def subring : Subring ℚ_[p] 
goal: Subring ℚ_[p]

full_name: PadicInt.mem_subring_iff
code: @[simp]
theorem mem_subring_iff {x : ℚ_[p]} : x ∈ subring p ↔ ‖x‖ ≤ 1 
goal: x ∈ PadicInt.subring p ↔ ‖x‖ ≤ 1

full_name: PadicInt.instAdd
code: /-- Addition on `ℤ_[p]` is inherited from `ℚ_[p]`. -/
instance : Add ℤ_[p] 
goal: Add ℤ_[p]

full_name: PadicInt.instMul
code: /-- Multiplication on `ℤ_[p]` is inherited from `ℚ_[p]`. -/
instance : Mul ℤ_[p] 
goal: Mul ℤ_[p]

full_name: PadicInt.instNeg
code: /-- Negation on `ℤ_[p]` is inherited from `ℚ_[p]`. -/
instance : Neg ℤ_[p] 
goal: Neg ℤ_[p]

full_name: PadicInt.instSub
code: /-- Subtraction on `ℤ_[p]` is inherited from `ℚ_[p]`. -/
instance : Sub ℤ_[p] 
goal: Sub ℤ_[p]

full_name: PadicInt.instZero
code: /-- Zero on `ℤ_[p]` is inherited from `ℚ_[p]`. -/
instance : Zero ℤ_[p] 
goal: Zero ℤ_[p]

full_name: PadicInt.instInhabited
code: instance : Inhabited ℤ_[p] 
goal: Inhabited ℤ_[p]

full_name: PadicInt.instOne
code: /-- One on `ℤ_[p]` is inherited from `ℚ_[p]`. -/
instance : One ℤ_[p] 
goal: One ℤ_[p]

full_name: PadicInt.mk_zero
code: @[simp]
theorem mk_zero {h} : (⟨0, h⟩ : ℤ_[p]) = (0 : ℤ_[p]) 
goal: ⟨0, h⟩ = 0

full_name: PadicInt.coe_add
code: @[simp, norm_cast]
theorem coe_add (z1 z2 : ℤ_[p]) : ((z1 + z2 : ℤ_[p]) : ℚ_[p]) = z1 + z2 
goal: ↑(z1 + z2) = ↑z1 + ↑z2

full_name: PadicInt.coe_mul
code: @[simp, norm_cast]
theorem coe_mul (z1 z2 : ℤ_[p]) : ((z1 * z2 : ℤ_[p]) : ℚ_[p]) = z1 * z2 
goal: ↑(z1 * z2) = ↑z1 * ↑z2

full_name: PadicInt.coe_neg
code: @[simp, norm_cast]
theorem coe_neg (z1 : ℤ_[p]) : ((-z1 : ℤ_[p]) : ℚ_[p]) = -z1 
goal: ↑(-z1) = -↑z1

full_name: PadicInt.coe_sub
code: @[simp, norm_cast]
theorem coe_sub (z1 z2 : ℤ_[p]) : ((z1 - z2 : ℤ_[p]) : ℚ_[p]) = z1 - z2 
goal: ↑(z1 - z2) = ↑z1 - ↑z2

full_name: PadicInt.coe_one
code: @[simp, norm_cast]
theorem coe_one : ((1 : ℤ_[p]) : ℚ_[p]) = 1 
goal: ↑1 = 1

full_name: PadicInt.coe_zero
code: @[simp, norm_cast]
theorem coe_zero : ((0 : ℤ_[p]) : ℚ_[p]) = 0 
goal: ↑0 = 0

full_name: PadicInt.coe_eq_zero
code: theorem coe_eq_zero (z : ℤ_[p]) : (z : ℚ_[p]) = 0 ↔ z = 0 
goal: ↑z = 0 ↔ z = 0

full_name: PadicInt.coe_ne_zero
code: theorem coe_ne_zero (z : ℤ_[p]) : (z : ℚ_[p]) ≠ 0 ↔ z ≠ 0 
goal: ↑z ≠ 0 ↔ z ≠ 0

full_name: PadicInt.instAddCommGroup
code: instance : AddCommGroup ℤ_[p] 
goal: AddCommGroup ℤ_[p]

full_name: PadicInt.instCommRing
code: instance instCommRing : CommRing ℤ_[p] 
goal: CommRing ℤ_[p]

full_name: PadicInt.coe_natCast
code: @[simp, norm_cast]
theorem coe_natCast (n : ℕ) : ((n : ℤ_[p]) : ℚ_[p]) = n 
goal: ↑↑n = ↑n

full_name: PadicInt.coe_intCast
code: @[simp, norm_cast]
theorem coe_intCast (z : ℤ) : ((z : ℤ_[p]) : ℚ_[p]) = z 
goal: ↑↑z = ↑z

full_name: PadicInt.Coe.ringHom
code: /-- The coercion from `ℤ_[p]` to `ℚ_[p]` as a ring homomorphism. -/
def Coe.ringHom : ℤ_[p] →+* ℚ_[p] 
goal: ℤ_[p] →+* ℚ_[p]

full_name: PadicInt.coe_pow
code: @[simp, norm_cast]
theorem coe_pow (x : ℤ_[p]) (n : ℕ) : (↑(x ^ n) : ℚ_[p]) = (↑x : ℚ_[p]) ^ n 
goal: ↑(x ^ n) = ↑x ^ n

full_name: PadicInt.mk_coe
code: theorem mk_coe (k : ℤ_[p]) : (⟨k, k.2⟩ : ℤ_[p]) = k 
goal: ⟨↑k, ⋯⟩ = k

full_name: PadicInt.inv
code: /-- The inverse of a `p`-adic integer with norm equal to `1` is also a `p`-adic integer.
Otherwise, the inverse is defined to be `0`. -/
def inv : ℤ_[p] → ℤ_[p]
  
goal: ℤ_[p] → ℤ_[p]

full_name: PadicInt.instCharZero
code: instance : CharZero ℤ_[p] 
goal: CharZero ℤ_[p]

full_name: PadicInt.intCast_eq
code: @[norm_cast] -- @[simp] -- Porting note: not in simpNF
theorem intCast_eq (z1 z2 : ℤ) : (z1 : ℤ_[p]) = z2 ↔ z1 = z2 
goal: ↑z1 = ↑z2 ↔ z1 = z2

full_name: PadicInt.ofIntSeq
code: /-- A sequence of integers that is Cauchy with respect to the `p`-adic norm converges to a `p`-adic
integer. -/
def ofIntSeq (seq : ℕ → ℤ) (h : IsCauSeq (padicNorm p) fun n => seq n) : ℤ_[p] 
goal: ℤ_[p]

full_name: PadicInt.instMetricSpace
code: instance : MetricSpace ℤ_[p] 
goal: MetricSpace ℤ_[p]

full_name: PadicInt.completeSpace
code: instance completeSpace : CompleteSpace ℤ_[p] 
goal: CompleteSpace ℤ_[p]

full_name: PadicInt.instNorm
code: instance : Norm ℤ_[p] 
goal: Norm ℤ_[p]

full_name: PadicInt.norm_def
code: theorem norm_def {z : ℤ_[p]} : ‖z‖ = ‖(z : ℚ_[p])‖ 
goal: ‖z‖ = ‖↑z‖

full_name: PadicInt.instNormedCommRing
code: instance : NormedCommRing ℤ_[p] 
goal: NormedCommRing ℤ_[p]

full_name: PadicInt.instNormOneClass
code: instance : NormOneClass ℤ_[p] 
goal: NormOneClass ℤ_[p]

full_name: PadicInt.isAbsoluteValue
code: instance isAbsoluteValue : IsAbsoluteValue fun z : ℤ_[p] => ‖z‖ 
goal: IsAbsoluteValue fun z => ‖z‖

full_name: PadicInt.instIsDomain
code: instance : IsDomain ℤ_[p] 
goal: IsDomain ℤ_[p]

full_name: PadicInt.norm_le_one
code: theorem norm_le_one (z : ℤ_[p]) : ‖z‖ ≤ 1 
goal: ‖z‖ ≤ 1

full_name: PadicInt.norm_mul
code: @[simp]
theorem norm_mul (z1 z2 : ℤ_[p]) : ‖z1 * z2‖ = ‖z1‖ * ‖z2‖ 
goal: ‖z1 * z2‖ = ‖z1‖ * ‖z2‖

full_name: PadicInt.norm_pow
code: @[simp]
theorem norm_pow (z : ℤ_[p]) : ∀ n : ℕ, ‖z ^ n‖ = ‖z‖ ^ n
  
goal: ‖z ^ n‖ = ‖z‖ ^ n

full_name: PadicInt.nonarchimedean
code: theorem nonarchimedean (q r : ℤ_[p]) : ‖q + r‖ ≤ max ‖q‖ ‖r‖ 
goal: ‖q + r‖ ≤ max ‖q‖ ‖r‖

full_name: PadicInt.norm_add_eq_max_of_ne
code: theorem norm_add_eq_max_of_ne {q r : ℤ_[p]} : ‖q‖ ≠ ‖r‖ → ‖q + r‖ = max ‖q‖ ‖r‖ 
goal: ‖q‖ ≠ ‖r‖ → ‖q + r‖ = max ‖q‖ ‖r‖

full_name: PadicInt.norm_eq_of_norm_add_lt_right
code: theorem norm_eq_of_norm_add_lt_right {z1 z2 : ℤ_[p]} (h : ‖z1 + z2‖ < ‖z2‖) : ‖z1‖ = ‖z2‖ 
goal: ‖z1‖ = ‖z2‖

full_name: PadicInt.norm_eq_of_norm_add_lt_left
code: theorem norm_eq_of_norm_add_lt_left {z1 z2 : ℤ_[p]} (h : ‖z1 + z2‖ < ‖z1‖) : ‖z1‖ = ‖z2‖ 
goal: ‖z1‖ = ‖z2‖

full_name: PadicInt.padic_norm_e_of_padicInt
code: @[simp]
theorem padic_norm_e_of_padicInt (z : ℤ_[p]) : ‖(z : ℚ_[p])‖ = ‖z‖ 
goal: ‖↑z‖ = ‖z‖

full_name: PadicInt.norm_intCast_eq_padic_norm
code: theorem norm_intCast_eq_padic_norm (z : ℤ) : ‖(z : ℤ_[p])‖ = ‖(z : ℚ_[p])‖ 
goal: ‖↑z‖ = ‖↑z‖

full_name: PadicInt.norm_eq_padic_norm
code: @[simp]
theorem norm_eq_padic_norm {q : ℚ_[p]} (hq : ‖q‖ ≤ 1) : @norm ℤ_[p] _ ⟨q, hq⟩ = ‖q‖ 
goal: ‖⟨q, hq⟩‖ = ‖q‖

full_name: PadicInt.norm_p
code: @[simp]
theorem norm_p : ‖(p : ℤ_[p])‖ = (p : ℝ)⁻¹ 
goal: ‖↑p‖ = (↑p)⁻¹

full_name: PadicInt.norm_p_pow
code: theorem norm_p_pow (n : ℕ) : ‖(p : ℤ_[p]) ^ n‖ = (p : ℝ) ^ (-n : ℤ) 
goal: ‖↑p ^ n‖ = ↑p ^ (-↑n)

full_name: _private.Mathlib.NumberTheory.Padics.PadicIntegers.0.PadicInt.cauSeq_to_rat_cauSeq
code: private def cauSeq_to_rat_cauSeq (f : CauSeq ℤ_[p] norm) : CauSeq ℚ_[p] fun a => ‖a‖ 
goal: CauSeq ℚ_[p] fun a => ‖a‖

full_name: PadicInt.complete
code: instance complete : CauSeq.IsComplete ℤ_[p] norm 
goal: CauSeq.IsComplete ℤ_[p] norm

full_name: PadicInt.exists_pow_neg_lt
code: theorem exists_pow_neg_lt {ε : ℝ} (hε : 0 < ε) : ∃ k : ℕ, (p : ℝ) ^ (-(k : ℤ)) < ε 
goal: ∃ k, ↑p ^ (-↑k) < ε

full_name: PadicInt.exists_pow_neg_lt_rat
code: theorem exists_pow_neg_lt_rat {ε : ℚ} (hε : 0 < ε) : ∃ k : ℕ, (p : ℚ) ^ (-(k : ℤ)) < ε 
goal: ∃ k, ↑p ^ (-↑k) < ε

full_name: PadicInt.norm_int_lt_one_iff_dvd
code: theorem norm_int_lt_one_iff_dvd (k : ℤ) : ‖(k : ℤ_[p])‖ < 1 ↔ (p : ℤ) ∣ k 
goal: ‖↑k‖ < 1 ↔ ↑p ∣ k

full_name: PadicInt.norm_int_le_pow_iff_dvd
code: theorem norm_int_le_pow_iff_dvd {k : ℤ} {n : ℕ} :
    ‖(k : ℤ_[p])‖ ≤ (p : ℝ) ^ (-n : ℤ) ↔ (p ^ n : ℤ) ∣ k 
goal: ‖↑k‖ ≤ ↑p ^ (-↑n) ↔ ↑p ^ n ∣ k

full_name: PadicInt.valuation
code: /-- `PadicInt.valuation` lifts the `p`-adic valuation on `ℚ` to `ℤ_[p]`.  -/
def valuation (x : ℤ_[p]) 
goal: ℤ

full_name: PadicInt.norm_eq_pow_val
code: theorem norm_eq_pow_val {x : ℤ_[p]} (hx : x ≠ 0) : ‖x‖ = (p : ℝ) ^ (-x.valuation) 
goal: ‖x‖ = ↑p ^ (-x.valuation)

full_name: PadicInt.valuation_zero
code: @[simp]
theorem valuation_zero : valuation (0 : ℤ_[p]) = 0 
goal: PadicInt.valuation 0 = 0

full_name: PadicInt.valuation_one
code: @[simp]
theorem valuation_one : valuation (1 : ℤ_[p]) = 0 
goal: PadicInt.valuation 1 = 0

full_name: PadicInt.valuation_p
code: @[simp]
theorem valuation_p : valuation (p : ℤ_[p]) = 1 
goal: (↑p).valuation = 1

full_name: PadicInt.valuation_nonneg
code: theorem valuation_nonneg (x : ℤ_[p]) : 0 ≤ x.valuation 
goal: 0 ≤ x.valuation

full_name: PadicInt.valuation_p_pow_mul
code: @[simp]
theorem valuation_p_pow_mul (n : ℕ) (c : ℤ_[p]) (hc : c ≠ 0) :
    ((p : ℤ_[p]) ^ n * c).valuation = n + c.valuation 
goal: (↑p ^ n * c).valuation = ↑n + c.valuation

full_name: PadicInt.mul_inv
code: theorem mul_inv : ∀ {z : ℤ_[p]}, ‖z‖ = 1 → z * z.inv = 1
  
goal: ‖z‖ = 1 → z * z.inv = 1

full_name: PadicInt.inv_mul
code: theorem inv_mul {z : ℤ_[p]} (hz : ‖z‖ = 1) : z.inv * z = 1 
goal: z.inv * z = 1

full_name: PadicInt.isUnit_iff
code: theorem isUnit_iff {z : ℤ_[p]} : IsUnit z ↔ ‖z‖ = 1 
goal: IsUnit z ↔ ‖z‖ = 1

full_name: PadicInt.norm_lt_one_add
code: theorem norm_lt_one_add {z1 z2 : ℤ_[p]} (hz1 : ‖z1‖ < 1) (hz2 : ‖z2‖ < 1) : ‖z1 + z2‖ < 1 
goal: ‖z1 + z2‖ < 1

full_name: PadicInt.norm_lt_one_mul
code: theorem norm_lt_one_mul {z1 z2 : ℤ_[p]} (hz2 : ‖z2‖ < 1) : ‖z1 * z2‖ < 1 
goal: ‖z1 * z2‖ < 1

full_name: PadicInt.mem_nonunits
code: theorem mem_nonunits {z : ℤ_[p]} : z ∈ nonunits ℤ_[p] ↔ ‖z‖ < 1 
goal: z ∈ nonunits ℤ_[p] ↔ ‖z‖ < 1

full_name: PadicInt.mkUnits
code: /-- A `p`-adic number `u` with `‖u‖ = 1` is a unit of `ℤ_[p]`. -/
def mkUnits {u : ℚ_[p]} (h : ‖u‖ = 1) : ℤ_[p]ˣ 
goal: ℤ_[p]ˣ

full_name: PadicInt.mkUnits_eq
code: @[simp]
theorem mkUnits_eq {u : ℚ_[p]} (h : ‖u‖ = 1) : ((mkUnits h : ℤ_[p]) : ℚ_[p]) = u 
goal: ↑↑(PadicInt.mkUnits h) = u

full_name: PadicInt.norm_units
code: @[simp]
theorem norm_units (u : ℤ_[p]ˣ) : ‖(u : ℤ_[p])‖ = 1 
goal: ‖↑u‖ = 1

full_name: PadicInt.unitCoeff
code: /-- `unitCoeff hx` is the unit `u` in the unique representation `x = u * p ^ n`.
See `unitCoeff_spec`. -/
def unitCoeff {x : ℤ_[p]} (hx : x ≠ 0) : ℤ_[p]ˣ 
goal: ℤ_[p]ˣ

full_name: PadicInt.unitCoeff_coe
code: @[simp]
theorem unitCoeff_coe {x : ℤ_[p]} (hx : x ≠ 0) :
    (unitCoeff hx : ℚ_[p]) = x * (p : ℚ_[p]) ^ (-x.valuation) 
goal: ↑↑(PadicInt.unitCoeff hx) = ↑x * ↑p ^ (-x.valuation)

full_name: PadicInt.unitCoeff_spec
code: theorem unitCoeff_spec {x : ℤ_[p]} (hx : x ≠ 0) :
    x = (unitCoeff hx : ℤ_[p]) * (p : ℤ_[p]) ^ Int.natAbs (valuation x) 
goal: x = ↑(PadicInt.unitCoeff hx) * ↑p ^ x.valuation.natAbs

full_name: PadicInt.norm_le_pow_iff_le_valuation
code: theorem norm_le_pow_iff_le_valuation (x : ℤ_[p]) (hx : x ≠ 0) (n : ℕ) :
    ‖x‖ ≤ (p : ℝ) ^ (-n : ℤ) ↔ ↑n ≤ x.valuation 
goal: ‖x‖ ≤ ↑p ^ (-↑n) ↔ ↑n ≤ x.valuation

full_name: PadicInt.mem_span_pow_iff_le_valuation
code: theorem mem_span_pow_iff_le_valuation (x : ℤ_[p]) (hx : x ≠ 0) (n : ℕ) :
    x ∈ (Ideal.span {(p : ℤ_[p]) ^ n} : Ideal ℤ_[p]) ↔ ↑n ≤ x.valuation 
goal: x ∈ Ideal.span {↑p ^ n} ↔ ↑n ≤ x.valuation

full_name: PadicInt.norm_le_pow_iff_mem_span_pow
code: theorem norm_le_pow_iff_mem_span_pow (x : ℤ_[p]) (n : ℕ) :
    ‖x‖ ≤ (p : ℝ) ^ (-n : ℤ) ↔ x ∈ (Ideal.span {(p : ℤ_[p]) ^ n} : Ideal ℤ_[p]) 
goal: ‖x‖ ≤ ↑p ^ (-↑n) ↔ x ∈ Ideal.span {↑p ^ n}

full_name: PadicInt.norm_le_pow_iff_norm_lt_pow_add_one
code: theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℤ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) 
goal: ‖x‖ ≤ ↑p ^ n ↔ ‖x‖ < ↑p ^ (n + 1)

full_name: PadicInt.norm_lt_pow_iff_norm_le_pow_sub_one
code: theorem norm_lt_pow_iff_norm_le_pow_sub_one (x : ℤ_[p]) (n : ℤ) :
    ‖x‖ < (p : ℝ) ^ n ↔ ‖x‖ ≤ (p : ℝ) ^ (n - 1) 
goal: ‖x‖ < ↑p ^ n ↔ ‖x‖ ≤ ↑p ^ (n - 1)

full_name: PadicInt.norm_lt_one_iff_dvd
code: theorem norm_lt_one_iff_dvd (x : ℤ_[p]) : ‖x‖ < 1 ↔ ↑p ∣ x 
goal: ‖x‖ < 1 ↔ ↑p ∣ x

full_name: PadicInt.pow_p_dvd_int_iff
code: @[simp]
theorem pow_p_dvd_int_iff (n : ℕ) (a : ℤ) : (p : ℤ_[p]) ^ n ∣ a ↔ (p ^ n : ℤ) ∣ a 
goal: ↑p ^ n ∣ ↑a ↔ ↑p ^ n ∣ a

full_name: PadicInt.instLocalRing
code: instance : LocalRing ℤ_[p] 
goal: LocalRing ℤ_[p]

full_name: PadicInt.p_nonnunit
code: theorem p_nonnunit : (p : ℤ_[p]) ∈ nonunits ℤ_[p] 
goal: ↑p ∈ nonunits ℤ_[p]

full_name: PadicInt.maximalIdeal_eq_span_p
code: theorem maximalIdeal_eq_span_p : maximalIdeal ℤ_[p] = Ideal.span {(p : ℤ_[p])} 
goal: LocalRing.maximalIdeal ℤ_[p] = Ideal.span {↑p}

full_name: PadicInt.prime_p
code: theorem prime_p : Prime (p : ℤ_[p]) 
goal: Prime ↑p

full_name: PadicInt.irreducible_p
code: theorem irreducible_p : Irreducible (p : ℤ_[p]) 
goal: Irreducible ↑p

full_name: PadicInt.instDiscreteValuationRing
code: instance : DiscreteValuationRing ℤ_[p] 
goal: DiscreteValuationRing ℤ_[p]

full_name: PadicInt.ideal_eq_span_pow_p
code: theorem ideal_eq_span_pow_p {s : Ideal ℤ_[p]} (hs : s ≠ ⊥) :
    ∃ n : ℕ, s = Ideal.span {(p : ℤ_[p]) ^ n} 
goal: ∃ n, s = Ideal.span {↑p ^ n}

full_name: PadicInt.instIsAdicCompleteMaximalIdeal
code: instance : IsAdicComplete (maximalIdeal ℤ_[p]) ℤ_[p] 
goal: IsAdicComplete (LocalRing.maximalIdeal ℤ_[p]) ℤ_[p]

full_name: PadicInt.algebra
code: instance algebra : Algebra ℤ_[p] ℚ_[p] 
goal: Algebra ℤ_[p] ℚ_[p]

full_name: PadicInt.algebraMap_apply
code: @[simp]
theorem algebraMap_apply (x : ℤ_[p]) : algebraMap ℤ_[p] ℚ_[p] x = x 
goal: (algebraMap ℤ_[p] ℚ_[p]) x = ↑x

full_name: PadicInt.isFractionRing
code: instance isFractionRing : IsFractionRing ℤ_[p] ℚ_[p] 
goal: IsFractionRing ℤ_[p] ℚ_[p]