File: Mathlib/RingTheory/WittVector/Compare.lean

full_name: _aux_Mathlib_RingTheory_WittVector_Compare___unexpand_WittVector_1
code: local notation "𝕎" => WittVector p
goal: Lean.PrettyPrinter.Unexpander

full_name: _aux_Mathlib_RingTheory_WittVector_Compare___macroRules_term𝕎_1
code: local notation "𝕎" => WittVector p
goal: Lean.Macro

full_name: TruncatedWittVector.eq_of_le_of_cast_pow_eq_zero
code: theorem eq_of_le_of_cast_pow_eq_zero [CharP R p] (i : ℕ) (hin : i ≤ n)
    (hpi : (p : TruncatedWittVector p n R) ^ i = 0) : i = n 
goal: i = n

full_name: TruncatedWittVector.card_zmod
code: theorem card_zmod : Fintype.card (TruncatedWittVector p n (ZMod p)) = p ^ n 
goal: Fintype.card (TruncatedWittVector p n (ZMod p)) = p ^ n

full_name: TruncatedWittVector.charP_zmod
code: theorem charP_zmod : CharP (TruncatedWittVector p n (ZMod p)) (p ^ n) 
goal: CharP (TruncatedWittVector p n (ZMod p)) (p ^ n)

full_name: TruncatedWittVector.zmodEquivTrunc
code: /-- The unique isomorphism between `ZMod p^n` and `TruncatedWittVector p n (ZMod p)`.

This isomorphism exists, because `TruncatedWittVector p n (ZMod p)` is a finite ring
with characteristic and cardinality `p^n`.
-/
def zmodEquivTrunc : ZMod (p ^ n) ≃+* TruncatedWittVector p n (ZMod p) 
goal: ZMod (p ^ n) ≃+* TruncatedWittVector p n (ZMod p)

full_name: TruncatedWittVector.zmodEquivTrunc_apply
code: theorem zmodEquivTrunc_apply {x : ZMod (p ^ n)} :
    zmodEquivTrunc p n x = ZMod.castHom (by rfl) (TruncatedWittVector p n (ZMod p)) x 
goal: (TruncatedWittVector.zmodEquivTrunc p n) x = (ZMod.castHom ⋯ (TruncatedWittVector p n (ZMod p))) x

full_name: TruncatedWittVector.commutes
code: /-- The following diagram commutes:
```text
          zmod (p^n) ----------------------------> zmod (p^m)
            |                                        |
            |                                        |
            v                                        v
TruncatedWittVector p n (zmod p) ----> TruncatedWittVector p m (zmod p)
```
Here the vertical arrows are `TruncatedWittVector.zmodEquivTrunc`,
the horizontal arrow at the top is `ZMod.castHom`,
and the horizontal arrow at the bottom is `TruncatedWittVector.truncate`.
-/
theorem commutes {m : ℕ} (hm : n ≤ m) :
    (truncate hm).comp (zmodEquivTrunc p m).toRingHom =
      (zmodEquivTrunc p n).toRingHom.comp (ZMod.castHom (pow_dvd_pow p hm) _) 
goal: (TruncatedWittVector.truncate hm).comp (TruncatedWittVector.zmodEquivTrunc p m).toRingHom =
  (TruncatedWittVector.zmodEquivTrunc p n).toRingHom.comp (ZMod.castHom ⋯ (ZMod (p ^ n)))

full_name: TruncatedWittVector.commutes'
code: theorem commutes' {m : ℕ} (hm : n ≤ m) (x : ZMod (p ^ m)) :
    truncate hm (zmodEquivTrunc p m x) = zmodEquivTrunc p n (ZMod.castHom (pow_dvd_pow p hm) _ x) 
goal: (TruncatedWittVector.truncate hm) ((TruncatedWittVector.zmodEquivTrunc p m) x) =
  (TruncatedWittVector.zmodEquivTrunc p n) ((ZMod.castHom ⋯ (ZMod (p ^ n))) x)

full_name: TruncatedWittVector.commutes_symm'
code: theorem commutes_symm' {m : ℕ} (hm : n ≤ m) (x : TruncatedWittVector p m (ZMod p)) :
    (zmodEquivTrunc p n).symm (truncate hm x) =
      ZMod.castHom (pow_dvd_pow p hm) _ ((zmodEquivTrunc p m).symm x) 
goal: (TruncatedWittVector.zmodEquivTrunc p n).symm ((TruncatedWittVector.truncate hm) x) =
  (ZMod.castHom ⋯ (ZMod (p ^ n))) ((TruncatedWittVector.zmodEquivTrunc p m).symm x)

full_name: TruncatedWittVector.commutes_symm
code: /-- The following diagram commutes:
```text
TruncatedWittVector p n (zmod p) ----> TruncatedWittVector p m (zmod p)
            |                                        |
            |                                        |
            v                                        v
          zmod (p^n) ----------------------------> zmod (p^m)
```
Here the vertical arrows are `(TruncatedWittVector.zmodEquivTrunc p _).symm`,
the horizontal arrow at the top is `ZMod.castHom`,
and the horizontal arrow at the bottom is `TruncatedWittVector.truncate`.
-/
theorem commutes_symm {m : ℕ} (hm : n ≤ m) :
    (zmodEquivTrunc p n).symm.toRingHom.comp (truncate hm) =
      (ZMod.castHom (pow_dvd_pow p hm) _).comp (zmodEquivTrunc p m).symm.toRingHom 
goal: (TruncatedWittVector.zmodEquivTrunc p n).symm.toRingHom.comp (TruncatedWittVector.truncate hm) =
  (ZMod.castHom ⋯ (ZMod (p ^ n))).comp (TruncatedWittVector.zmodEquivTrunc p m).symm.toRingHom

full_name: WittVector.toZModPow
code: /-- `toZModPow` is a family of compatible ring homs. We get this family by composing
`TruncatedWittVector.zmodEquivTrunc` (in right-to-left direction) with `WittVector.truncate`. -/
def toZModPow (k : ℕ) : 𝕎 (ZMod p) →+* ZMod (p ^ k) 
goal: 𝕎 (ZMod p) →+* ZMod (p ^ k)

full_name: WittVector.toZModPow_compat
code: theorem toZModPow_compat (m n : ℕ) (h : m ≤ n) :
    (ZMod.castHom (pow_dvd_pow p h) (ZMod (p ^ m))).comp (toZModPow p n) = toZModPow p m 
goal: (ZMod.castHom ⋯ (ZMod (p ^ m))).comp (WittVector.toZModPow p n) = WittVector.toZModPow p m

full_name: WittVector.toPadicInt
code: /-- `toPadicInt` lifts `toZModPow : 𝕎 (ZMod p) →+* ZMod (p ^ k)` to a ring hom to `ℤ_[p]`
using `PadicInt.lift`, the universal property of `ℤ_[p]`.
-/
def toPadicInt : 𝕎 (ZMod p) →+* ℤ_[p] 
goal: 𝕎 (ZMod p) →+* ℤ_[p]

full_name: WittVector.zmodEquivTrunc_compat
code: theorem zmodEquivTrunc_compat (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂) :
    (TruncatedWittVector.truncate hk).comp
        ((zmodEquivTrunc p k₂).toRingHom.comp (PadicInt.toZModPow k₂)) =
      (zmodEquivTrunc p k₁).toRingHom.comp (PadicInt.toZModPow k₁) 
goal: (TruncatedWittVector.truncate hk).comp
    ((TruncatedWittVector.zmodEquivTrunc p k₂).toRingHom.comp (PadicInt.toZModPow k₂)) =
  (TruncatedWittVector.zmodEquivTrunc p k₁).toRingHom.comp (PadicInt.toZModPow k₁)

full_name: WittVector.fromPadicInt
code: /-- `fromPadicInt` uses `WittVector.lift` to lift `TruncatedWittVector.zmodEquivTrunc`
composed with `PadicInt.toZModPow` to a ring hom `ℤ_[p] →+* 𝕎 (ZMod p)`.
-/
def fromPadicInt : ℤ_[p] →+* 𝕎 (ZMod p) 
goal: ℤ_[p] →+* 𝕎 (ZMod p)

full_name: WittVector.toPadicInt_comp_fromPadicInt
code: theorem toPadicInt_comp_fromPadicInt : (toPadicInt p).comp (fromPadicInt p) = RingHom.id ℤ_[p] 
goal: (WittVector.toPadicInt p).comp (WittVector.fromPadicInt p) = RingHom.id ℤ_[p]

full_name: WittVector.toPadicInt_comp_fromPadicInt_ext
code: theorem toPadicInt_comp_fromPadicInt_ext (x) :
    (toPadicInt p).comp (fromPadicInt p) x = RingHom.id ℤ_[p] x 
goal: ((WittVector.toPadicInt p).comp (WittVector.fromPadicInt p)) x = (RingHom.id ℤ_[p]) x

full_name: WittVector.fromPadicInt_comp_toPadicInt
code: theorem fromPadicInt_comp_toPadicInt :
    (fromPadicInt p).comp (toPadicInt p) = RingHom.id (𝕎 (ZMod p)) 
goal: (WittVector.fromPadicInt p).comp (WittVector.toPadicInt p) = RingHom.id (𝕎 (ZMod p))

full_name: WittVector.fromPadicInt_comp_toPadicInt_ext
code: theorem fromPadicInt_comp_toPadicInt_ext (x) :
    (fromPadicInt p).comp (toPadicInt p) x = RingHom.id (𝕎 (ZMod p)) x 
goal: ((WittVector.fromPadicInt p).comp (WittVector.toPadicInt p)) x = (RingHom.id (𝕎 (ZMod p))) x

full_name: WittVector.equiv
code: /-- The ring of Witt vectors over `ZMod p` is isomorphic to the ring of `p`-adic integers. This
equivalence is witnessed by `WittVector.toPadicInt` with inverse `WittVector.fromPadicInt`.
-/
def equiv : 𝕎 (ZMod p) ≃+* ℤ_[p] 
goal: 𝕎 (ZMod p) ≃+* ℤ_[p]