MathML HTML

Proof by Induction

This is example demonstrates how to write a proof by induction in MathML.

InductionProof.html

<!doctype html>
<html>
	<head>
		<title>XoaX.net's MathML: Induction Proof</title>
	</head>
	<body>
  	<p>We want to prove that <math><mi>P</mi><mtext>(</mtext><mi>n</mi><mtext>)</mtext><mo>=</mo>
  		<mn>1</mn><mo>+</mo><mn>2</mn><mo>+</mo><mn>3</mn><mo>+</mo><mi>&hellip;</mi><mo>+</mo><mtext>(</mtext><mi>n</mi><mo>-</mo><mn>1</mn><mtext>)</mtext><mo>+</mo><mi>n</mi>
  		<mo>=</mo>
			<mfrac>
				<mrow><mi>n</mi><mtext>(</mtext><mi>n</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mrow>
				<mn>2</mn>
			</mfrac></math>, for all <math><mi>n</mi><mo>&isin;</mo><mi>&#x2115;</mi></math>.</p>
		<p>We start by confirming the equation for the case <math><mi>n</mi><mo>=</mo><mn>1</mn></math>.<br />
			For <math><mi>P</mi><mtext>(</mtext><mn>1</mn><mtext>)</mtext></math>, we have 
			<math><mi>P</mi><mtext>(</mtext><mn>1</mn><mtext>)</mtext><mo>=</mo><mn>1</mn>
				<mo>=</mo><mfrac><mrow><mn>1</mn><mo>&times;</mo><mn>2</mn></mrow><mn>2</mn></mfrac></math></p>
		<p>Then assume the formula is true for the <math><mi>k</mi></math>th case:<br />
			That is, <math><mi>P</mi><mtext>(</mtext><mi>k</mi><mtext>)</mtext><mo>=</mo>
  		<mn>1</mn><mo>+</mo><mn>2</mn><mo>+</mo><mn>3</mn><mo>+</mo><mi>&hellip;</mi><mo>+</mo><mtext>(</mtext><mi>k</mi><mo>-</mo><mn>1</mn><mtext>)</mtext><mo>+</mo><mi>k</mi>
  		<mo>=</mo>
			<mfrac>
				<mrow><mi>k</mi><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mrow>
				<mn>2</mn>
			</mfrac></math></p>
		<p>For the <math><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></math>th case, we have<br />
			<math>
				<mtable>
					<mtr>
						<mtd><mi>P</mi><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mtd>
						<mtd><mo>=</mo></mtd>
						<mtd style="text-align: left;"><mn>1</mn><mo>+</mo><mn>2</mn><mo>+</mo><mn>3</mn><mo>+</mo><mi>&hellip;</mi><mo>+</mo><mtext>(</mtext><mi>k</mi><mo>-</mo><mn>1</mn><mtext>)</mtext><mo>+</mo><mi>k</mi><mo>+</mo><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mtd>
					</mtr>
					<mtr>
						<mtd></mtd>
						<mtd><mo>=</mo></mtd>
						<mtd style="text-align: left;"><mi>P</mi><mtext>(</mtext><mi>k</mi><mtext>)</mtext><mo>+</mo><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mtd>
					</mtr>
					<mtr>
						<mtd></mtd>
						<mtd><mo>=</mo></mtd>
						<mtd style="text-align: left;">
							<mfrac>
								<mrow><mi>k</mi><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mrow>
								<mn>2</mn>
							</mfrac>
							<mo>+</mo><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext>
						</mtd>
					</mtr>
					<mtr>
						<mtd></mtd>
						<mtd><mo>=</mo></mtd>
						<mtd style="text-align: left;">
							<mfrac>
								<mrow><mi>k</mi><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mrow>
								<mn>2</mn>
							</mfrac>
							<mo>+</mo>
							<mfrac>
								<mrow><mn>2</mn><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext></mrow>
								<mn>2</mn>
							</mfrac>
						</mtd>
					</mtr>
					<mtr>
						<mtd></mtd>
						<mtd><mo>=</mo></mtd>
						<mtd style="text-align: left;">
							<mfrac>
								<mrow><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>1</mn><mtext>)</mtext><mtext>(</mtext><mi>k</mi><mo>+</mo><mn>2</mn><mtext>)</mtext></mrow>
								<mn>2</mn>
							</mfrac>
						</mtd>
					</mtr>
				</mtable>
			</math></p>
  </body>
</html>
 

Output

 
 

© 2007–2025 XoaX.net LLC. All rights reserved.