File: Mathlib/RingTheory/WittVector/Basic.lean

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

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

full_name: _aux_Mathlib_RingTheory_WittVector_Basic___unexpand_wittPolynomial_1
code: local notation "W_" => wittPolynomial p
goal: Lean.PrettyPrinter.Unexpander

full_name: _aux_Mathlib_RingTheory_WittVector_Basic___macroRules_termW__1
code: local notation "W_" => wittPolynomial p
goal: Lean.Macro

full_name: WittVector.mapFun
code: /-- `f : α → β` induces a map from `𝕎 α` to `𝕎 β` by applying `f` componentwise.
If `f` is a ring homomorphism, then so is `f`, see `WittVector.map f`. -/
def mapFun (f : α → β) : 𝕎 α → 𝕎 β 
goal: 𝕎 α → 𝕎 β

full_name: WittVector.mapFun.injective
code: theorem injective (f : α → β) (hf : Injective f) : Injective (mapFun f : 𝕎 α → 𝕎 β) 
goal: Function.Injective (WittVector.mapFun f)

full_name: WittVector.mapFun.surjective
code: theorem surjective (f : α → β) (hf : Surjective f) : Surjective (mapFun f : 𝕎 α → 𝕎 β) 
goal: Function.Surjective (WittVector.mapFun f)

full_name: WittVector.mapFun._aux_Mathlib_RingTheory_WittVector_Basic___macroRules_WittVector_mapFun_tacticMap_fun_tac_1
code: macro "map_fun_tac" : tactic => `(tactic| (
  ext n
  simp only [mapFun, mk, comp_apply, zero_coeff, map_zero,
    -- Porting note: the lemmas on the next line do not have the `simp` tag in mathlib4
    add_coeff, sub_coeff, mul_coeff, neg_coeff, nsmul_coeff, zsmul_coeff, pow_coeff,
    peval, map_aeval, algebraMap_int_eq, coe_eval₂Hom] <;>
  try { cases n <;> simp <;> done } <;>  -- Porting note: this line solves `one`
  apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl <;>
  ext ⟨i, k⟩ <;>
    fin_cases i <;> rfl))
goal: Lean.Macro

full_name: WittVector.mapFun.tacticMap_fun_tac
code: macro "map_fun_tac" : tactic => `(tactic| (
  ext n
  simp only [mapFun, mk, comp_apply, zero_coeff, map_zero,
    -- Porting note: the lemmas on the next line do not have the `simp` tag in mathlib4
    add_coeff, sub_coeff, mul_coeff, neg_coeff, nsmul_coeff, zsmul_coeff, pow_coeff,
    peval, map_aeval, algebraMap_int_eq, coe_eval₂Hom] <;>
  try { cases n <;> simp <;> done } <;>  -- Porting note: this line solves `one`
  apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl <;>
  ext ⟨i, k⟩ <;>
    fin_cases i <;> rfl))
goal: Lean.ParserDescr

full_name: WittVector.mapFun.zero
code: theorem zero : mapFun f (0 : 𝕎 R) = 0 
goal: WittVector.mapFun (⇑f) 0 = 0

full_name: WittVector.mapFun.one
code: theorem one : mapFun f (1 : 𝕎 R) = 1 
goal: WittVector.mapFun (⇑f) 1 = 1

full_name: WittVector.mapFun.add
code: theorem add : mapFun f (x + y) = mapFun f x + mapFun f y 
goal: WittVector.mapFun (⇑f) (x + y) = WittVector.mapFun (⇑f) x + WittVector.mapFun (⇑f) y

full_name: WittVector.mapFun.sub
code: theorem sub : mapFun f (x - y) = mapFun f x - mapFun f y 
goal: WittVector.mapFun (⇑f) (x - y) = WittVector.mapFun (⇑f) x - WittVector.mapFun (⇑f) y

full_name: WittVector.mapFun.mul
code: theorem mul : mapFun f (x * y) = mapFun f x * mapFun f y 
goal: WittVector.mapFun (⇑f) (x * y) = WittVector.mapFun (⇑f) x * WittVector.mapFun (⇑f) y

full_name: WittVector.mapFun.neg
code: theorem neg : mapFun f (-x) = -mapFun f x 
goal: WittVector.mapFun (⇑f) (-x) = -WittVector.mapFun (⇑f) x

full_name: WittVector.mapFun.nsmul
code: theorem nsmul (n : ℕ) (x : WittVector p R) : mapFun f (n • x) = n • mapFun f x 
goal: WittVector.mapFun (⇑f) (n • x) = n • WittVector.mapFun (⇑f) x

full_name: WittVector.mapFun.zsmul
code: theorem zsmul (z : ℤ) (x : WittVector p R) : mapFun f (z • x) = z • mapFun f x 
goal: WittVector.mapFun (⇑f) (z • x) = z • WittVector.mapFun (⇑f) x

full_name: WittVector.mapFun.pow
code: theorem pow (n : ℕ) : mapFun f (x ^ n) = mapFun f x ^ n 
goal: WittVector.mapFun (⇑f) (x ^ n) = WittVector.mapFun (⇑f) x ^ n

full_name: WittVector.mapFun.natCast
code: theorem natCast (n : ℕ) : mapFun f (n : 𝕎 R) = n 
goal: WittVector.mapFun ⇑f ↑n = ↑n

full_name: WittVector.mapFun.intCast
code: theorem intCast (n : ℤ) : mapFun f (n : 𝕎 R) = n 
goal: WittVector.mapFun ⇑f ↑n = ↑n

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun
code: /-- Evaluates the `n`th Witt polynomial on the first `n` coefficients of `x`,
producing a value in `R`.
This function will be bundled as the ring homomorphism `WittVector.ghostMap`
once the ring structure is available,
but we rely on it to set up the ring structure in the first place. -/
private def ghostFun : 𝕎 R → ℕ → R 
goal: 𝕎 R → ℕ → R

full_name: WittVector.«_aux_Mathlib_RingTheory_WittVector_Basic___elabRules_WittVector_tacticGhost_fun_tac_,__1»
code: /-- An auxiliary tactic for proving that `ghostFun` respects the ring operations. -/
elab "ghost_fun_tac" φ:term "," fn:term : tactic => do
  evalTactic (← `(tactic| (
  ext n
  have := congr_fun (congr_arg (@peval R _ _) (wittStructureInt_prop p $φ n)) $fn
  simp only [wittZero, OfNat.ofNat, Zero.zero, wittOne, One.one,
    HAdd.hAdd, Add.add, HSub.hSub, Sub.sub, Neg.neg, HMul.hMul, Mul.mul,HPow.hPow, Pow.pow,
    wittNSMul, wittZSMul, HSMul.hSMul, SMul.smul]
  simpa (config := { unfoldPartialApp := true }) [WittVector.ghostFun, aeval_rename, aeval_bind₁,
    comp, uncurry, peval, eval] using this
  )))
goal: Lean.Elab.Tactic.Tactic

full_name: WittVector.«tacticGhost_fun_tac_,_»
code: /-- An auxiliary tactic for proving that `ghostFun` respects the ring operations. -/
elab "ghost_fun_tac" φ:term "," fn:term : tactic => do
  evalTactic (← `(tactic| (
  ext n
  have := congr_fun (congr_arg (@peval R _ _) (wittStructureInt_prop p $φ n)) $fn
  simp only [wittZero, OfNat.ofNat, Zero.zero, wittOne, One.one,
    HAdd.hAdd, Add.add, HSub.hSub, Sub.sub, Neg.neg, HMul.hMul, Mul.mul,HPow.hPow, Pow.pow,
    wittNSMul, wittZSMul, HSMul.hSMul, SMul.smul]
  simpa (config := { unfoldPartialApp := true }) [WittVector.ghostFun, aeval_rename, aeval_bind₁,
    comp, uncurry, peval, eval] using this
  )))
goal: Lean.ParserDescr

full_name: WittVector.matrix_vecEmpty_coeff
code: @[local simp]
theorem matrix_vecEmpty_coeff {R} (i j) :
    @coeff p R (Matrix.vecEmpty i) j = (Matrix.vecEmpty i : ℕ → R) j 
goal: (![] i).coeff j = ![] i j

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_zero
code: private theorem ghostFun_zero : ghostFun (0 : 𝕎 R) = 0 
goal: WittVector.ghostFun 0 = 0

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_one
code: private theorem ghostFun_one : ghostFun (1 : 𝕎 R) = 1 
goal: WittVector.ghostFun 1 = 1

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_add
code: private theorem ghostFun_add : ghostFun (x + y) = ghostFun x + ghostFun y 
goal: WittVector.ghostFun (x + y) = WittVector.ghostFun x + WittVector.ghostFun y

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_natCast
code: private theorem ghostFun_natCast (i : ℕ) : ghostFun (i : 𝕎 R) = i 
goal: WittVector.ghostFun ↑i = ↑i

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_sub
code: private theorem ghostFun_sub : ghostFun (x - y) = ghostFun x - ghostFun y 
goal: WittVector.ghostFun (x - y) = WittVector.ghostFun x - WittVector.ghostFun y

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_mul
code: private theorem ghostFun_mul : ghostFun (x * y) = ghostFun x * ghostFun y 
goal: WittVector.ghostFun (x * y) = WittVector.ghostFun x * WittVector.ghostFun y

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_neg
code: private theorem ghostFun_neg : ghostFun (-x) = -ghostFun x 
goal: WittVector.ghostFun (-x) = -WittVector.ghostFun x

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_intCast
code: private theorem ghostFun_intCast (i : ℤ) : ghostFun (i : 𝕎 R) = i 
goal: WittVector.ghostFun ↑i = ↑i

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_nsmul
code: private lemma ghostFun_nsmul (m : ℕ) (x : WittVector p R) : ghostFun (m • x) = m • ghostFun x 
goal: WittVector.ghostFun (m • x) = m • WittVector.ghostFun x

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_zsmul
code: private lemma ghostFun_zsmul (m : ℤ) (x : WittVector p R) : ghostFun (m • x) = m • ghostFun x 
goal: WittVector.ghostFun (m • x) = m • WittVector.ghostFun x

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostFun_pow
code: private theorem ghostFun_pow (m : ℕ) : ghostFun (x ^ m) = ghostFun x ^ m 
goal: WittVector.ghostFun (x ^ m) = WittVector.ghostFun x ^ m

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.ghostEquiv'
code: /-- The bijection between `𝕎 R` and `ℕ → R`, under the assumption that `p` is invertible in `R`.
In `WittVector.ghostEquiv` we upgrade this to an isomorphism of rings. -/
private def ghostEquiv' [Invertible (p : R)] : 𝕎 R ≃ (ℕ → R) 
goal: 𝕎 R ≃ (ℕ → R)

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.comm_ring_aux₁
code: @[local instance]
private def comm_ring_aux₁ : CommRing (𝕎 (MvPolynomial R ℚ)) 
goal: CommRing (𝕎 (MvPolynomial R ℚ))

full_name: _private.Mathlib.RingTheory.WittVector.Basic.0.WittVector.comm_ring_aux₂
code: @[local instance]
private abbrev comm_ring_aux₂ : CommRing (𝕎 (MvPolynomial R ℤ)) 
goal: CommRing (𝕎 (MvPolynomial R ℤ))

full_name: WittVector.instCommRing
code: /-- The commutative ring structure on `𝕎 R`. -/
instance : CommRing (𝕎 R) 
goal: CommRing (𝕎 R)

full_name: WittVector.map
code: /-- `WittVector.map f` is the ring homomorphism `𝕎 R →+* 𝕎 S` naturally induced
by a ring homomorphism `f : R →+* S`. It acts coefficientwise. -/
noncomputable def map (f : R →+* S) : 𝕎 R →+* 𝕎 S 
goal: 𝕎 R →+* 𝕎 S

full_name: WittVector.map_injective
code: theorem map_injective (f : R →+* S) (hf : Injective f) : Injective (map f : 𝕎 R → 𝕎 S) 
goal: Function.Injective ⇑(WittVector.map f)

full_name: WittVector.map_surjective
code: theorem map_surjective (f : R →+* S) (hf : Surjective f) : Surjective (map f : 𝕎 R → 𝕎 S) 
goal: Function.Surjective ⇑(WittVector.map f)

full_name: WittVector.map_coeff
code: @[simp]
theorem map_coeff (f : R →+* S) (x : 𝕎 R) (n : ℕ) : (map f x).coeff n = f (x.coeff n) 
goal: ((WittVector.map f) x).coeff n = f (x.coeff n)

full_name: WittVector.ghostMap
code: /-- `WittVector.ghostMap` is a ring homomorphism that maps each Witt vector
to the sequence of its ghost components. -/
def ghostMap : 𝕎 R →+* ℕ → R 
goal: 𝕎 R →+* ℕ → R

full_name: WittVector.ghostComponent
code: /-- Evaluates the `n`th Witt polynomial on the first `n` coefficients of `x`,
producing a value in `R`. -/
def ghostComponent (n : ℕ) : 𝕎 R →+* R 
goal: 𝕎 R →+* R

full_name: WittVector.ghostComponent_apply
code: theorem ghostComponent_apply (n : ℕ) (x : 𝕎 R) : ghostComponent n x = aeval x.coeff (W_ ℤ n) 
goal: (WittVector.ghostComponent n) x = (MvPolynomial.aeval x.coeff) (W_ ℤ n)

full_name: WittVector.ghostMap_apply
code: @[simp]
theorem ghostMap_apply (x : 𝕎 R) (n : ℕ) : ghostMap x n = ghostComponent n x 
goal: WittVector.ghostMap x n = (WittVector.ghostComponent n) x

full_name: WittVector.ghostEquiv
code: /-- `WittVector.ghostMap` is a ring isomorphism when `p` is invertible in `R`. -/
def ghostEquiv : 𝕎 R ≃+* (ℕ → R) 
goal: 𝕎 R ≃+* (ℕ → R)

full_name: WittVector.ghostEquiv_coe
code: @[simp]
theorem ghostEquiv_coe : (ghostEquiv p R : 𝕎 R →+* ℕ → R) = ghostMap 
goal: ↑(WittVector.ghostEquiv p R) = WittVector.ghostMap

full_name: WittVector.ghostMap.bijective_of_invertible
code: theorem ghostMap.bijective_of_invertible : Function.Bijective (ghostMap : 𝕎 R → ℕ → R) 
goal: Function.Bijective ⇑WittVector.ghostMap

full_name: WittVector.constantCoeff_apply
code: /-- `WittVector.coeff x 0` as a `RingHom` -/
@[simps]
noncomputable def constantCoeff : 𝕎 R →+* R 
goal: WittVector.constantCoeff x = x.coeff 0

full_name: WittVector.constantCoeff
code: /-- `WittVector.coeff x 0` as a `RingHom` -/
@[simps]
noncomputable def constantCoeff : 𝕎 R →+* R 
goal: 𝕎 R →+* R

full_name: WittVector.instNontrivial
code: instance [Nontrivial R] : Nontrivial (𝕎 R) 
goal: Nontrivial (𝕎 R)