1

I am trying to modify the following code to get: (a) Definitions numbered as Definition CHAPTER.SECTION.ALPH --- FANCY DEFINITION TITLE and (b) Propositions numbered as Proposition CHAPTER.SECTION.ARABIC --- FANCY PROPOSITION TITLE, while keeping proofs unnumbered, but I can't. I would also like them to be bold, as well as a dot after each of the numbers. That is: Definitions and Propositions headings should look like the current proof heading, but with the desired numbering as well. The code I am currently using can be seen in this MWE:

\documentclass[a4paper]{report}
\pagestyle{plain}

% PACKAGES LOADING

\usepackage[dvipsnames]{xcolor} % To get many colours.
\usepackage{amsmath, mathtools, amsthm, mathrsfs, amssymb} % MATH Packages
\usepackage{mdframed} % To get page-breakable proofs.

% PROPOSITION ENVIRONMENT 

\newtheoremstyle{mystyle0}{0}{}{}{}{\bfseries}{:}{ }{\thmname{#1} --- \thmnote{#3}}
\theoremstyle{mystyle0}
\newmdtheoremenv[innerleftmargin=0.2cm,innerrightmargin=0.2cm,innertopmargin=0.2cm,innerbottommargin=0.2cm,linecolor=Blue,linewidth=0.5mm,hidealllines=false,nobreak=true]{proposition}{Proposition}

% PROOF ENVIRONMENT 

\newtheoremstyle{mystyle1}{0}{}{\footnotesize}{}{\bfseries}{:}{ }{\thmname{#1} --- \thmnote{#3}}
\theoremstyle{mystyle1}
\let\proof\relax
\let\endproof\relax
\newmdtheoremenv[innerleftmargin=0.2cm,innerrightmargin=0.2cm,innertopmargin=0.2cm,innerbottommargin=0.2cm,hidealllines=true,backgroundcolor=Blue!10]{proof}{Proof}
\AtEndEnvironment{proof}{\hfill$\blacksquare$}

% DEFINITION ENVIRONMENT 

\newtheoremstyle{mystyle2}{0}{}{}{}{\bfseries}{:}{ }{\thmname{#1} ---     \thmnote{#3}}
\theoremstyle{mystyle2}
\newmdtheoremenv[innerleftmargin=0.2cm,innerrightmargin=0.2cm,innertopmargin=0.2cm,innerbottommargin=0.2cm,hidealllines=true,backgroundcolor=Gray!15]{definition}{Definition}

% MY (FAILED) ATTEMPT TO GET THE NUMBERING AS I WANT

\numberwithin{proposition}{section}
\numberwithin{definition}{section}
\renewcommand{\definition}{\textbf{\arabic{chapter}.\arabic{section}.\Alph{definition} ---}}
\renewcommand{\proposition}{\textbf{\arabic{chapter}.\arabic{section}.\arabic{proposition} ---}}

\begin{document}

\chapter{FANCY CHAPTER TITLE}

\section{FANCY SECTION TITLE}

\begin{proof}[von-Neumann--Morgenstern Expected Utility Theorem I]
Let's prove that if there exists $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$, a preference $\succsim$ on $\mathcal{L}(X)$ satisfies X and Y. Assume there exists a utility function $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$ representing $\succsim$ such that $U$ satisfies the expected utility property.
    \begin{enumerate}
    \item To show that $\succsim$ \textbf{is continuous}, let $x,y,z \in \mathcal{L}(X)$ such that $x \succ y \succ z$. Since $U$ represents $\succsim$, $U(x) > U(y) > U(z)$. The set of real numbers is convex; and hence there exists $p \in (0,1)$ such that $p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. By the expected utility property, $U(p \odot x \oplus (1-p) \odot z) = p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. Since $U$ represents $\succsim$, $p \odot x \oplus (1-p) \odot z \sim y$. Now, let $q,r \in [0,1]$ be such that $q >p>r$. Then:
    \begin{flalign*}
        && q \cdot U(x) + (1-q) \cdot U(z) & > p \cdot U(x) + (1-p) \cdot U(z)\\
        && &> r \cdot U(x) + (1-r)\cdot U(z)
    \end{flalign*}

    And by the expected utility property, and the hypothesis that $U$ represents $\succsim$, it follows that $q \odot x \oplus (1-q) \odot z \succ y \succ r \odot x \oplus (1-r) \odot z$.
    \item To show that $\succsim$ \textbf{satisfies independence}, let $x,y,z \in \mathcal{L}(X)$ and let $p \in [0,1]$. Since $U$ represents $\succsim$, $x \succ y \Longleftrightarrow U(x) > U(y)$. Hence, $x \succ y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) > p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \succ y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \succ [p \odot y \oplus (1-p) \odot z]$. Since $U$ represents $\succsim$, $x \sim y \Longleftrightarrow U(X) = U(y)$. Hence, $x \sim y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) = p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \sim y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \sim [p \odot y \oplus (1-p) \odot z]$.
\end{enumerate}
\end{proof}

\begin{definition}[\textbf{Continuous Preference}]
Let $X$ be a metric space. A preference $\succsim$ on $X$ is continuous if for all $x \in X$, the sets $\{ y \in X \mid y \succsim x \}$ and $\{ y \in X \mid x \succsim y \}$ are closed.
\end{definition}

\begin{proposition}[\textbf{Continuous Utility Function Existence}]
Let $X$ be a compact metric space and $\succsim$ be a continuous, complete and transitive preference on $X$. Then, there exists a continuous utility function $u: X \longrightarrow \mathbb{R}$ that represents $\succsim$.
\end{proposition}

\end{document}

Getting this (rather poor) output:

enter image description here

Could anyone please help me? Thank you all for your time.

3
  • Your theoremstyles do not make use of the counter formater \theproposition etc.
    – user31729
    Commented Feb 14, 2017 at 23:22
  • I really appreciate you took your time to go through my question, but I am afraid that I don't know how I could use your hint.
    – EoDmnFOr3q
    Commented Feb 14, 2017 at 23:24
  • 1
    \thmname{#1} \thmnumber{#2} - - - \thmnote{#3} and you should not change \definition etc, but \thedefinition
    – user31729
    Commented Feb 14, 2017 at 23:25

2 Answers 2

2

There are some logical errors in there

  • In order to access the number of the environment, amsthm provides the wrapper \thmnumber{#2}.
  • In order to change the numbering style, the counter formatter \thedefinition etc. has to be changed, not \definition --> \definition is the definition environment starter macro -- don't do this!

Instead of \numberwithin{definition}{section} you could specify this with \newmdtheoremenv[mdframed options]{envname}{heading name}[section]. Using \numberwithin however is no error, but not really needed if the quicker setup with mdframed can be done (which is necessary anyway)


\documentclass[a4paper]{report}
\pagestyle{plain}

% PACKAGES LOADING

\usepackage[dvipsnames]{xcolor} % To get many colours.
\usepackage{amsmath, mathtools, amsthm, mathrsfs, amssymb} % MATH Packages
\usepackage{mdframed} % To get page-breakable proofs.

% PROPOSITION ENVIRONMENT 

\makeatletter

\newtheoremstyle{mystyle0}{0}{}{}{}{\bfseries}{:}{ }{\thmname{#1} \thmnumber{#2} --- \thmnote{#3}}
\theoremstyle{mystyle0}
\newmdtheoremenv[innerleftmargin=0.2cm,innerrightmargin=0.2cm,innertopmargin=0.2cm,innerbottommargin=0.2cm,linecolor=Blue,linewidth=0.5mm,hidealllines=false,nobreak=true]{proposition}{Proposition}[section]

% PROOF ENVIRONMENT 

\newtheoremstyle{mystyle1}{0}{}{\footnotesize}{}{\bfseries}{:}{ }{\thmname{#1} --- \thmnote{#3}}
\theoremstyle{mystyle1}
\let\proof\relax
\let\endproof\relax
\newmdtheoremenv[innerleftmargin=0.2cm,innerrightmargin=0.2cm,innertopmargin=0.2cm,innerbottommargin=0.2cm,hidealllines=true,backgroundcolor=Blue!10]{proof}{Proof}
\AtEndEnvironment{proof}{\hfill$\blacksquare$}

% DEFINITION ENVIRONMENT 

\newtheoremstyle{mystyle2}{0}{}{}{}{\bfseries}{:}{ }{\thmname{#1} \thmnumber{#2} ---     \thmnote{#3}}
\theoremstyle{mystyle2}
\newmdtheoremenv[innerleftmargin=0.2cm,innerrightmargin=0.2cm,innertopmargin=0.2cm,innerbottommargin=0.2cm,hidealllines=true,backgroundcolor=Gray!15]{definition}{Definition}[section]

% MY (FAILED) ATTEMPT TO GET THE NUMBERING AS I WANT

\renewcommand{\thedefinition}{\arabic{chapter}.\arabic{section}.\Alph{definition}}
\renewcommand{\theproposition}{\arabic{chapter}.\arabic{section}.\arabic{proposition}}

\makeatother

\begin{document}

\chapter{FANCY CHAPTER TITLE}

\section{FANCY SECTION TITLE}

\begin{proof}[von-Neumann--Morgenstern Expected Utility Theorem I]
Let's prove that if there exists $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$, a preference $\succsim$ on $\mathcal{L}(X)$ satisfies X and Y. Assume there exists a utility function $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$ representing $\succsim$ such that $U$ satisfies the expected utility property.
    \begin{enumerate}
    \item To show that $\succsim$ \textbf{is continuous}, let $x,y,z \in \mathcal{L}(X)$ such that $x \succ y \succ z$. Since $U$ represents $\succsim$, $U(x) > U(y) > U(z)$. The set of real numbers is convex; and hence there exists $p \in (0,1)$ such that $p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. By the expected utility property, $U(p \odot x \oplus (1-p) \odot z) = p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. Since $U$ represents $\succsim$, $p \odot x \oplus (1-p) \odot z \sim y$. Now, let $q,r \in [0,1]$ be such that $q >p>r$. Then:
    \begin{flalign*}
        && q \cdot U(x) + (1-q) \cdot U(z) & > p \cdot U(x) + (1-p) \cdot U(z)\\
        && &> r \cdot U(x) + (1-r)\cdot U(z)
    \end{flalign*}

    And by the expected utility property, and the hypothesis that $U$ represents $\succsim$, it follows that $q \odot x \oplus (1-q) \odot z \succ y \succ r \odot x \oplus (1-r) \odot z$.
    \item To show that $\succsim$ \textbf{satisfies independence}, let $x,y,z \in \mathcal{L}(X)$ and let $p \in [0,1]$. Since $U$ represents $\succsim$, $x \succ y \Longleftrightarrow U(x) > U(y)$. Hence, $x \succ y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) > p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \succ y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \succ [p \odot y \oplus (1-p) \odot z]$. Since $U$ represents $\succsim$, $x \sim y \Longleftrightarrow U(X) = U(y)$. Hence, $x \sim y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) = p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \sim y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \sim [p \odot y \oplus (1-p) \odot z]$.
\end{enumerate}
\end{proof}

\begin{definition}[\textbf{Continuous Preference}]
Let $X$ be a metric space. A preference $\succsim$ on $X$ is continuous if for all $x \in X$, the sets $\{ y \in X \mid y \succsim x \}$ and $\{ y \in X \mid x \succsim y \}$ are closed.
\end{definition}

\begin{proposition}[\textbf{Continuous Utility Function Existence}]
Let $X$ be a compact metric space and $\succsim$ be a continuous, complete and transitive preference on $X$. Then, there exists a continuous utility function $u: X \longrightarrow \mathbb{R}$ that represents $\succsim$.
\end{proposition}

\section{Other}


\begin{definition}[\textbf{Continuous Preference}]
Let $X$ be a metric space. A preference $\succsim$ on $X$ is continuous if for all $x \in X$, the sets $\{ y \in X \mid y \succsim x \}$ and $\{ y \in X \mid x \succsim y \}$ are closed.
\end{definition}

\begin{proposition}[\textbf{Continuous Utility Function Existence}]
Let $X$ be a compact metric space and $\succsim$ be a continuous, complete and transitive preference on $X$. Then, there exists a continuous utility function $u: X \longrightarrow \mathbb{R}$ that represents $\succsim$.
\end{proposition}


\end{document}

enter image description here

1

A simple solution with framed and ntheorem:

    \documentclass[a4paper]{report}
    \pagestyle{plain}
    \usepackage{geometry}%
     \usepackage[dvipsnames, x11names, svgnames]{xcolor}
    \usepackage{amsmath, mathtools, mathrsfs, amssymb}
    \usepackage{framed, enumitem} %
    \usepackage[framed, thref, amsmath, thmmarks]{ntheorem} %
    \makeatletter
    \newtheoremstyle{myproof}%
    {\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]}%
    {\item[\theorem@headerfont\hskip \labelsep ##1~---~##3\theorem@separator]}
    \renewtheoremstyle{plain}%
    {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
    {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2~---~##3\theorem@separator]}
    \makeatother
\theoremstyle{myproof}
    \theoremheaderfont{\bfseries}
    \theorembodyfont{\mdseries}
    \theoremseparator{:}
    \theoremsymbol{\ensuremath{\square}}
    \newframedtheorem{proof}{Proof}
 %%%%%%%%%%%%%%%%
    \theoremstyle{plain}
 \theoremsymbol{}
 \theoremheaderfont{\bfseries\upshape}
\theorembodyfont{\itshape}
\colorlet{framecolor}{NavyBlue!65}
 \def\theoremframecommand{\setlength{\fboxrule}{1.6pt}\fcolorbox{framecolor}{white}}
 \theoremprework{}
\newshadedtheorem{proposition}{Proposition}[section]

 \colorlet{shadecolor}{Lavender!60!}
  \def\theoremframecommand{\fboxsep=6pt\colorbox{shadecolor}}
\theorembodyfont{\upshape}
\theoremnumbering{Alph}
\newshadedtheorem{defi}{Definition}[section]
%%%%%%%%%%%%%%%%

\usepackage{lipsum}

\begin{document}


\chapter{FANCY CHAPTER TITLE}

\section{FANCY SECTION TITLE}
\lipsum[11]
\begin{defi}[Continuous Preference]
Let $X$ be a metric space. A preference $\succsim$ on $X$ is continuous if for all $x \in X$, the sets $\{ y \in X \mid y \succsim x \}$ and $\{ y \in X \mid x \succsim y \}$ are closed.
\end{defi}

\begin{proposition}[\textbf{Continuous Utility Function Existence}]
Let $X$ be a compact metric space and $\succsim$ be a continuous, complete and transitive preference on $X$. Then, there exists a continuous utility function $u: X \longrightarrow \mathbb{R}$ that represents $\succsim$.
\end{proposition}

 \begin{proof}[von\,Neumann-Morgenstern Expected Utility Theorem I]
 Let's prove that if there exists $U: \mathcal{L}(X) ―――→ \mathbb{R}$, a preference $\succsim$ on $\mathcal{L}(X)$ satisfies X and Y. Assume there exists a utility function $U: \mathcal{L}(X) ―――→ \mathbb{R}$ representing $\succsim$ such that $U$ satisfies the expected utility property.
 \begin{enumerate}[wide=0pt, leftmargin=*]
 \item To show that $\succsim$ \textbf{is continuous}, let $x,y,z ∈ \mathcal{L}(X)$ such that $x ≻ y ≻ z$. Since $U$ represents $\succsim$, $U(x) > U(y) > U(z)$. The set of real numbers is convex; and hence there exists $p ∈ (0,1)$ such that $p · U(x) + (1-p) · U(z) = U(y)$. By the expected utility property, $U(p \odot x ⊕ (1-p) \odot z) = p · U(x) + (1-p) · U(z) = U(y)$. Since $U$ represents $\succsim$, $p \odot x ⊕ (1-p) \odot z ∼ y$. Now, let $q,r ∈ [0,1]$ be such that $q >p>r$. Then:
 \begin{flalign*}
 && q · U(x) + (1-q) · U(z) & > p · U(x) + (1-p) · U(z)\\
 && &> r · U(x) + (1-r) · U(z)
 \end{flalign*}

 And by the expected utility property, and the hypothesis that $U$ represents $\succsim$, it follows that $q \odot x ⊕ (1-q) \odot z ≻ y ≻ r \odot x ⊕ (1-r) \odot z$.
 \item To show that $\succsim$ \textbf{satisfies independence}, let $x,y,z ∈ \mathcal{L}(X)$ and let $p ∈ [0,1]$. Since $U$ represents $\succsim$, $x ≻ y \Longleftrightarrow U(x) > U(y)$. Hence, $x ≻ y \Longleftrightarrow p · U(x) + (1-p) · U(z) > p · U(y) + (1-p) · U(z)$. Since $U$ satisfies the expected utility property, $x ≻ y \Longleftrightarrow [p \odot x ⊕ (1-p) \odot z] ≻ [p \odot y ⊕ (1-p) \odot z]$. Since $U$ represents $\succsim$, $x ∼ y \Longleftrightarrow U(X) = U(y)$. Hence, $x ∼ y \Longleftrightarrow p · U(x) + (1-p) · U(z) = p · U(y) + (1-p) · U(z)$. Since $U$ satisfies the expected utility property, $x ∼ y \Longleftrightarrow [p \odot x ⊕ (1-p) \odot z] ∼ [p \odot y ⊕ (1-p) \odot z]$.
 \end{enumerate} %
 \end{proof}

    \end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .