The numbering scheme I'm looking for causes every environment to share one common numbering counter, according to subsection. For example, in my notes the numbering would look something like this:
1 Section #1
2 Section #2
2.1 Subsection #2.1
2.1.1 Definition
2.1.2 Lemma
2.1.3 Theorem
Proof
2.1.4 Corollary
2.1.5 Example
Solution
2.2 Subsection #2.2
2.2.1 Definition
2.2.2 Lemma
2.2.3 Theorem
Proof
2.2.4 Corollary
2.2.5 Example
Solution
Below is a MWE:
\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm,thmtools}
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
% THEOREM Environments
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{result}[theorem]{Result}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\normalfont\bfseries,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
numberwithin=section
]{exstyle}
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\normalfont\bfseries,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
headpunct={},
qed=$\blacksquare$,
numbered=no
]{solstyle}
\declaretheorem[style=exstyle]{example}
\declaretheorem[style=solstyle]{solution}
\begin{document}
\section{Section 1}
\section{Section 2}
\subsection{Subsection 2.1}
\begin{definition}
test
\end{definition}
\begin{lemma}
content...
\end{lemma}
\begin{theorem}
content...
\end{theorem}
\begin{proof}
content...
\end{proof}
\begin{example}
content...
\end{example}
\begin{solution}
content...
\end{solution}
\subsection{Subsection 2.2}
\begin{definition}
test
\end{definition}
\begin{lemma}
content...
\end{lemma}
\begin{theorem}
content...
\end{theorem}
\begin{proof}
content...
\end{proof}
\begin{example}
content...
\end{example}
\begin{solution}
content...
\end{solution}
\end{document}
Except all the numbering is off.
I'm not sure if what I want is unconventional (and please let me know if there are any downsides to what I'm asking for).
By the way, most of this code was borrowed from different sources, e.g. the example environment was borrowed from this question, because I wanted an environment (without numbering) similar to the proof environment except with a filled-in square instead of a hollow square.
I must admit that the more code I copy from others, the less I understand the resulting code I end up with. As an unfortunate consequence, I have no idea what the different parts of the command \newtheorem{theorem}{Theorem}[section] mean, nor what the parts of \newtheorem{corollary}[theorem]{Corollary} mean. Please feel free to share any advice you have with me. You can safely assume my LaTeX understanding is novice. Thank you for your help!

\newtheorem{theorem}{Theorem}[subsection]– egreg Apr 12 '15 at 22:37Exampleis still on a different numbering system though... How can I make theExampleenvironment fit in with the others? – EthanAlvaree Apr 12 '15 at 23:03