Theorem: PadicInt.zmod_cast_comp_toZModPow
File: Mathlib/NumberTheory/Padics/RingHoms.lean

tactic: apply ZMod.ringHom_eq_of_ker_eq
state_before: p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x : ℤ_[p]
m n : ℕ
h : m ≤ n
⊢ (ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n) = toZModPow m
state_after: case h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x : ℤ_[p]
m n : ℕ
h : m ≤ n
⊢ RingHom.ker ((ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n)) = RingHom.ker (toZModPow m)

tactic: ext x
state_before: case h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x : ℤ_[p]
m n : ℕ
h : m ≤ n
⊢ RingHom.ker ((ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n)) = RingHom.ker (toZModPow m)
state_after: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ x ∈ RingHom.ker ((ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n)) ↔ x ∈ RingHom.ker (toZModPow m)

tactic: rw [RingHom.mem_ker, RingHom.mem_ker]
state_before: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ x ∈ RingHom.ker ((ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n)) ↔ x ∈ RingHom.ker (toZModPow m)
state_after: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ((ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n)) x = 0 ↔ (toZModPow m) x = 0

tactic: simp only [Function.comp_apply, ZMod.castHom_apply, RingHom.coe_comp]
state_before: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ((ZMod.castHom ⋯ (ZMod (p ^ m))).comp (toZModPow n)) x = 0 ↔ (toZModPow m) x = 0
state_after: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ((toZModPow n) x).cast = 0 ↔ (toZModPow m) x = 0

tactic: simp only [toZModPow, toZModHom, RingHom.coe_mk]
state_before: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ((toZModPow n) x).cast = 0 ↔ (toZModPow m) x = 0
state_after: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ({ toFun := fun x => ↑(x.appr n), map_one' := ⋯, map_mul' := ⋯ } x).cast = 0 ↔
    { toFun := fun x => ↑(x.appr m), map_one' := ⋯, map_mul' := ⋯ } x = 0

tactic: dsimp
state_before: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ({ toFun := fun x => ↑(x.appr n), map_one' := ⋯, map_mul' := ⋯ } x).cast = 0 ↔
    { toFun := fun x => ↑(x.appr m), map_one' := ⋯, map_mul' := ⋯ } x = 0
state_after: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ (↑(x.appr n)).cast = 0 ↔ ↑(x.appr m) = 0

tactic: rw [ZMod.cast_natCast (pow_dvd_pow p h),
  zmod_congr_of_sub_mem_span m (x.appr n) (x.appr n) (x.appr m)]
state_before: case h.h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ (↑(x.appr n)).cast = 0 ↔ ↑(x.appr m) = 0
state_after: case h.h.ha
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ↑(x.appr n) - ↑(x.appr n) ∈ Ideal.span {↑p ^ m}

case h.h.hb
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ↑(x.appr n) - ↑(x.appr m) ∈ Ideal.span {↑p ^ m}

tactic: rw [sub_self]
state_before: case h.h.ha
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ↑(x.appr n) - ↑(x.appr n) ∈ Ideal.span {↑p ^ m}
state_after: case h.h.ha
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ 0 ∈ Ideal.span {↑p ^ m}

tactic: apply Ideal.zero_mem _
state_before: case h.h.ha
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ 0 ∈ Ideal.span {↑p ^ m}
state_after: no goals

tactic: rw [Ideal.mem_span_singleton]
state_before: case h.h.hb
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ↑(x.appr n) - ↑(x.appr m) ∈ Ideal.span {↑p ^ m}
state_after: case h.h.hb
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ↑p ^ m ∣ ↑(x.appr n) - ↑(x.appr m)

tactic: rcases dvd_appr_sub_appr x m n h with ⟨c, hc⟩
state_before: case h.h.hb
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
⊢ ↑p ^ m ∣ ↑(x.appr n) - ↑(x.appr m)
state_after: case h.h.hb.intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
c : ℕ
hc : x.appr n - x.appr m = p ^ m * c
⊢ ↑p ^ m ∣ ↑(x.appr n) - ↑(x.appr m)

tactic: use c
state_before: case h.h.hb.intro
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
c : ℕ
hc : x.appr n - x.appr m = p ^ m * c
⊢ ↑p ^ m ∣ ↑(x.appr n) - ↑(x.appr m)
state_after: case h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
c : ℕ
hc : x.appr n - x.appr m = p ^ m * c
⊢ ↑(x.appr n) - ↑(x.appr m) = ↑p ^ m * ↑c

tactic: rw [← Nat.cast_sub (appr_mono _ h), hc, Nat.cast_mul, Nat.cast_pow]
state_before: case h
p : ℕ
hp_prime : Fact (Nat.Prime p)
r : ℚ
x✝ : ℤ_[p]
m n : ℕ
h : m ≤ n
x : ℤ_[p]
c : ℕ
hc : x.appr n - x.appr m = p ^ m * c
⊢ ↑(x.appr n) - ↑(x.appr m) = ↑p ^ m * ↑c
state_after: no goals