I would like to number align environments and theorems differently. E.g.the align environment following Theorem 2.1 is numbered 2.2. My preamble is attached in the following. I don't know what I have to change in order to decouple the nummeration. I would be grateful for any help!
\documentclass[a4paper,fleq,12pt]{scrreprt}
\pagestyle{headings}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[babel,german=quotes]{csquotes}
\usepackage{color}
\usepackage{amssymb, amsmath, amsthm}
\usepackage[all]{xy}
\usepackage{setspace}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1.4ex plus 0.35ex minus 0.3ex}
\setcounter{tocdepth}{3}
\usepackage{listings}
\lstset{language=Java,
showstringspaces=false,
frame=single,
numbers=left,
basicstyle=\ttfamily,
numberstyle=\tiny}
\numberwithin{equation}{section}
\numberwithin{table}{section}
\numberwithin{figure}{section}
\usepackage{hyperref}
\usepackage{mathrsfs}
\hyphenation{Sil-ben-trenn-ung}
\newtheorem{theorem}[equation]{Theorem}
is what you're looking for.