LaTeX Feedback on my LaTeX code please

AI Thread Summary
The discussion revolves around a mathematical proof involving a continuous function defined on a sequentially compact set, demonstrating that if the function is not uniformly continuous, it leads to a contradiction. The proof constructs sequences of points within the set that converge to a limit, showing that the function values at these points also converge, ultimately contradicting the assumption of non-uniform continuity. Additionally, participants discuss the organization of LaTeX code, emphasizing the importance of structuring documents effectively and utilizing source code management tools like Git for tracking changes. Resources, including an ACM article on LaTeX best practices, are shared to aid in improving code organization.
Eclair_de_XII
Messages
1,082
Reaction score
91
TL;DR Summary
Tried copying math proof from this forum into LaTeX. Need feedback on how to better structure it.
[CODE title="style"]\newcommand\func{\(f\)}
\newcommand\myset[1][math]{\ifthenelse{\equal{math}{#1}}{\(K\)}{K}}

\newcommand\diff[4]{\(|#1-#2|#4#3\)}

\newcommand\ball[3]{\diff{#1}{#2}{#3}{<}}
\newcommand\Fllab[2]{\diff{f(#1)}{f(#2)}{\epsilon}{\geq}}

\newcommand\term[2][n_k]{\({#2}_{#1}\)}

\newcommand\setdelta[1]{\(\delta=#1\)}
\newcommand\ptsinset[1]{\(x_{#1},y_{#1}\in\myset[]\)}

\newcommand\xyball[1]{\ball{x_{#1}}{y_{#1}}{\ifthenelse{#1>1}{\frac{1}{#1}}{1}}}

\newcommand\seq[2][n]{\(\{{#2}_{#1}\}\)}

\newcommand\ucontinv{there is \(\epsilon>0\) such that for any \(\delta>0\), there are points \(x,y\in \myset[]\) such that \ball{x}{y}{\delta} but \Fllab{x}{y}}

\newcommand\seqconverge[2]{There is an integer \(#1\) such that if \(n_k\geq#1: |{#2}_{n_k}-z|<\delta'\)\par}[/CODE]

[CODE title="proof"]Let \func{} be a continuous function defined on a sequentially compact set \myset. Suppose \func is not uniformly continuous. By definition, \ucontinv.

In particular, choose \setdelta{1} and find points \ptsinset{1} with the property that \xyball{1} and \Fllab{x_1}{y_1}. Now choose \setdelta{2} and then find points \ptsinset{2} with the property that \xyball{2} and \Fllab{x_2}{y_2}.

Continuing in this fashion, we obtain two sequences \seq{x}, \seq{y} with the property that for any \(\delta>0\), we can choose an integer \(N>\frac{1}{\delta}\) in order to ensure that \(|x_N-y_N|<\frac{1}{N}<\delta\).

Since \myset{} is sequentially compact, it follows that there exists a subsequence of \seq{x}, which we shall denote as \seq[n_k]{x} that converges to some point \(z \in \myset[]\). Now for each \seq[n_k]{x}, choose \seq[n_k]{y} such that \ball{x_{n_k}}{y_{n_k}}{\frac{1}{m}} where \(m\) is the index of \term{x}, \term{y} in their respective parent sequences.

This gives us a sequence \seq[n_k]{y} with the property that \(|y_{n_k}-x_{n_k}|\rightarrow0\). Moreover, since a given \term{x} gets arbitrarily close to \(z\), it follows that \term{y} must get close to \(z\) as well.

There is \(\delta'>0\) such that for all \(x\in \myset[]\), in particular the terms in the sequence constructed, with the property that whenever \ball{x}{z}{\delta'}, it follows that \ball{f(x)}{f(z)}{\frac{\epsilon}{2}}.

\seqconverge{N_1}{x}
\seqconverge{N_2}{y}

Choose \(N\equiv \sup\{N_1,N_2\}\) such that if \(n_k\geq N\):

\begin{align*}
|f(x_{n_k})-f(z)|<\frac{\epsilon}{2}\\
|f(z)-f(y_{n_k})|<\frac{\epsilon}{2}
\end{align*}

It follows that:

\begin{align*}
\epsilon&>&|f(z)-f(y_{n_k})|+|f(x_{n_k})-f(z)|\\
&\geq&|[f(z)-f(y_{n_k})]+[f(x_{n_k})-f(z)]|\\
&=&|-f(y_{n_k})+f(x_{n_k})|
\end{align*}

contrary to the assumption that \(|f(x_n)-f(y_n)|%
\nrightarrow0\) for all \(x_n,y_n\).[/CODE]

[CODE title="main"]\documentclass{minimal}

\usepackage{ifthen}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{style}

\begin{document}
\input{proof}
\end{document}[/CODE]
 
Physics news on Phys.org
I see lots of latex code but not where your formatted proof is having issues.

it’s hard to proceed from what you gave us.
 
It's not actually having any issues or errors. I actually wanted feedback on how to better structure it, which is something I admit I should have mentioned in the opening post.
 
Your best bet is to search on Latex Best Practices and see what other experienced users say.

I found this ACM article on best practices for organizing your code.

https://www.acm.org/publications/taps/latex-best-practices

On another site, it was mentioned to use source code management like git to keep track of changes and recover from bad choices.
 
Back
Top