> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/latex/ar/khas-balmjal/01-theorems-and-proofs.md).

# النظريات والبراهين

## مقدمة

تتضمن المستندات الرياضية عناصر تتطلب تنسيقًا وترقيمًا خاصين مثل النظريات والتعاريف والقضايا والملاحظات والنتائج واللمّات وما إلى ذلك. تشرح هذه المقالة كيفية تعريف هذه البيئات في LaTeX.

يمكن تعريف البيئات المرقمة في LaTeX بواسطة الأمر `\newtheorem` الذي يأخذ وسيطين:

```latex
\newtheorem{theorem}{نظرية}
```

* الأول هو اسم البيئة التي يتم تعريفها
* والثاني هو الكلمة التي ستُطبع، بخط عريض، في بداية البيئة.

بمجرد تعريف هذه البيئة الجديدة يمكن استخدامها بشكل طبيعي داخل المستند، وتحدها `\begin{theorem}` و `\end{theorem}`. ويُعرض مثال أدناه:

```latex
\documentclass{article}
\usepackage[english]{babel}
\newtheorem{theorem}{نظرية}
\begin{document}

\section{Introduction}
يمكن تعريف النظريات بسهولة:

\begin{theorem}
لتكن \(f\) دالةً يوجد مشتقها في كل نقطة، فإن \(f\)
دالة متصلة.
\end{theorem}
\end{document}
```

[افتح هذا المثال في 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)

ينتج هذا المثال المخرجات التالية:

![OLV2TheoremsProofsEx1.png](/files/557ac6334759129333ab95280116ed6ac982b4c8)

## النظريات والتعاريف والنتائج واللمّات المرقمة

يمكن التحكم في ترقيم البيئات بواسطة وسيطين إضافيين في `\newtheorem` الأمر. لنرَ:

```latex
\newtheorem{theorem}{نظرية}[section]
\newtheorem{corollary}{نتيجة}[theorem]
\newtheorem{lemma}[theorem]{لمّة}

\begin{document}
\section{Introduction}
يمكن تعريف النظريات بسهولة:

\begin{theorem}
لتكن \(f\) دالةً يوجد مشتقها في كل نقطة، فإن \(f\) هي
دالة متصلة.
\end{theorem}

\begin{theorem}[مبرهنة فيثاغورس]
\label{pythagorean}
هذه نظرية عن المثلثات القائمة ويمكن تلخيصها في المعادلة التالية
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}

وإن نتيجة المبرهنة \ref{pythagorean} هي العبارة في
النتيجة التالية.

\begin{corollary}
لا يوجد مستطيل قائم أضلاعه 3 سم و4 سم و6 سم.
\end{corollary}

يمكنك الإشارة إلى النظريات مثل \ref{pythagorean} عندما يُعيَّن وسم.

\begin{lemma}
إذا أُعطي مقطعان مستقيمان طولهما \(a\) و\(b\) على التوالي، فهناك
عدد حقيقي \(r\) بحيث \(b=ra\).
\end{lemma}
```

[افتح هذا المثال في 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)

ينتج هذا المثال المخرجات التالية:

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

توجد ثلاث بيئات جديدة مُعرَّفة في المقدمة.

**\newtheorem{theorem}{نظرية}\[section]**

هذا هو المثال المعروض في المقدمة لكنه يحتوي على الوسيط الإضافي \[section] الذي يعيد تعيين عدّاد النظرية عند كل قسم جديد.

**\newtheorem{corollary}{نتيجة}\[theorem]**

تُنشأ بيئة تُسمى corollary، وسيُعاد ضبط عدّاد هذه البيئة الجديدة كلما استُخدمت بيئة theorem جديدة.

**\newtheorem{lemma}\[theorem]{لمّة}**

في هذه الحالة، على الرغم من إنشاء بيئة جديدة تُسمى lemma، فإنها ستستخدم العداد نفسه الخاص ببيئة theorem.

لبعض النظريات الشهيرة أسماؤها الخاصة، وفي هذه الحالات يمكنك إضافة هذا الاسم داخل الأقواس في أمر فتح البيئة. في المثال السطر `\begin{theorem}[مبرهنة فيثاغورس]` يطبع "مبرهنة فيثاغورس" في بداية الفقرة.

كما هو الحال مع العديد من العناصر المرقمة الأخرى في LaTeX، يمكن استخدام الأمر `\label` للإشارة إلى البيئات الشبيهة بالنظريات داخل المستند.

## بيئات شبيهة بالنظريات غير مرقمة

قد يكون من المفيد وجود بيئة شبيهة بالنظريات غير مرقمة لإضافة ملاحظات أو تعليقات أو أمثلة إلى مستند رياضي. وتوفر حزمة `amsthm` هذه الوظيفة.

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

\newtheorem*{remark}{ملاحظة}

\begin{document}
البيئات الشبيهة بالنظريات غير المرقمة ممكنة أيضًا.

\begin{remark}
هذه العبارة صحيحة، على ما أظن.
\end{remark}
\end{document}
```

[افتح هذا المثال في 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)

ينتج هذا المثال المخرجات التالية:

![OLV2heoremsProofsEx3.png](/files/1290bd308e4ea0ade3bc7956488c6e13caf03c1e)

صياغة الأمر `\newtheorem*` هي نفسها كما في النسخة غير المعلَّمة بنجمة، باستثناء معاملات العداد. في هذا المثال تُنشأ بيئة جديدة غير مرقمة تُسمى `remark` يتم إنشاؤها.

## أنماط النظريات

من الميزات المهمة عند العمل على مستند رياضي القدرة على التمييز بسهولة، مثلًا، بين التعاريف والنظريات من خلال التنسيق. وتوفر الحزمة `amsthm` أوامر خاصة لتحقيق ذلك.

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

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

\theoremstyle{remark}
\newtheorem*{remark}{ملاحظة}

\begin{document}
\section{Introduction}
البيئات الشبيهة بالنظريات غير المرقمة ممكنة أيضًا.

\begin{remark}
هذه العبارة صحيحة، على ما أظن.
\end{remark}

والتعريف التالي غير رسمي بعض الشيء

\begin{definition}[التغليف]
التغليف هو تطبيق بين فضاءين طوبولوجيين له خاصية رفع التشاكل لكل فضاء \(X\).
\end{definition}
\end{document}
```

[افتح هذا المثال في 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)

ينتج هذا المثال المخرجات التالية:

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

الأمر `\theoremstyle{ }` يحدد نمط البيئة المرقمة المعرَّفة أسفله مباشرة. في المثال أعلاه تُستخدم الأنماط *remark* و *definition* المستخدمة. لاحظ أن remark أصبحت الآن بخط مائل، وأن النص في البيئة يستخدم الخط العادي (Roman)، أما definition فمن جهة أخرى فتستخدم أيضًا الخط العادي للنص داخلها، لكن كلمة "تعريف" تُطبع بخط عريض.

انظر [دليل المراجع](#reference-guide) لمزيد من أنماط النظريات.

## البراهين

البراهين هي جوهر الأوراق والكتب الرياضية، ومن المعتاد إبقاؤها منفصلة بصريًا عن النص العادي في المستند. وتوفر حزمة `amsthm` بيئة `proof` لذلك.

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

\newtheorem{theorem}{نظرية}[section]
\newtheorem{lemma}[theorem]{لمّة}

\begin{document}
\section{Introduction}
\begin{lemma}
إذا أُعطي مقطعان مستقيمان طولهما \(a\) و\(b\) على التوالي، فهناك
عدد حقيقي \(r\) بحيث \(b=ra\).
\end{lemma}

\begin{proof}
لإثباته بطريقة البرهان بالتناقض، حاول أن تفترض أن العبارة خاطئة،
ثم انطلق من هناك، وستصل في مرحلة ما إلى تناقض.
\end{proof}
\end{document}
```

[افتح هذا المثال في 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)

ينتج هذا المثال المخرجات التالية:

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

الكلمة `Proof` تُكتب بخط مائل ويوجد بعض التباعد الإضافي، كما يُستخدم رمز خاص للدلالة على نهاية البرهان. يمكن تغيير هذا الرمز بسهولة، وللتعرّف على كيفية ذلك انظر القسم التالي.

## تغيير رمز QED

الرمز المطبوع في نهاية البرهان يُسمّى "رمز QED". وللاقتباس من [معنى QED](https://en.wikipedia.org/wiki/Q.E.D.) من ويكيبيديا:

> QED هو اختصار لعبارة لاتينية *quod erat demonstrandum*، والتي تعني "وهكذا تم إثباته"

من السهل استخدام رمز، أو صياغة، من اختيارك لتمثيل رمز QED. ويمكن استخدام الأمر

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

لاستبدال المربع الأبيض الافتراضي بمربع أسود يطبعه `$\blacksquare$`، وهو المعامل داخل الأقواس. أو يمكنك كتابة كلمة QED صراحةً:

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

إليك مثالًا يوضح الخيارين كليهما:

```latex
\documentclass{article}

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

\newtheorem{theorem}{نظرية}[section]
\newtheorem{lemma}[theorem]{لمّة}

\begin{document}
\section{Introduction}

\begin{lemma}
إذا أُعطي مقطعان مستقيمان طولهما \(a\) و\(b\) على التوالي، فهناك
عدد حقيقي \(r\) بحيث \(b=ra\).
\end{lemma}

\renewcommand\qedsymbol{$\blacksquare$}

\begin{proof}
لإثباته بطريقة البرهان بالتناقض، حاول أن تفترض أن العبارة خاطئة،
ثم انطلق من هناك، وستصل في مرحلة ما إلى تناقض.
\end{proof}

\renewcommand\qedsymbol{QED}

\begin{proof}
لإثباته بطريقة البرهان بالتناقض، حاول أن تفترض أن العبارة خاطئة،
ثم انطلق من هناك، وستصل في مرحلة ما إلى تناقض.
\end{proof}
\end{document}
```

[افتح هذا المثال في 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)

ينتج هذا المثال المخرجات التالية:

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

## دليل المراجع

***أنماط النظريات***

* `definition` عنوان بخط عريض، ومتن بخط رومان. يُستخدم عادةً في التعاريف والشروط والمسائل والأمثلة.
* `plain` عنوان بخط عريض، ومتن مائل. يُستخدم عادةً في النظريات واللمّات والنتائج والقضايا والتخمينات.
* `remark` عنوان بخط مائل، ومتن رومان. يُستخدم عادةً في الملاحظات والتنبيهات والحواشي والادعاءات والحالات وعبارات الشكر والخلاصات.

## قراءة إضافية

لمزيد من المعلومات، انظر:

* [التعابير الرياضية](/latex/ar/alryadhyat/01-mathematical-expressions.md)
* [البيئات](/latex/ar/alawamr/02-environments.md)
* [النمط المعروض في وضع الرياضيات](/latex/ar/alryadhyat/10-display-style-in-math-mode.md)
* [قائمة الحروف اليونانية والرموز الرياضية](/latex/ar/alryadhyat/11-list-of-greek-letters-and-math-symbols.md)
* [الخطوط الرياضية](/latex/ar/alryadhyat/12-mathematical-fonts.md)
* [مشاريع LaTeX متعددة الملفات](/latex/ar/bnyh-almstnd/08-multi-file-latex-projects.md)
* [الإحالة المتبادلة بين الأقسام والمعادلات](/latex/ar/bnyh-almstnd/03-cross-referencing-sections-equations-and-floats.md)
* [الروابط التشعبية](/latex/ar/bnyh-almstnd/09-hyperlinks.md)
* [ال **amsthm** توثيق الحزمة](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://overleaf-pro.ayaka.space/latex/ar/khas-balmjal/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.
