Structural Induction
Jason Filippou
CMSC250 @ UMCP
07-05-2016
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 1 / 26
Structural Induction Jason Filippou CMSC250 @ UMCP 07-05-2016 - - PowerPoint PPT Presentation
Structural Induction Jason Filippou CMSC250 @ UMCP 07-05-2016 Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 1 / 26 Outline 1 Recursively defined structures 2 Proofs Binary Trees Sets Jason Filippou (CMSC250 @ UMCP)
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 1 / 26
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 2 / 26
Recursively defined structures
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 3 / 26
Recursively defined structures
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 4 / 26
Recursively defined structures
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 5 / 26
Proofs
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 6 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 7 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 8 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 9 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 10 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 11 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 11 / 26
Proofs Binary Trees
1
2
3
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 12 / 26
Proofs Binary Trees
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 13 / 26
Proofs Binary Trees
1 Prove P(·) for the base-case of the tree. Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 14 / 26
Proofs Binary Trees
1 Prove P(·) for the base-case of the tree.
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 14 / 26
Proofs Binary Trees
1 Prove P(·) for the base-case of the tree.
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 14 / 26
Proofs Binary Trees
1 Prove P(·) for the base-case of the tree.
2 Assume the inductive hypothesis for an arbitrary tree T, i.e
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 14 / 26
Proofs Binary Trees
1 Prove P(·) for the base-case of the tree.
2 Assume the inductive hypothesis for an arbitrary tree T, i.e
3 Use the inductive / recursive part of the tree’s definition to build a
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 14 / 26
Proofs Binary Trees
1 Prove P(·) for the base-case of the tree.
2 Assume the inductive hypothesis for an arbitrary tree T, i.e
3 Use the inductive / recursive part of the tree’s definition to build a
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 14 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 15 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
1 S1 is such that 3 ∈ S1 (base case) and if x, y ∈ S1, then x + y ∈ S1
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
1 S1 is such that 3 ∈ S1 (base case) and if x, y ∈ S1, then x + y ∈ S1
2 S2 is such that 2 ∈ S2 and if x ∈ S2, then x2 ∈ S2. Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
1 S1 is such that 3 ∈ S1 (base case) and if x, y ∈ S1, then x + y ∈ S1
2 S2 is such that 2 ∈ S2 and if x ∈ S2, then x2 ∈ S2. 3 S3 is such that 0 ∈ S3 and if y ∈ S3, then y + 1 ∈ S3. Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
1 S1 is such that 3 ∈ S1 (base case) and if x, y ∈ S1, then x + y ∈ S1
2 S2 is such that 2 ∈ S2 and if x ∈ S2, then x2 ∈ S2. 3 S3 is such that 0 ∈ S3 and if y ∈ S3, then y + 1 ∈ S3.
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
1 S1 is such that 3 ∈ S1 (base case) and if x, y ∈ S1, then x + y ∈ S1
2 S2 is such that 2 ∈ S2 and if x ∈ S2, then x2 ∈ S2. 3 S3 is such that 0 ∈ S3 and if y ∈ S3, then y + 1 ∈ S3.
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
1 S1 is such that 3 ∈ S1 (base case) and if x, y ∈ S1, then x + y ∈ S1
2 S2 is such that 2 ∈ S2 and if x ∈ S2, then x2 ∈ S2. 3 S3 is such that 0 ∈ S3 and if y ∈ S3, then y + 1 ∈ S3.
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 16 / 26
Proofs Sets
4
5
6
7
8
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 17 / 26
Proofs Sets
4
5
6
7
8
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 17 / 26
Proofs Sets
4
5
6
7
8
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 17 / 26
Proofs Sets
4
5
6
7
8
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 17 / 26
Proofs Sets
4
5
6
7
8
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 17 / 26
Proofs Sets
4
5
6
7
8
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 17 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 18 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 18 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 19 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 20 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 21 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 22 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 22 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 22 / 26
Proofs Sets
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 22 / 26
Proofs Sets
1
2
3
(Algebra)
aWe can do this, since A is parameterized by n. Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 23 / 26
Proofs Sets
1 Inductive base: By the base case of the definition of S, we have
2 Inductive hypothesis: Assume that x, y ∈ S are also contained
3 Inductive step: We must show that P(x + y), i.e x + y ∈ A,
z∈N
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 24 / 26
Proofs Sets
aσ1σ2 is the concatenation of σ1 and σ2. Concatenation can be applied
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 25 / 26
Proofs Sets
aσ1σ2 is the concatenation of σ1 and σ2. Concatenation can be applied
a|σ| is the number of characters in σ. Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 25 / 26
Proofs Sets
1 In the inductive base, prove P(·) for all the base elements of the
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 26 / 26
Proofs Sets
1 In the inductive base, prove P(·) for all the base elements of the
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 26 / 26
Proofs Sets
1 In the inductive base, prove P(·) for all the base elements of the
2 In the inductive hypothesis, assume ∃S : |S| ≥ n0 and P(S). Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 26 / 26
Proofs Sets
1 In the inductive base, prove P(·) for all the base elements of the
2 In the inductive hypothesis, assume ∃S : |S| ≥ n0 and P(S).
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 26 / 26
Proofs Sets
1 In the inductive base, prove P(·) for all the base elements of the
2 In the inductive hypothesis, assume ∃S : |S| ≥ n0 and P(S).
3 In the inductive step, use the recursive part of the definition of S
Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 26 / 26