Template:Proof: Difference between revisions

Inthar (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{Databox|{{{title|Proof}}}|{{{contents}}} {{qed}}}}[[Category:Articles with proofs]]</includeonly><noinclude>
<includeonly>{{Databox|{{{title|Proof}}}|{{trim|{{{contents}}}}} {{qed}}}}[[Category:Pages with proofs]]</includeonly><noinclude>
Box for proofs. This calls [[Template: Databox]] but it automatically:
{{documentation}}
* appends [[Template: Qed]] in the end of the contents;
* adds the article to [[:Category: Articles with proofs]].


You type:
<pre>
{{Proof|title=Proof that <math>\sqrt{2}</math> is irrational|
contents=Assume <math>\sqrt{2}</math> is ''p''/''q'', where ''p'', ''q'' ∈ ℤ<sub>>0</sub> and gcd(''p'', ''q'') = 1. Then ''p''<sup>2</sup>/''q''<sup>2</sup> = 2, and ''p''<sup>2</sup> = 2''q''<sup>2</sup>. Since ''p''<sup>2</sup> is even, and gcd(''p'', ''q'') = 1, gcd(''p''<sup>2</sup>, ''q''<sup>2</sup>) = 1, ''q''<sup>2</sup> must be odd. Hence ''p''<sup>2</sup> ≡ 2 (mod 4), which is impossible because the square of an integer must always be congruent to 0 or 1 (mod 4).
}}
</pre>
You get:
{{Databox|1=Proof that <math>\sqrt{2}</math> is irrational|
2=Assume <math>\sqrt{2}</math> is ''p''/''q'', where ''p'', ''q'' ∈ ℤ<sub>>0</sub> and gcd(''p'', ''q'') = 1. Then ''p''<sup>2</sup>/''q''<sup>2</sup> = 2, and ''p''<sup>2</sup> = 2''q''<sup>2</sup>. Since ''p''<sup>2</sup> is even, and gcd(''p'', ''q'') = 1, gcd(''p''<sup>2</sup>, ''q''<sup>2</sup>) = 1, ''q''<sup>2</sup> must be odd. Hence ''p''<sup>2</sup> ≡ 2 (mod 4), which is impossible because the square of an integer must always be congruent to 0 or 1 (mod 4). {{qed}}}}
Note: To include the character <code>|</code>, it must be escaped as <code><nowiki>{{!}}</nowiki></code>, unless it appears inside preformatted text (such as a <nowiki><syntaxhighlight></nowiki> or <nowiki><math></nowiki> tag).
== See also ==
* [[Template:Theorem]]
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>