Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. Theorem (13.15) “Injectivity of ▹”:
  2. xs ▹ x = ys ▹ y ≡ xs = ys ∧ x = y
  3. Proof:
  4. By induction on `xs : Seq A`:
  5. Base case:
  6. By induction on `ys : Seq A`:
  7. Base case:
  8. 𝜖 ▹ x = 𝜖 ▹ y
  9. ≡⟨ “Definition of ▹” ⟩
  10. x ◃ 𝜖 = y ◃ 𝜖
  11. ≡⟨ “Injectivity of ◃” ⟩
  12. 𝜖 = 𝜖 ∧ (x = y)
  13. Induction step:
  14. For any `z`:
  15. 𝜖 ▹ x = (z ◃ ys) ▹ y ≡ 𝜖 = z ◃ ys ∧ (x = y)
  16. ≡⟨ “Definition of ▹” ⟩
  17. x ◃ 𝜖 = z ◃ (ys ▹ y) ≡ 𝜖 = z ◃ ys ∧ (x = y)
  18. ≡⟨ “Injectivity of ◃” ⟩
  19. x = z ∧ 𝜖 = (ys ▹ y) ≡ 𝜖 = z ◃ ys ∧ (x = y)
  20. ≡⟨ “Snoc is not empty”, “Cons is not empty” ⟩
  21. x = z ∧ false ≡ false ∧ (x = y)
  22. ≡⟨ “Zero of ∧”, “Reflexivity of ≡” ⟩
  23. true
  24. Induction step:
  25. For any `w`:
  26. By induction on `ys : Seq A`:
  27. Base case:
  28. (w ◃ xs) ▹ x = 𝜖 ▹ y ≡ w ◃ xs = 𝜖 ∧ x = y
  29. ≡⟨ “Definition of ▹” ⟩
  30. w ◃ (xs ▹ x) = y ◃ 𝜖 ≡ w ◃ xs = 𝜖 ∧ x = y
  31. ≡⟨ “Injectivity of ◃” ⟩
  32. w = y ∧ (xs ▹ x) = 𝜖 ≡ w ◃ xs = 𝜖 ∧ x = y
  33. ≡⟨ “Snoc is not empty”, “Cons is not empty” ⟩
  34. w = y ∧ false ≡ false ∧ x = y
  35. ≡⟨ “Zero of ∧”, “Reflexivity of ≡” ⟩
  36. true
  37. Induction step:
  38. For any `z`:
  39. (w ◃ xs) ▹ x = (z ◃ ys) ▹ y ≡ (w ◃ xs) = (z ◃ ys) ∧ (x = y)
  40. ≡⟨ “Definition of ▹” ⟩
  41. w ◃ (xs ▹ x) = z ◃ (ys ▹ y) ≡ (w ◃ xs) = (z ◃ ys) ∧ (x = y)
  42. ≡⟨ “Injectivity of ◃” ⟩
  43. w = z ∧ (xs ▹ x) = (ys ▹ y) ≡ (w ◃ xs) = (z ◃ ys) ∧ (x = y)
  44. ≡⟨ Induction hypothesis `xs ▹ x = ys ▹ y ≡ xs = ys ∧ x = y` ⟩
  45. (w = z ∧ xs = ys) ∧ (x = y) ≡ (w ◃ xs) = (z ◃ ys) ∧ (x = y)
  46. ≡⟨ “Injectivity of ◃” ⟩
  47. (w ◃ xs = z ◃ ys) ∧ (x = y) ≡ (w ◃ xs) = (z ◃ ys) ∧ (x = y)
  48. ≡⟨ “Reflexivity of ≡” ⟩
  49. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement