case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n : ℕ
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
obtain ⟨k, hk⟩ :=
  limNthHom_spec f_compat r _
    (show (0 : ℝ) < (p : ℝ) ^ (-n : ℤ) from Nat.zpow_pos_of_pos hp_prime.1.pos _)
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k))‖ ≤ ↑p ^ (-↑n)
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
have := le_of_lt (hk (max n k) (le_max_right _ _))
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k))‖ ≤ ↑p ^ (-↑n)
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
rw [norm_le_pow_iff_mem_span_pow] at this
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ limNthHom f_compat r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(lift f_compat) r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
dsimp [lift]
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) + (limNthHom f_compat r - ↑(nthHom f r (max n k))) ∈
    Ideal.span {↑p ^ n}
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ limNthHom f_compat r - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
rw [sub_eq_sub_add_sub (limNthHom f_compat r) _ ↑(nthHom f r (max n k))]
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
case intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) + (limNthHom f_compat r - ↑(nthHom f r (max n k))) ∈
    Ideal.span {↑p ^ n}
apply Ideal.add_mem _ _ this
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑p ^ n ∣ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r))
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) ∈ Ideal.span {↑p ^ n}
rw [Ideal.mem_span_singleton]
case h.e'_3
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑p ^ n = ↑(Int.castRingHom ℤ_[p]) (↑p ^ n)

case h.e'_4
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) =
    ↑(Int.castRingHom ℤ_[p]) (nthHom (fun k2 => f k2) r (max n k) - nthHom (fun k2 => f k2) r n)
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑p ^ n ∣ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r))
convert
  (Int.castRingHom ℤ_[p]).map_dvd (pow_dvd_nthHom_sub f_compat r n (max n k) (le_max_left _ _))
case h.e'_3
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑p ^ n = ↑(Int.castRingHom ℤ_[p]) ↑p ^ n
case h.e'_3
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑p ^ n = ↑(Int.castRingHom ℤ_[p]) (↑p ^ n)
rw [map_pow]
no goals
case h.e'_3
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑p ^ n = ↑(Int.castRingHom ℤ_[p]) ↑p ^ n
rfl
case h.e'_4
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) =
    ↑(Int.castRingHom ℤ_[p]) (nthHom (fun k2 => f k2) r (max n k)) -
      ↑(Int.castRingHom ℤ_[p]) (nthHom (fun k2 => f k2) r n)
case h.e'_4
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) =
    ↑(Int.castRingHom ℤ_[p]) (nthHom (fun k2 => f k2) r (max n k) - nthHom (fun k2 => f k2) r n)
rw [map_sub]
no goals
case h.e'_4
p : ℕ
hp_prime : Fact (Nat.Prime p)
R : Type u_1
inst✝ : NonAssocSemiring R
f : (k : ℕ) → R →+* ZMod (p ^ k)
f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), RingHom.comp (ZMod.castHom (_ : p ^ k1 ∣ p ^ k2) (ZMod (p ^ k1))) (f k2) = f k1
r : R
n k : ℕ
hk : ∀ (n_1 : ℕ), n_1 ≥ k → ‖limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r n_1)‖ < ↑p ^ (-↑n)
this : limNthHom f_compat r - ↑(nthHom (fun k2 => f k2) r (max n k)) ∈ Ideal.span {↑p ^ n}
⊢ ↑(nthHom f r (max n k)) - ↑(ZMod.val (↑(f n) r)) =
    ↑(Int.castRingHom ℤ_[p]) (nthHom (fun k2 => f k2) r (max n k)) -
      ↑(Int.castRingHom ℤ_[p]) (nthHom (fun k2 => f k2) r n)
rfl