I can reproduce your first image with
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage[sc]{mathpazo}
\usepackage{microtype}
\usepackage{showframe} % just for the example
\newcommand{\ancestorplus}[1]{\mathit{ancestor}^{+}(#1)}
\newcommand{\descendantsplus}[1]{\mathit{descendants}^{+}(#1)}
\begin{document}
\noindent
we have:
$\descendantsplus{\mathtt{A}} = \{ \mathtt{A}, \mathtt{B}, \mathtt{C} \}$,
$\descendantsplus{\mathtt{B}} = \{ \mathtt{B} \}$,
$\descendantsplus{\mathtt{C}} = \{ \mathtt{C} \}$,
$\ancestorplus{\mathtt{A}} = \{ \mathtt{A} \}$,
$\ancestorplus{\mathtt{B}} = \{ \mathtt{A,B} \}$,
$\ancestorplus{\mathtt{C}} = \{ \mathtt{A,C} \}$.
\end{document}
Using microtype
gives a smaller amount of overfull. Note that, differently from your code, this is six different formulas. A single one is wrong and gives TeX even less chances to split a line, because breaking at commas inside formulas is disallowed, so only binary relations are feasible break points.
There is little chance to typeset this paragraph without splitting after =
anyhow, unless you're able to move “we have:” to the line above.
You can disallow breaking after a particular =
sign by using
=\nolinebreak
but this wouldn't help in the first two cases of the following tests, because there's no way to fit \{\mathtt{C}\}
in the line. Try it in the second example.
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage[sc]{mathpazo}
\usepackage{microtype}
\usepackage{showframe} % just for the example
\newcommand{\ancestorplus}[1]{\mathit{ancestor}^{+}(#1)}
\newcommand{\descendantsplus}[1]{\mathit{descendants}^{+}(#1)}
\begin{document}
\noindent
we have:
$\descendantsplus{\mathtt{A}} = \{ \mathtt{A}, \mathtt{B}, \mathtt{C} \}$,
$\descendantsplus{\mathtt{B}} = \{ \mathtt{B} \}$,
$\descendantsplus{\mathtt{C}} = \{ \mathtt{C} \}$,
$\ancestorplus{\mathtt{A}} = \{ \mathtt{A} \}$,
$\ancestorplus{\mathtt{B}} = \{ \mathtt{A,B} \}$,
$\ancestorplus{\mathtt{C}} = \{ \mathtt{A,C} \}$.
\bigskip
\noindent
have:
$\descendantsplus{\mathtt{A}} = \{ \mathtt{A}, \mathtt{B}, \mathtt{C} \}$,
$\descendantsplus{\mathtt{B}} = \{ \mathtt{B} \}$,
$\descendantsplus{\mathtt{C}} = \{ \mathtt{C} \}$,
$\ancestorplus{\mathtt{A}} = \{ \mathtt{A} \}$,
$\ancestorplus{\mathtt{B}} = \{ \mathtt{A,B} \}$,
$\ancestorplus{\mathtt{C}} = \{ \mathtt{A,C} \}$.
\bigskip
\noindent
$\descendantsplus{\mathtt{A}} = \{ \mathtt{A}, \mathtt{B}, \mathtt{C} \}$,
$\descendantsplus{\mathtt{B}} = \{ \mathtt{B} \}$,
$\descendantsplus{\mathtt{C}} = \{ \mathtt{C} \}$,
$\ancestorplus{\mathtt{A}} = \{ \mathtt{A} \}$,
$\ancestorplus{\mathtt{B}} = \{ \mathtt{A,B} \}$,
$\ancestorplus{\mathtt{C}} = \{ \mathtt{A,C} \}$.
\end{document}

By the way, \texttt
is wrong, because it only changes the font family, but not other attributes, so you'd get italic letters in a theorem statement.