> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/latex/it/specifico-per-argomento/01-theorems-and-proofs.md).

# Teoremi e dimostrazioni

## Introduzione

I documenti matematici includono elementi che richiedono formattazione e numerazione speciali come teoremi, definizioni, proposizioni, osservazioni, corollari, lemmi e così via. Questo articolo spiega come definire questi ambienti in LaTeX.

Gli ambienti numerati in LaTeX possono essere definiti mediante il comando `\newtheorem` che prende due argomenti:

```latex
\newtheorem{theorem}{Teorema}
```

* il primo è il nome dell'ambiente che viene definito
* il secondo è la parola che verrà stampata, in grassetto, all'inizio dell'ambiente.

Una volta definito questo nuovo ambiente, può essere usato normalmente all'interno del documento, delimitato da `\begin{theorem}` e `\end{theorem}`. Di seguito è presentato un esempio:

```latex
\documentclass{article}
\usepackage[english]{babel}
\newtheorem{theorem}{Teorema}
\begin{document}

\section{Introduzione}
I teoremi possono essere definiti facilmente:

\begin{theorem}
Sia \(f\) una funzione la cui derivata esiste in ogni punto, allora \(f\)
è una funzione continua.
\end{theorem}
\end{document}
```

[Apri questo esempio in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=newtheorem+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Csection%7BIntroduction%7D%0ATheorems+can+easily+be+defined%3A%0A%0A%5Cbegin%7Btheorem%7D%0ALet+%5C%28f%5C%29+be+a+function+whose+derivative+exists+in+every+point%2C+then+%5C%28f%5C%29+%0Ais+a+continuous+function.%0A%5Cend%7Btheorem%7D%0A%5Cend%7Bdocument%7D)

Questo esempio produce il seguente output:

![OLV2TheoremsProofsEx1.png](/files/5d20afc7889b4d8e33d233a7f3e9efe1d18d95a5)

## Teoremi, definizioni, corollari e lemmi numerati

La numerazione degli ambienti può essere controllata mediante due parametri aggiuntivi nel `\newtheorem` comando. Vediamo:

```latex
\newtheorem{theorem}{Teorema}[section]
\newtheorem{corollary}{Corollario}[theorem]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
\section{Introduzione}
I teoremi possono essere definiti facilmente:

\begin{theorem}
Sia \(f\) una funzione la cui derivata esiste in ogni punto, allora \(f\) è
una funzione continua.
\end{theorem}

\begin{theorem}[Teorema di Pitagora]
\label{pythagorean}
Questo è un teorema sui triangoli rettangoli e può essere riassunto nel prossimo
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}

E una conseguenza del teorema \ref{pythagorean} è l'affermazione nel prossimo
corollario.

\begin{corollary}
Non esiste un rettangolo rettangolo i cui lati misurino 3cm, 4cm e 6cm.
\end{corollary}

Puoi fare riferimento a teoremi come \ref{pythagorean} quando viene assegnata un'etichetta.

\begin{lemma}
Date due segmenti di linea le cui lunghezze sono \(a\) e \(b\), rispettivamente, esiste un
numero reale \(r\) tale che \(b=ra\).
\end{lemma}
```

[Apri questo esempio in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Numbering+of+theorems\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%5Bsection%5D%0A%5Cnewtheorem%7Bcorollary%7D%7BCorollary%7D%5Btheorem%5D%0A%5Cnewtheorem%7Blemma%7D%5Btheorem%5D%7BLemma%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0ATheorems+can+easily+be+defined%3A%0A%0A%5Cbegin%7Btheorem%7D%0ALet+%5C%28f%5C%29+be+a+function+whose+derivative+exists+in+every+point%2C+then+%5C%28f%5C%29+is+%0Aa+continuous+function.%0A%5Cend%7Btheorem%7D%0A%0A%5Cbegin%7Btheorem%7D%5BPythagorean+theorem%5D%0A%5Clabel%7Bpythagorean%7D%0AThis+is+a+theorem+about+right+triangles+and+can+be+summarised+in+the+next+%0Aequation+%0A%5C%5B+x%5E2+%2B+y%5E2+%3D+z%5E2+%5C%5D%0A%5Cend%7Btheorem%7D%0A%0AAnd+a+consequence+of+theorem+%5Cref%7Bpythagorean%7D+is+the+statement+in+the+next+%0Acorollary.%0A%0A%5Cbegin%7Bcorollary%7D%0AThere%27s+no+right+rectangle+whose+sides+measure+3cm%2C+4cm%2C+and+6cm.%0A%5Cend%7Bcorollary%7D%0A%0AYou+can+reference+theorems+such+as+%5Cref%7Bpythagorean%7D+when+a+label+is+assigned.%0A%0A%5Cbegin%7Blemma%7D%0AGiven+two+line+segments+whose+lengths+are+%5C%28a%5C%29+and+%5C%28b%5C%29+respectively+there+is+a+%0Areal+number+%5C%28r%5C%29+such+that+%5C%28b%3Dra%5C%29.%0A%5Cend%7Blemma%7D%0A%5Cend%7Bdocument%7D)

Questo esempio produce il seguente output:

![OLV2TheoremsProofsEx2-updated.png](/files/8032d00437c434902aebb48528b42e48b99432ae)

Nel preambolo sono definiti tre nuovi ambienti.

**\newtheorem{theorem}{Teorema}\[section]**

Questo è l'esempio presentato nell'introduzione ma ha il parametro aggiuntivo \[section] che reimposta il contatore dei teoremi a ogni nuova sezione.

**\newtheorem{corollary}{Corollario}\[theorem]**

Viene creato un ambiente chiamato corollario, il contatore di questo nuovo ambiente verrà reimpostato ogni volta che viene usato un nuovo ambiente teorema.

**\newtheorem{lemma}\[theorem]{Lemma}**

In questo caso, anche se viene creato un nuovo ambiente chiamato lemma, esso userà lo stesso contatore dell'ambiente teorema.

Alcuni famosi teoremi hanno un proprio nome; in questi casi puoi aggiungere tale nome tra parentesi quadre nel comando di apertura dell'ambiente. Nell'esempio la riga `\begin{theorem}[Teorema di Pitagora]` stampa "Teorema di Pitagora" all'inizio del paragrafo.

Come per molti altri elementi numerati in LaTeX, il comando `\label` può essere usato per fare riferimento agli ambienti simili a teoremi all'interno del documento.

## Ambienti simili a teoremi senza numerazione

Può essere utile avere un ambiente simile a un teorema senza numerazione per aggiungere osservazioni, commenti o esempi a un documento matematico. Il `amsthm` pacchetto fornisce questa funzionalità.

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}

\newtheorem*{remark}{Osservazione}

\begin{document}
Sono possibili anche ambienti simili a teoremi senza numerazione.

\begin{remark}
Questa affermazione è vera, credo.
\end{remark}
\end{document}
```

[Apri questo esempio in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Unnumbered+theorem-like+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%0A%5Cnewtheorem%2A%7Bremark%7D%7BRemark%7D%0A%0A%5Cbegin%7Bdocument%7D%0AUnnumbered+theorem-like+environments+are+also+possible.%0A%0A%5Cbegin%7Bremark%7D%0AThis+statement+is+true%2C+I+guess.%0A%5Cend%7Bremark%7D%0A%5Cend%7Bdocument%7D)

Questo esempio produce il seguente output:

![OLV2heoremsProofsEx3.png](/files/78ba500ecf4ce1cac66394f0b6c844711ca88805)

La sintassi del comando `\newtheorem*` è la stessa della versione senza asterisco, tranne per i parametri del contatore. In questo esempio viene creato un nuovo ambiente senza numerazione chiamato `remark` viene creato.

## Stili dei teoremi

Una caratteristica importante quando si lavora in un documento matematico è distinguere facilmente, per esempio, le definizioni dai teoremi grazie alla loro formattazione. Il pacchetto `amsthm` fornisce comandi speciali per ottenere questo risultato.

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{definition}{Definizione}[section]

\theoremstyle{remark}
\newtheorem*{remark}{Osservazione}

\begin{document}
\section{Introduzione}
Sono possibili anche ambienti simili a teoremi senza numerazione.

\begin{remark}
Questa affermazione è vera, credo.
\end{remark}

E il prossimo è una definizione piuttosto informale

\begin{definition}[Fibrazione]
Una fibrazione è una mappatura tra due spazi topologici che possiede la proprietà di sollevamento dell'omotopia per ogni spazio \(X\).
\end{definition}
\end{document}
```

[Apri questo esempio in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=An+amsthm+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%0A%5Ctheoremstyle%7Bdefinition%7D%0A%5Cnewtheorem%7Bdefinition%7D%7BDefinition%7D%5Bsection%5D%0A%0A%5Ctheoremstyle%7Bremark%7D%0A%5Cnewtheorem%2A%7Bremark%7D%7BRemark%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0AUnnumbered+theorem-like+environments+are+also+possible.%0A%0A%5Cbegin%7Bremark%7D%0AThis+statement+is+true%2C+I+guess.%0A%5Cend%7Bremark%7D%0A%0AAnd+the+next+is+a+somewhat+informal+definition%0A%0A%5Cbegin%7Bdefinition%7D%5BFibration%5D%0AA+fibration+is+a+mapping+between+two+topological+spaces+that+has+the+homotopy+lifting+property+for+every+space+%5C%28X%5C%29.%0A%5Cend%7Bdefinition%7D%0A%5Cend%7Bdocument%7D)

Questo esempio produce il seguente output:

![OLV2TheoremsProofsEx4.png](/files/dc40aefe1b6d4e0e65d0513e0b84fb63b47b1711)

Il comando `\theoremstyle{ }` imposta lo stile per l'ambiente numerato definito subito sotto. Nell'esempio sopra gli stili *remark* e *definition* sono usati. Notare che l'osservazione è ora in corsivo e il testo nell'ambiente usa il carattere normale (romano), invece la definizione usa anch'essa il carattere romano per il testo al suo interno ma la parola "Definition" è stampata in grassetto.

Vedi il [guida di riferimento](#reference-guide) per altri stili dei teoremi.

## Dimostrazioni

Le dimostrazioni sono il cuore degli articoli e dei libri di matematica ed è consuetudine tenerle visivamente separate dal testo normale del documento. Il `amsthm` pacchetto fornisce l'ambiente `proof` per questo.

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}

\newtheorem{theorem}{Teorema}[section]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
\section{Introduzione}
\begin{lemma}
Date due segmenti di linea le cui lunghezze sono \(a\) e \(b\), rispettivamente, esiste
un numero reale \(r\) tale che \(b=ra\).
\end{lemma}

\begin{proof}
Per dimostrarlo per assurdo prova ad assumere che l'affermazione sia falsa,
procedi da lì e a un certo punto arriverai a una contraddizione.
\end{proof}
\end{document}
```

[Apri questo esempio in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+amsthm+proof+environment\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%5Bsection%5D%0A%5Cnewtheorem%7Blemma%7D%5Btheorem%5D%7BLemma%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0A%5Cbegin%7Blemma%7D%0AGiven+two+line+segments+whose+lengths+are+%5C%28a%5C%29+and+%5C%28b%5C%29+respectively+there+%0Ais+a+real+number+%5C%28r%5C%29+such+that+%5C%28b%3Dra%5C%29.%0A%5Cend%7Blemma%7D%0A%0A%5Cbegin%7Bproof%7D%0ATo+prove+it+by+contradiction+try+and+assume+that+the+statement+is+false%2C%0Aproceed+from+there+and+at+some+point+you+will+arrive+to+a+contradiction.%0A%5Cend%7Bproof%7D%0A%5Cend%7Bdocument%7D)

Questo esempio produce il seguente output:

![OLV2TheoremsProofsEx5.png](/files/e85da27d331cd98e39f5f250217dcbfe6d09a2d9)

La parola `Dimostrazione` è in corsivo e c'è un po' di spazio aggiuntivo; inoltre si usa un simbolo speciale per segnare la fine della dimostrazione. Questo simbolo può essere facilmente cambiato, per sapere come fare vedi la sezione successiva.

## Cambiare il simbolo QED

Il simbolo stampato alla fine di una dimostrazione è chiamato "simbolo QED". Per citare il [significato di QED](https://en.wikipedia.org/wiki/Q.E.D.) da Wikipedia:

> QED è un acronimo della frase latina *quod erat demonstrandum*, che significa "così è stato dimostrato"

È semplice usare un simbolo, o una dicitura, a tua scelta per rappresentare il simbolo QED. Il comando

```latex
\renewcommand\qedsymbol{$\blacksquare$}
```

può essere usato per sostituire il quadrato bianco predefinito con un quadrato nero stampato da `$\blacksquare$`, il parametro tra parentesi graffe. Oppure, puoi scrivere esplicitamente la parola QED:

```latex
\renewcommand\qedsymbol{QED}
```

Ecco un esempio per mostrare entrambe le opzioni:

```latex
\documentclass{article}

\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amssymb}

\newtheorem{theorem}{Teorema}[section]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
\section{Introduzione}

\begin{lemma}
Date due segmenti di linea le cui lunghezze sono \(a\) e \(b\), rispettivamente, esiste
un numero reale \(r\) tale che \(b=ra\).
\end{lemma}

\renewcommand\qedsymbol{$\blacksquare$}

\begin{proof}
Per dimostrarlo per assurdo prova ad assumere che l'affermazione sia falsa,
procedi da lì e a un certo punto arriverai a una contraddizione.
\end{proof}

\renewcommand\qedsymbol{QED}

\begin{proof}
Per dimostrarlo per assurdo prova ad assumere che l'affermazione sia falsa,
procedi da lì e a un certo punto arriverai a una contraddizione.
\end{proof}
\end{document}
```

[Apri questo esempio in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Changing+the+QED+symbol\&snip=%5Cdocumentclass%7Barticle%7D%0A%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%5Cusepackage%7Bamssymb%7D%0A%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%5Bsection%5D%0A%5Cnewtheorem%7Blemma%7D%5Btheorem%5D%7BLemma%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0A%0A%5Cbegin%7Blemma%7D%0AGiven+two+line+segments+whose+lengths+are+%5C%28a%5C%29+and+%5C%28b%5C%29+respectively+there+%0Ais+a+real+number+%5C%28r%5C%29+such+that+%5C%28b%3Dra%5C%29.%0A%5Cend%7Blemma%7D%0A%0A%5Crenewcommand%5Cqedsymbol%7B%24%5Cblacksquare%24%7D%0A%0A%5Cbegin%7Bproof%7D%0ATo+prove+it+by+contradiction+try+and+assume+that+the+statement+is+false%2C%0Aproceed+from+there+and+at+some+point+you+will+arrive+to+a+contradiction.%0A%5Cend%7Bproof%7D%0A%0A%5Crenewcommand%5Cqedsymbol%7BQED%7D%0A%0A%5Cbegin%7Bproof%7D%0ATo+prove+it+by+contradiction+try+and+assume+that+the+statement+is+false%2C%0Aproceed+from+there+and+at+some+point+you+will+arrive+to+a+contradiction.%0A%5Cend%7Bproof%7D%0A%5Cend%7Bdocument%7D)

Questo esempio produce il seguente output:

![OLV2TheoremsProofsEx6.png](/files/d7c9d3c8e0a05be63f67b149d842c033ae1e159c)

## Guida di riferimento

***Stili dei teoremi***

* `definition` titolo in grassetto, corpo in carattere romano. Usato comunemente in definizioni, condizioni, problemi ed esempi.
* `plain` titolo in grassetto, corpo in corsivo. Usato comunemente in teoremi, lemmi, corollari, proposizioni e congetture.
* `remark` titolo in corsivo, corpo in carattere romano. Usato comunemente in osservazioni, note, annotazioni, affermazioni, casi, ringraziamenti e conclusioni.

## Letture aggiuntive

Per ulteriori informazioni, vedi:

* [Espressioni matematiche](/latex/it/matematica/01-mathematical-expressions.md)
* [Ambienti](/latex/it/comandi/02-environments.md)
* [Stile display in modalità matematica](/latex/it/matematica/10-display-style-in-math-mode.md)
* [Elenco delle lettere greche e dei simboli matematici](/latex/it/matematica/11-list-of-greek-letters-and-math-symbols.md)
* [Caratteri matematici](/latex/it/matematica/12-mathematical-fonts.md)
* [Progetti LaTeX con più file](/latex/it/struttura-del-documento/08-multi-file-latex-projects.md)
* [Riferimenti incrociati a sezioni ed equazioni](/latex/it/struttura-del-documento/03-cross-referencing-sections-equations-and-floats.md)
* [Collegamenti ipertestuali](/latex/it/struttura-del-documento/09-hyperlinks.md)
* [La **amsthm** documentazione del pacchetto](http://www.ctan.org/pkg/amsthm)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/latex/it/specifico-per-argomento/01-theorems-and-proofs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
