Is there a (many-sorted) first- or second-order definition for graded rings? Usually, a graded ring $R$ over a monoid $M$ is defined as a ring which decomposes as an inner direct sum $R = \bigoplus_{m ∈ M} R_m$ of abelian subgroups such that for all $m, m' ∈ M$, $R_mR_{m'} \subseteq R_{m·m'}$.
I dislike this definition because it demands the existence of a decomposition. To my understanding, this definition cannot be formalised for a common first-order theory for two reasons:


*

*The decomposition involves subsets of $R$ (rather than elements of $R$).

*There are two structures involved, the ring $R$ and the monoid $M$ (even for $M = ℤ$).


Since Wikipedia also doesn’t mention the theory of graded rings on its list of first-order theories, it seems like the theory of graded rings is not a first-order theory. (Or is it?)
However, there is many-sorted logic which allows for instance a first-order theory for vector spaces; there is also second-order logic for dealing with quantification over subsets rather than elements.

This gives me hope: I would love to see a definition for graded rings as structures of (many-sorted) signature $(+_R,×_R,0_R,1_R,·_M,1_M,\operatorname{deg})$ (or something like that) such that a certain set of first-order or second-order axioms holds.


*

*Is there such a first-order definition?

*If not: Is there such a second-order definition?

 A: The definition does not merely demand existence; the decomposition is a structure, not a property, and morphisms of graded rings have to respect that structure. 
In any case, here's an alternative definition. An $M$-graded ring is a sequence $R_m, m \in M$ of abelian groups together with a sequence of maps
$$\times_{m, n} : R_m \times R_n \to R_{m+n}$$
satisfying all of the obvious axioms. This is a first-order $|M|$-sorted theory.
A more categorical way of putting it is the following. Given a monoid $M$ there is a category of $M$-graded abelian groups, which are just sequences $A_m, m \in M$ of abelian groups indexed by $M$. This category has a monoidal structure given by Day convolution, and $M$-graded rings are precisely monoids in this category with respect to this monoidal structure. 
A: The presentation of $M$-graded rings in Qiaochu's answer might or might not satisfy you, depending on what you want to do with your first-order theory. The $M$-indexed sequence of abelian groups, given together with the multiplication maps, captures all the information about an $M$-graded ring, in the sense that you can recover the ring from this data. But as tomasz points out in the comments, you can't actually quantify over elements of the ring (unless $M$ is finite), since you only have access to the homogeneous elements, and an arbitrary ring element is a finite sum of homogeneous elements. 
But if you're satisfied with the presentation in Qiaochu's answer, you can easily adjust it to be independent of the choice of monoid. Consider the language with two sorts, $A$ and $M$, an element $e\in M$, a binary function $\cdot:M^2\to M$, a unary relation $0\subseteq A$, a ternary relation $+\subseteq A^3$, a binary function $\times\colon A^2 \to A$, and a unary function $\text{deg}\colon A\to M$. 
We make a graded ring into a structure in this language by interpreting the $M$ sort as the monoid (and interpreting $e$ and $\cdot$ as identity and multiplication in the monoid), and interpreting the sort $A$ as the disjoint union of all the abelian groups $(R_m)_{m\in M}$ of homogeneous elements. Then the relation $0$ picks out exaclty one element of each $R_m$, the relation $+$ is the graph of addition (we have to make it a ternary relation, since you can only add two homogeneous elements of the same degree), $\times$ is multiplication, and $\text{deg}$ sends $a\in R_m$ to $m$.
I'll leave it to you to write down the first-order axioms. 
