\documentclass[a4paper,fleqn,11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\usepackage{mdframed}
\usepackage{lipsum}

\usepackage{libertine}
\usepackage[scaled=0.80]{DejaVuSans}
\usepackage[libertine,cmintegrals]{newtxmath}
\renewcommand\ttdefault{lmvtt}

\usepackage{geometry}
\geometry{a4paper,left=34mm,right=34mm,top=30mm,bottom=40mm}

\usepackage{color}
\definecolor{c1}{RGB}{0,40,80}
\definecolor{gray1}{RGB}{80,80,80}
\usepackage[colorlinks=true,linkcolor=c1]{hyperref}
% \usepackage[colorlinks=true,linkcolor=black]{hyperref}

\newcommand{\strong}[1]{\textsf{\textbf{#1}}}

\newtheoremstyle{rmbox}%
  {0pt}% space above
  {0pt}% space below
  {}% bodyfont
  {}% indent
  {\sf\bfseries}% head font
  {\\[2pt]}% punctuation between head and body
  {0pt}% space after theorem head
  {\thmname{#1}\;\thmnumber{#2}.\;\thmnote{#3.}}

\theoremstyle{rmbox}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}

\definecolor{greenblue}{rgb}{0.0,0.32,0.4}
\definecolor{grayblue}{rgb}{0.2,0.2,0.4}

\surroundwithmdframed[topline=false,rightline=false,bottomline=false,%
  linecolor=greenblue, linewidth=3.5pt, innerleftmargin=6pt,%
  innertopmargin=2pt, innerbottommargin=6pt,%
  innerrightmargin=0pt%
]{definition}

\newcommand{\framedtheorem}[1]{%
\surroundwithmdframed[topline=false,rightline=false,bottomline=false,%
  linecolor=grayblue, linewidth=3.5pt, innerleftmargin=6pt,%
  innertopmargin=2pt, innerbottommargin=6pt,%
  innerrightmargin=0pt%
]{#1}}

\framedtheorem{theorem}
\framedtheorem{lemma}
\framedtheorem{corollary}

\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\R}{\mathbb R}
\newcommand{\C}{\mathbb C}
\newcommand{\ui}{\mathrm i}
\newcommand{\ee}{\mathrm e}
\newcommand{\defiff}{\;:\Longleftrightarrow\;}

\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\sur}{sur}
\DeclareMathOperator{\real}{Re}
\DeclareMathOperator{\imag}{Im}

\begin{document}
\thispagestyle{empty}

\noindent
{\huge\strong{Fundamentals}}

\tableofcontents

\section{Sets and mappings}

\subsection{Set operations}

\begin{definition}[Union]
Given two sets $A$ and $B$, the set
\begin{equation}\label{eq:cup}
A\cup B := \{x\mid x\in A\lor x\in b\}
\end{equation}
is called the \emph{union} of them.
\end{definition}


\subsection{Preimage}

\begin{definition}[Preimage]
The \emph{preimage} of a set $M$ under a mapping
$f\colon A\to B$ is defined as
\begin{equation}\label{eq:preimage}
f^{-1}(M) := \{x\mid f(x)\in M\}.
\end{equation}
\end{definition}

\begin{theorem}
For any mapping $f\colon A\to B$ it is true that
\begin{equation}
f^{-1}(A\cup B) = f^{-1}(A)\cup f^{-1}(B).
\end{equation}
\end{theorem}

\noindent
\strong{Proof.} According to \eqref{eq:preimage} and \eqref{eq:cup}
the following holds:
\begin{align}
&x\in f^{-1}(A\cup B)\iff f(x)\in A\cup B
\iff f(x)\in A\lor f(x)\in B\\
&\iff x\in f^{-1}(A)\lor x\in f^{-1}(B)
\iff x\in f^{-1}(A)\cup f^{-1}(B).\;\Box
\end{align}

\end{document}


