File: Mathlib/RingTheory/GradedAlgebra/Basic.lean

full_name: GradedRing
code: /-- An internally-graded `R`-algebra `A` is one that can be decomposed into a collection
of `Submodule R A`s indexed by `ι` such that the canonical map `A → ⨁ i, 𝒜 i` is bijective and
respects multiplication, i.e. the product of an element of degree `i` and an element of degree `j`
is an element of degree `i + j`.

Note that the fact that `A` is internally-graded, `GradedAlgebra 𝒜`, implies an externally-graded
algebra structure `DirectSum.GAlgebra R (fun i ↦ ↥(𝒜 i))`, which in turn makes available an
`Algebra R (⨁ i, 𝒜 i)` instance.
-/
class GradedRing (𝒜 : ι → σ) extends SetLike.GradedMonoid 𝒜, DirectSum.Decomposition 𝒜
goal: Type (max u_1 u_3)

full_name: DirectSum.decomposeRingEquiv
code: /-- If `A` is graded by `ι` with degree `i` component `𝒜 i`, then it is isomorphic as
a ring to a direct sum of components. -/
def decomposeRingEquiv : A ≃+* ⨁ i, 𝒜 i 
goal: A ≃+* ⨁ (i : ι), ↥(𝒜 i)

full_name: DirectSum.decompose_one
code: @[simp]
theorem decompose_one : decompose 𝒜 (1 : A) = 1 
goal: (DirectSum.decompose 𝒜) 1 = 1

full_name: DirectSum.decompose_symm_one
code: @[simp]
theorem decompose_symm_one : (decompose 𝒜).symm 1 = (1 : A) 
goal: (DirectSum.decompose 𝒜).symm 1 = 1

full_name: DirectSum.decompose_mul
code: @[simp]
theorem decompose_mul (x y : A) : decompose 𝒜 (x * y) = decompose 𝒜 x * decompose 𝒜 y 
goal: (DirectSum.decompose 𝒜) (x * y) = (DirectSum.decompose 𝒜) x * (DirectSum.decompose 𝒜) y

full_name: DirectSum.decompose_symm_mul
code: @[simp]
theorem decompose_symm_mul (x y : ⨁ i, 𝒜 i) :
    (decompose 𝒜).symm (x * y) = (decompose 𝒜).symm x * (decompose 𝒜).symm y 
goal: (DirectSum.decompose 𝒜).symm (x * y) = (DirectSum.decompose 𝒜).symm x * (DirectSum.decompose 𝒜).symm y

full_name: GradedRing.proj
code: /-- The projection maps of a graded ring -/
def GradedRing.proj (i : ι) : A →+ A 
goal: A →+ A

full_name: GradedRing.proj_apply
code: @[simp]
theorem GradedRing.proj_apply (i : ι) (r : A) :
    GradedRing.proj 𝒜 i r = (decompose 𝒜 r : ⨁ i, 𝒜 i) i 
goal: (GradedRing.proj 𝒜 i) r = ↑(((DirectSum.decompose 𝒜) r) i)

full_name: GradedRing.proj_recompose
code: theorem GradedRing.proj_recompose (a : ⨁ i, 𝒜 i) (i : ι) :
    GradedRing.proj 𝒜 i ((decompose 𝒜).symm a) = (decompose 𝒜).symm (DirectSum.of _ i (a i)) 
goal: (GradedRing.proj 𝒜 i) ((DirectSum.decompose 𝒜).symm a) =
  (DirectSum.decompose 𝒜).symm ((DirectSum.of (fun i => ↥(𝒜 i)) i) (a i))

full_name: GradedRing.mem_support_iff
code: theorem GradedRing.mem_support_iff [∀ (i) (x : 𝒜 i), Decidable (x ≠ 0)] (r : A) (i : ι) :
    i ∈ (decompose 𝒜 r).support ↔ GradedRing.proj 𝒜 i r ≠ 0 
goal: i ∈ DFinsupp.support ((DirectSum.decompose 𝒜) r) ↔ (GradedRing.proj 𝒜 i) r ≠ 0

full_name: DirectSum.coe_decompose_mul_add_of_left_mem
code: theorem coe_decompose_mul_add_of_left_mem [AddLeftCancelMonoid ι] [GradedRing 𝒜] {a b : A}
    (a_mem : a ∈ 𝒜 i) : (decompose 𝒜 (a * b) (i + j) : A) = a * decompose 𝒜 b j 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) (i + j)) = a * ↑(((DirectSum.decompose 𝒜) b) j)

full_name: DirectSum.coe_decompose_mul_add_of_right_mem
code: theorem coe_decompose_mul_add_of_right_mem [AddRightCancelMonoid ι] [GradedRing 𝒜] {a b : A}
    (b_mem : b ∈ 𝒜 j) : (decompose 𝒜 (a * b) (i + j) : A) = decompose 𝒜 a i * b 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) (i + j)) = ↑(((DirectSum.decompose 𝒜) a) i) * b

full_name: DirectSum.decompose_mul_add_left
code: theorem decompose_mul_add_left [AddLeftCancelMonoid ι] [GradedRing 𝒜] (a : 𝒜 i) {b : A} :
    decompose 𝒜 (↑a * b) (i + j) =
      @GradedMonoid.GMul.mul ι (fun i => 𝒜 i) _ _ _ _ a (decompose 𝒜 b j) 
goal: ((DirectSum.decompose 𝒜) (↑a * b)) (i + j) = GradedMonoid.GMul.mul a (((DirectSum.decompose 𝒜) b) j)

full_name: DirectSum.decompose_mul_add_right
code: theorem decompose_mul_add_right [AddRightCancelMonoid ι] [GradedRing 𝒜] {a : A} (b : 𝒜 j) :
    decompose 𝒜 (a * ↑b) (i + j) =
      @GradedMonoid.GMul.mul ι (fun i => 𝒜 i) _ _ _ _ (decompose 𝒜 a i) b 
goal: ((DirectSum.decompose 𝒜) (a * ↑b)) (i + j) = GradedMonoid.GMul.mul (((DirectSum.decompose 𝒜) a) i) b

full_name: GradedAlgebra
code: /-- A special case of `GradedRing` with `σ = Submodule R A`. This is useful both because it
can avoid typeclass search, and because it provides a more concise name. -/
abbrev GradedAlgebra 
goal: Type (max u_1 u_3)

full_name: GradedAlgebra.ofAlgHom
code: /-- A helper to construct a `GradedAlgebra` when the `SetLike.GradedMonoid` structure is already
available. This makes the `left_inv` condition easier to prove, and phrases the `right_inv`
condition in a way that allows custom `@[ext]` lemmas to apply.

See note [reducible non-instances]. -/
abbrev GradedAlgebra.ofAlgHom [SetLike.GradedMonoid 𝒜] (decompose : A →ₐ[R] ⨁ i, 𝒜 i)
    (right_inv : (DirectSum.coeAlgHom 𝒜).comp decompose = AlgHom.id R A)
    (left_inv : ∀ i (x : 𝒜 i), decompose (x : A) = DirectSum.of (fun i => ↥(𝒜 i)) i x) :
    GradedAlgebra 𝒜 
goal: GradedAlgebra 𝒜

full_name: DirectSum.decomposeAlgEquiv
code: /-- If `A` is graded by `ι` with degree `i` component `𝒜 i`, then it is isomorphic as
an algebra to a direct sum of components. -/
-- Porting note: deleted [simps] and added the corresponding lemmas by hand
def decomposeAlgEquiv : A ≃ₐ[R] ⨁ i, 𝒜 i 
goal: A ≃ₐ[R] ⨁ (i : ι), ↥(𝒜 i)

full_name: DirectSum.decomposeAlgEquiv_apply
code: @[simp]
lemma decomposeAlgEquiv_apply (a : A) :
    decomposeAlgEquiv 𝒜 a = decompose 𝒜 a 
goal: (DirectSum.decomposeAlgEquiv 𝒜) a = (DirectSum.decompose 𝒜) a

full_name: DirectSum.decomposeAlgEquiv_symm_apply
code: @[simp]
lemma decomposeAlgEquiv_symm_apply (a : ⨁ i, 𝒜 i) :
    (decomposeAlgEquiv 𝒜).symm a = (decompose 𝒜).symm a 
goal: (DirectSum.decomposeAlgEquiv 𝒜).symm a = (DirectSum.decompose 𝒜).symm a

full_name: DirectSum.decompose_algebraMap
code: @[simp]
lemma decompose_algebraMap (r : R) :
    decompose 𝒜 (algebraMap R A r) = algebraMap R (⨁ i, 𝒜 i) r 
goal: (DirectSum.decompose 𝒜) ((algebraMap R A) r) = (algebraMap R (⨁ (i : ι), ↥(𝒜 i))) r

full_name: DirectSum.decompose_symm_algebraMap
code: @[simp]
lemma decompose_symm_algebraMap (r : R) :
    (decompose 𝒜).symm (algebraMap R (⨁ i, 𝒜 i) r) = algebraMap R A r 
goal: (DirectSum.decompose 𝒜).symm ((algebraMap R (⨁ (i : ι), ↥(𝒜 i))) r) = (algebraMap R A) r

full_name: GradedAlgebra.proj
code: /-- The projection maps of graded algebra-/
def GradedAlgebra.proj (𝒜 : ι → Submodule R A) [GradedAlgebra 𝒜] (i : ι) : A →ₗ[R] A 
goal: A →ₗ[R] A

full_name: GradedAlgebra.proj_apply
code: @[simp]
theorem GradedAlgebra.proj_apply (i : ι) (r : A) :
    GradedAlgebra.proj 𝒜 i r = (decompose 𝒜 r : ⨁ i, 𝒜 i) i 
goal: (GradedAlgebra.proj 𝒜 i) r = ↑(((DirectSum.decompose 𝒜) r) i)

full_name: GradedAlgebra.proj_recompose
code: theorem GradedAlgebra.proj_recompose (a : ⨁ i, 𝒜 i) (i : ι) :
    GradedAlgebra.proj 𝒜 i ((decompose 𝒜).symm a) = (decompose 𝒜).symm (of _ i (a i)) 
goal: (GradedAlgebra.proj 𝒜 i) ((DirectSum.decompose 𝒜).symm a) =
  (DirectSum.decompose 𝒜).symm ((DirectSum.of (fun i => ↥(𝒜 i)) i) (a i))

full_name: GradedAlgebra.mem_support_iff
code: theorem GradedAlgebra.mem_support_iff [DecidableEq A] (r : A) (i : ι) :
    i ∈ (decompose 𝒜 r).support ↔ GradedAlgebra.proj 𝒜 i r ≠ 0 
goal: i ∈ DFinsupp.support ((DirectSum.decompose 𝒜) r) ↔ (GradedAlgebra.proj 𝒜 i) r ≠ 0

full_name: GradedRing.projZeroRingHom
code: /-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A 
goal: A →+* A

full_name: GradedRing.projZeroRingHom_apply
code: /-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A 
goal: (GradedRing.projZeroRingHom 𝒜) a = ↑(((DirectSum.decompose 𝒜) a) 0)

full_name: GradedRing.projZeroRingHom'
code: /-- The ring homomorphism from `A` to `𝒜 0` sending every `a : A` to `a₀`. -/
def GradedRing.projZeroRingHom' : A →+* 𝒜 0 
goal: A →+* ↥(𝒜 0)

full_name: GradedRing.coe_projZeroRingHom'_apply
code: @[simp] lemma GradedRing.coe_projZeroRingHom'_apply (a : A) :
    (GradedRing.projZeroRingHom' 𝒜 a : A) = GradedRing.projZeroRingHom 𝒜 a 
goal: ↑((GradedRing.projZeroRingHom' 𝒜) a) = (GradedRing.projZeroRingHom 𝒜) a

full_name: GradedRing.projZeroRingHom'_apply_coe
code: @[simp] lemma GradedRing.projZeroRingHom'_apply_coe (a : 𝒜 0) :
    GradedRing.projZeroRingHom' 𝒜 a = a 
goal: (GradedRing.projZeroRingHom' 𝒜) ↑a = a

full_name: GradedRing.projZeroRingHom'_surjective
code: /-- The ring homomorphism `GradedRing.projZeroRingHom' 𝒜` is surjective. -/
lemma GradedRing.projZeroRingHom'_surjective :
    Function.Surjective (GradedRing.projZeroRingHom' 𝒜) 
goal: Function.Surjective ⇑(GradedRing.projZeroRingHom' 𝒜)

full_name: DirectSum.coe_decompose_mul_of_left_mem_of_not_le
code: theorem coe_decompose_mul_of_left_mem_of_not_le (a_mem : a ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) n) = 0

full_name: DirectSum.coe_decompose_mul_of_right_mem_of_not_le
code: theorem coe_decompose_mul_of_right_mem_of_not_le (b_mem : b ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) n) = 0

full_name: DirectSum.coe_decompose_mul_of_left_mem_of_le
code: theorem coe_decompose_mul_of_left_mem_of_le (a_mem : a ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = a * decompose 𝒜 b (n - i) 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) n) = a * ↑(((DirectSum.decompose 𝒜) b) (n - i))

full_name: DirectSum.coe_decompose_mul_of_right_mem_of_le
code: theorem coe_decompose_mul_of_right_mem_of_le (b_mem : b ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = decompose 𝒜 a (n - i) * b 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) n) = ↑(((DirectSum.decompose 𝒜) a) (n - i)) * b

full_name: DirectSum.coe_decompose_mul_of_left_mem
code: theorem coe_decompose_mul_of_left_mem (n) [Decidable (i ≤ n)] (a_mem : a ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then a * decompose 𝒜 b (n - i) else 0 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) n) = if i ≤ n then a * ↑(((DirectSum.decompose 𝒜) b) (n - i)) else 0

full_name: DirectSum.coe_decompose_mul_of_right_mem
code: theorem coe_decompose_mul_of_right_mem (n) [Decidable (i ≤ n)] (b_mem : b ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then decompose 𝒜 a (n - i) * b else 0 
goal: ↑(((DirectSum.decompose 𝒜) (a * b)) n) = if i ≤ n then ↑(((DirectSum.decompose 𝒜) a) (n - i)) * b else 0

full_name: DirectSum.IsInternal.coeAlgEquiv
code: /-- The canonical isomorphism of an internal direct sum with the ambient algebra -/
noncomputable def coeAlgEquiv (hM : DirectSum.IsInternal M) :
    (DirectSum ι fun i => ↥(M i)) ≃ₐ[R] A 
goal: (⨁ (i : ι), ↥(M i)) ≃ₐ[R] A

full_name: DirectSum.IsInternal.gradedAlgebra
code: /-- Given an `R`-algebra `A` and a family `ι → Submodule R A` of submodules
parameterized by an additive monoid `ι`
and statisfying `SetLike.GradedMonoid M` (essentially, is multiplicative)
such that `DirectSum.IsInternal M` (`A` is the direct sum of the `M i`),
we endow `A` with the structure of a graded algebra.
The submodules are the *homogeneous* parts. -/
noncomputable def gradedAlgebra (hM : DirectSum.IsInternal M) : GradedAlgebra M 
goal: GradedAlgebra M