21: Virtual Substitution & Real Arithmetic 15-424: Foundations - - PowerPoint PPT Presentation

21 virtual substitution real arithmetic
SMART_READER_LITE
LIVE PREVIEW

21: Virtual Substitution & Real Arithmetic 15-424: Foundations - - PowerPoint PPT Presentation

21: Virtual Substitution & Real Arithmetic 15-424: Foundations of Cyber-Physical Systems Andr e Platzer aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA 0.5 0.4 0.3 0.2 1.0 0.1 0.8 0.6


slide-1
SLIDE 1

21: Virtual Substitution & Real Arithmetic

15-424: Foundations of Cyber-Physical Systems Andr´ e Platzer

aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA

0.2 0.4 0.6 0.8 1.0

0.1 0.2 0.3 0.4 0.5

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 1 / 21

slide-2
SLIDE 2

Outline

1

Learning Objectives Recap: Quadratic Equations

2

Real Arithmetic Quadratic Weak Inequalities Virtual Substitution of Infinities Expedition: Infinities Quadratic Strict Inequalities Infinitesimals Virtual Substitution of Infinitesimals

3

Quantifier Elimination by Virtual Substitution

4

Summary

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 2 / 21

slide-3
SLIDE 3

Outline

1

Learning Objectives Recap: Quadratic Equations

2

Real Arithmetic Quadratic Weak Inequalities Virtual Substitution of Infinities Expedition: Infinities Quadratic Strict Inequalities Infinitesimals Virtual Substitution of Infinitesimals

3

Quantifier Elimination by Virtual Substitution

4

Summary

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 2 / 21

slide-4
SLIDE 4

Learning Objectives

Virtual Substitution & Real Equations

CT M&C CPS rigorous arithmetical reasoning miracle of quantifier elimination logical trinity for reals switch between syntax & semantics at will virtual substitution lemma bridge gap between semantics and inexpressibles analytic complexity modeling tradeoffs verifying CPS at scale

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 3 / 21

slide-5
SLIDE 5

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

Extended logic F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F (a+b√c)/d

¯ x

] ] where r = ([ [a] ]ω + [ [b] ]ω

  • [

[c] ]ω)/[ [d] ]ω ∈ R

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 4 / 21

slide-6
SLIDE 6

Outline

1

Learning Objectives Recap: Quadratic Equations

2

Real Arithmetic Quadratic Weak Inequalities Virtual Substitution of Infinities Expedition: Infinities Quadratic Strict Inequalities Infinitesimals Virtual Substitution of Infinitesimals

3

Quantifier Elimination by Virtual Substitution

4

Summary

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 4 / 21

slide-7
SLIDE 7

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

Extended logic F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F (a+b√c)/d

¯ x

] ] where r = ([ [a] ]ω + [ [b] ]ω

  • [

[c] ]ω)/[ [d] ]ω ∈ R

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 5 / 21

slide-8
SLIDE 8

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-9
SLIDE 9

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Andr´

e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-10
SLIDE 10

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ F small

¯ x

  • Andr´

e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-11
SLIDE 11

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ F −∞

¯ x

  • Andr´

e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-12
SLIDE 12

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ F −∞

¯ x

  • −∞ the rubber band number that’s smaller on any comparison

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-13
SLIDE 13

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • −∞ needs to satisfy the quadratic inequality (obvious for roots)

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-14
SLIDE 14

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • Lemma (Virtual Substitution Lemma for −∞)

F −∞

x

≡ F −∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-15
SLIDE 15

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • Lemma (Virtual Substitution Lemma for −∞)

Extended logic FOLR∪{−∞,∞} F −∞

x

≡ F −∞

¯ x

FOLR

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-16
SLIDE 16

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • . . .

Lemma (Virtual Substitution Lemma for −∞)

Extended logic FOLR∪{−∞,∞} F −∞

x

≡ F −∞

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F −∞

¯ x

] ] where r → −∞

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 6 / 21

slide-17
SLIDE 17

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

≡ (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

≡ (p = 0)−∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-18
SLIDE 18

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

≡ (p = 0)−∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-19
SLIDE 19

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ (p = 0)−∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-20
SLIDE 20

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • if

if

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-21
SLIDE 21

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

n

  • i=0

ai = 0

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • if

if

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-22
SLIDE 22

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

n

  • i=0

ai = 0

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • if deg(p)≤0

if

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-23
SLIDE 23

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

n

  • i=0

ai = 0

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • p < 0

if deg(p)≤0 if

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-24
SLIDE 24

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

n

  • i=0

ai = 0

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • p < 0

if deg(p)≤0 (−1)nan<0 if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-25
SLIDE 25

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

n

  • i=0

ai = 0

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • p < 0

if deg(p)≤0 (−1)nan<0 ∨

  • an=0 ∧

if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-26
SLIDE 26

Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p = 0)−∞

¯ x

n

  • i=0

ai = 0 (p ≤ 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

∨ (p = 0)−∞

¯ x

(p < 0)−∞

¯ x

≡ p(−∞)<0 (p = 0)−∞

¯ x

n

  • i=0

ai = 0

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • p < 0

if deg(p)≤0 (−1)nan<0 ∨

  • an=0 ∧ (n−1

i=0 aixi)(−∞)<0

  • if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 7 / 21

slide-27
SLIDE 27

Example: Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p < 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • p < 0

if deg(p)≤0 (−1)nan<0 ∨

  • an=0 ∧ (n−1

i=0 aixi)(−∞)<0

  • if deg(p)>0

(ax2 + bx + c ≤ 0)

−∞ ¯ x

≡ (−1)2a < 0 ∨ a = 0 ∧ ((−1)b < 0 ∨ b = 0 ∧ c < 0) ≡ a < 0 ∨ a = 0 ∧ (b > 0 ∨ b = 0 ∧ c < 0)

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 8 / 21

slide-28
SLIDE 28

Example: Virtual Substitution of Infinities

Virtual Substitution of −∞ into Comparisons p = n

i=0 aixi

(p < 0)−∞

¯ x

≡ (p < 0)−∞

¯ x

Ultimately negative at −∞ limx→−∞ p(x) < 0

p(−∞)<0

def

  • p < 0

if deg(p)≤0 (−1)nan<0 ∨

  • an=0 ∧ (n−1

i=0 aixi)(−∞)<0

  • if deg(p)>0

(ax2 + bx + c ≤ 0)

−∞ ¯ x

≡ (−1)2a < 0 ∨ a = 0 ∧ ((−1)b < 0 ∨ b = 0 ∧ c < 0) ≡ a < 0 ∨ a = 0 ∧ (b > 0 ∨ b = 0 ∧ c < 0) x −x2 + x + 1 −∞ x x + 1

2

−∞ x −1 −∞

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 8 / 21

slide-29
SLIDE 29

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c ≤ 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • . . .

Lemma (Virtual Substitution Lemma for −∞)

Extended logic FOLR∪{−∞,∞} F −∞

x

≡ F −∞

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F −∞

¯ x

] ] where r → −∞

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 9 / 21

slide-30
SLIDE 30

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ + x = −∞ + x = ∞ · x = ∞ · x = −∞ · x = −∞ · x = ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-31
SLIDE 31

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ −∞ + x = ∞ · x = ∞ · x = −∞ · x = −∞ · x = ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-32
SLIDE 32

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ −∞ + x = − ∞ ∞ · x = ∞ · x = −∞ · x = −∞ · x = ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-33
SLIDE 33

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ −∞ + x = − ∞ ∞ · x = ∞ for all x > 0 ∞ · x = −∞ · x = −∞ · x = ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-34
SLIDE 34

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ −∞ + x = − ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = −∞ · x = ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-35
SLIDE 35

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ −∞ + x = − ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = − ∞ for all x > 0 −∞ · x = ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-36
SLIDE 36

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ −∞ + x = − ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = − ∞ for all x > 0 −∞ · x = ∞ for all x < 0 ∞ − ∞ = 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-37
SLIDE 37

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ for all x = −∞ −∞ + x = − ∞ for all x = ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = − ∞ for all x > 0 −∞ · x = ∞ for all x < 0 ∞ − ∞ = undefined ∞ + (−∞) = ∞ + (−∞+1) = (∞ − ∞) + 1 0 · ∞ = ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-38
SLIDE 38

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ for all x = −∞ −∞ + x = − ∞ for all x = ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = − ∞ for all x > 0 −∞ · x = ∞ for all x < 0 ∞ − ∞ = undefined ∞ + (−∞) = ∞ + (−∞+1) = (∞ − ∞) + 1 0 · ∞ = undefined ±∞/ ± ∞ = 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-39
SLIDE 39

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ for all x = −∞ −∞ + x = − ∞ for all x = ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = − ∞ for all x > 0 −∞ · x = ∞ for all x < 0 ∞ − ∞ = undefined ∞ + (−∞) = ∞ + (−∞+1) = (∞ − ∞) + 1 0 · ∞ = undefined ±∞/ ± ∞ = undefined 1/0 =

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-40
SLIDE 40

Expedition: Infinite Challenges with Infinities

R ∪ {−∞, ∞} extended reals Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞ + 1? ∞ ≤ ∞ + x but ∞ + x ≤ ∞ ∞ + x = ∞ for all x = −∞ −∞ + x = − ∞ for all x = ∞ ∞ · x = ∞ for all x > 0 ∞ · x = − ∞ for all x < 0 −∞ · x = − ∞ for all x > 0 −∞ · x = ∞ for all x < 0 ∞ − ∞ = undefined ∞ + (−∞) = ∞ + (−∞+1) = (∞ − ∞) + 1 0 · ∞ = undefined ±∞/ ± ∞ = undefined 1/0 = undefined

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 10 / 21

slide-41
SLIDE 41

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

∃x (ax2 + bx + c < 0 ∧ F) ↔

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-42
SLIDE 42

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • Andr´

e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-43
SLIDE 43

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a)+ε ¯ x

∨ F (−b−

√ b2−4ac)/(2a)+ε ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • strict inequality can’t be satisfied at the roots but slightly off

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-44
SLIDE 44

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a)+ε ¯ x

∨ F (−b−

√ b2−4ac)/(2a)+ε ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • ε the rubber band number that’s smaller in magnitude on any comparison

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-45
SLIDE 45

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a)+ε ¯ x

∨ F (−b−

√ b2−4ac)/(2a)+ε ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • Lemma (Virtual Substitution Lemma for ε)

F e+ε

x

≡ F e+ε

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-46
SLIDE 46

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a)+ε ¯ x

∨ F (−b−

√ b2−4ac)/(2a)+ε ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • Lemma (Virtual Substitution Lemma for ε)

Nonstandard analysis FOLR[ε] F e+ε

x

≡ F e+ε

¯ x

FOLR

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-47
SLIDE 47

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a)+ε ¯ x

∨ F (−b−

√ b2−4ac)/(2a)+ε ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • . . .

Lemma (Virtual Substitution Lemma for ε)

Nonstandard analysis FOLR[ε] F e+ε

x

≡ F e+ε

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F −∞

¯ x

] ] where r ց e

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 11 / 21

slide-48
SLIDE 48

Expedition: Infinitesimals

ε in nonstandard field extension R[ε] is “always as small as needed” Positive: ε > 0 Smaller: ∀x ∈ R (x > 0 → ε < x) Standard R are Archimedean: ∀ ∀x ∈ R \ {0} ∃ ∃n ∈ N |x + x + · · · + x

  • n times

| > 1 R[ε] are non-Archimedean: ε + ε + · · · + ε

  • any n∈N times

< 1 Infinitesimals as inverses of infinities? ε · ∞ = 1? − ε · −∞ = 1? (ε + 1) · (∞ + 2

∞?

) = . . . How to order? ε2 ε x2 + ε (x + ε)2 x2 + 2εx + 5ε + ε2

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 12 / 21

slide-49
SLIDE 49

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

≡ (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

≡ (p = 0)−∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-50
SLIDE 50

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

≡ (p = 0)−∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-51
SLIDE 51

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p = 0)−∞

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-52
SLIDE 52

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • if

if

  • rdinary virtual substitution into immediate negativity

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-53
SLIDE 53

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • if

if

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-54
SLIDE 54

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • if deg(p)≤0

if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-55
SLIDE 55

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • p < 0

if deg(p)≤0 if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-56
SLIDE 56

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • p < 0

if deg(p)≤0 p < 0 if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-57
SLIDE 57

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • p < 0

if deg(p)≤0 p < 0 ∨ (p = 0 if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-58
SLIDE 58

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • p < 0

if deg(p)≤0 p < 0 ∨ (p = 0 ∧ (p′)+<0) if deg(p)>0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-59
SLIDE 59

Virtual Substitution of Infinitesimals

Virtual Substitution of e + ε into Comparisons p = n

i=0 aixi

(p = 0)e+ε

¯ x

n

  • i=0

ai = 0 (p ≤ 0)e+ε

¯ x

≡ (p < 0)e+ε

¯ x

∨ (p = 0)e+ε

¯ x

(p < 0)e+ε

¯ x

≡ (p+<0)e

¯ x

(p = 0)−∞

¯ x

n

  • i=0

ai = 0

Immediately negative at e limxցe p(x) < 0

p+<0

def

  • p < 0

if deg(p)≤0 p < 0 ∨ (p = 0 ∧ (p′)+<0) if deg(p)>0 Successive derivative p′ immediately negative at root of p to break ties

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 13 / 21

slide-60
SLIDE 60

Example: Virtual Substitution of Infinitesimals

(ax2+bx+c)

+<0 ≡ ax2+bx+c < 0

∨ ax2 + bx + c = 0 ∧ (2ax + b < 0 ∨ 2ax + b = 0 ∧ 2a<0) (ax2+bx+c<0)

(−b+ √ b2−4ac)/(2a)+ε ¯ x

≡ ((ax2+bx+c)

+<0) (−b+ √ b2−4ac)/(2a) ¯ x

≡ (ax2+bx+c<0 ∨ ax2+bx+c=0 ∧ (2ax+b<0 ∨ 2ax+b=0 ∧ 2a<0))

(−b+ √ b2−4 ¯ x

≡ 0 · 1<0 ∨ 0=0 ∧

  • (0<0 ∨ 4a2≤0 ∧ (0<0 ∨ −4a2(b2−4ac)<0)
  • (2ax+b<0)(−b+

b2−4ac)/(2a) ¯ x

) ∨ 0=0

  • (2ax+b=0)...

¯ x

∧ 2a1 < 0

(2a<0)...

¯ x

  • ≡ 4a2≤0 ∧ −4a2(b2−4ac)<0 ∨ 2a<0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 14 / 21

slide-61
SLIDE 61

Example: Virtual Substitution of Infinitesimals

(ax2+bx+c)

+<0 ≡ ax2+bx+c < 0

∨ ax2 + bx + c = 0 ∧ (2ax + b < 0 ∨ 2ax + b = 0 ∧ 2a<0) (ax2+bx+c<0)

(−b+ √ b2−4ac)/(2a)+ε ¯ x

≡ ((ax2+bx+c)

+<0) (−b+ √ b2−4ac)/(2a) ¯ x

≡ (ax2+bx+c<0 ∨ ax2+bx+c=0 ∧ (2ax+b<0 ∨ 2ax+b=0 ∧ 2a<0))

(−b+ √ b2−4 ¯ x

≡ 0 · 1<0 ∨ 0=0 ∧

  • (0<0 ∨ 4a2≤0 ∧ (0<0 ∨ −4a2(b2−4ac)<0)
  • (2ax+b<0)(−b+

b2−4ac)/(2a) ¯ x

) ∨ 0=0

  • (2ax+b=0)...

¯ x

∧ 2a1 < 0

(2a<0)...

¯ x

  • ≡ 4a2≤0 ∧ −4a2(b2−4ac)<0 ∨ 2a<0

≡ a = 0 ∧ 0(b2 − 0) < 0 ∨ 2a < 0 ≡ 2a < 0

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 14 / 21

slide-62
SLIDE 62

Example: Virtual Substitution of Infinitesimals

(ax2+bx+c)

+<0 ≡ ax2+bx+c < 0

∨ ax2 + bx + c = 0 ∧ (2ax + b < 0 ∨ 2ax + b = 0 ∧ 2a<0) (ax2+bx+c<0)

(−b+ √ b2−4ac)/(2a)+ε ¯ x

≡ ((ax2+bx+c)

+<0) (−b+ √ b2−4ac)/(2a) ¯ x

≡ ≡ a = 0 ∧ 0(b2 − 0) < 0 ∨ 2a < 0 ≡ 2a < 0 x case a < 0 −x2 + x + 1 x case a > 0 x2 − x − 1 x case a < 0 − 1

2x2 + x − 1 10

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 14 / 21

slide-63
SLIDE 63

Quadratic Strict Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c < 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a)+ε ¯ x

∨ F (−b−

√ b2−4ac)/(2a)+ε ¯ x

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯ x

∧ F −∞

¯ x

  • . . .

Lemma (Virtual Substitution Lemma for ε)

Nonstandard analysis FOLR[ε] F e+ε

x

≡ F e+ε

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F −∞

¯ x

] ] where r ց e

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 15 / 21

slide-64
SLIDE 64

Outline

1

Learning Objectives Recap: Quadratic Equations

2

Real Arithmetic Quadratic Weak Inequalities Virtual Substitution of Infinities Expedition: Infinities Quadratic Strict Inequalities Infinitesimals Virtual Substitution of Infinitesimals

3

Quantifier Elimination by Virtual Substitution

4

Summary

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 15 / 21

slide-65
SLIDE 65

Quantifier Elimination by Virtual Substitution

Theorem (Virtual Substitution: Quadratics) (Weispfenning’97)

Let all atomic formulas in F be of the form ax2 + bx + c ∼ 0 with x ∈ a, b, c and ∼ ∈ {=, ≤, <, =} and d def = b2 − 4ac.

∃x F ↔ F −∞

x

  • ax2+bx+c
  • ∈F
  • a=0∧b=0 ∧ F −c/b

x

∨ a=0∧d≥0 ∧ (F (−b+

√ d)/(2a) x

∨ F (−b−

√ d)/(2a) x

)

  • (ax2+bx+c{ <}0)∈F
  • a=0∧b=0∧F −c/b+ε

x

∨ a=0∧d≥0∧(F (−b+

√ d)/(2a)+ε x

∨F (−b−

√ d)/(2a)+ε x

)

  • Need roots and off-roots from all atomic formulas in F

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 16 / 21

slide-66
SLIDE 66

Quantifier Elimination by Virtual Substitution

Theorem (Virtual Substitution: Quadratics) (Weispfenning’97)

Let all atomic formulas in F be of the form ax2 + bx + c ∼ 0 with x ∈ a, b, c and ∼ ∈ {=, ≤, <, =} and d def = b2 − 4ac.

∃x F ↔ F −∞

x

  • ax2+bx+c

=

  • ∈F
  • a=0∧b=0 ∧ F −c/b

x

∨ a=0∧d≥0 ∧ (F (−b+

√ d)/(2a) x

∨ F (−b−

√ d)/(2a) x

)

  • (ax2+bx+c{ =

<}0)∈F

  • a=0∧b=0∧F −c/b+ε

x

∨ a=0∧d≥0∧(F (−b+

√ d)/(2a)+ε x

∨F (−b−

√ d)/(2a)+ε x

)

  • Need roots and off-roots from all atomic formulas in F

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 16 / 21

slide-67
SLIDE 67

Quantifier Elimination by Virtual Substitution

Theorem (Virtual Substitution: Quadratics) (Weispfenning’97)

Let all atomic formulas in F be of the form ax2 + bx + c ∼ 0 with x ∈ a, b, c and ∼ ∈ {=, ≤, <, =} and d def = b2 − 4ac.

∃x F ↔ F −∞

¯ x

  • ax2+bx+c

=

  • ∈F
  • a=0∧b=0 ∧ F −c/b

¯ x

∨ a=0∧d≥0 ∧ (F (−b+

√ d)/(2a) ¯ x

∨ F (−b−

√ d)/(2a) ¯ x

)

  • (ax2+bx+c{ =

<}0)∈F

  • a=0∧b=0∧F −c/b+ε

¯ x

∨ a=0∧d≥0∧(F (−b+

√ d)/(2a)+ε ¯ x

∨F (−b−

√ d)/(2a)+ε ¯ x

)

  • Need roots and off-roots from all atomic formulas in F

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 16 / 21

slide-68
SLIDE 68

Quantifier Elimination by Virtual Substitution

Theorem (Virtual Substitution: Quadratics) (Weispfenning’97)

Let all atomic formulas in F be of the form ax2 + bx + c ∼ 0 with x ∈ a, b, c and ∼ ∈ {=, ≤, <, =} and d def = b2 − 4ac.

∃x F ↔ F −∞

¯ x

  • ax2+bx+c

=

  • ∈F
  • a=0∧b=0 ∧ F −c/b

¯ x

∨ a=0∧d≥0 ∧ (F (−b+

√ d)/(2a) ¯ x

∨ F (−b−

√ d)/(2a) ¯ x

)

  • (ax2+bx+c{ =

<}0)∈F

  • a=0∧b=0∧F −c/b+ε

¯ x

∨ a=0∧d≥0∧(F (−b+

√ d)/(2a)+ε ¯ x

∨F (−b−

√ d)/(2a)+ε ¯ x

)

  • Lemma (Virtual Substitution Lemmas)

F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

F −∞

x

≡ F −∞

¯ x

F e+ε

x

≡ F e+ε

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 16 / 21

slide-69
SLIDE 69

Alternative Formulations

−∞ and roots e with offsets e + ε roots e with offsets e − ε and ∞ No rejection without mention Other parts of F not satisfied by the points of p have their own polynomial q that contributes different roots ˜ e and off-roots ˜ e + ε. Generalizations of quantifier elimination to higher degrees also place a representative point into every region of interest, but derivatives and relationships of derivatives become relevant.

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 17 / 21

slide-70
SLIDE 70

Quantifier Elimination by Virtual Substitution

Theorem (Virtual Substitution: Quadratics) (Weispfenning’97)

∃x F ↔ F −∞

¯ x

  • ax2+bx+c

=

  • ∈F
  • a=0∧b=0 ∧ F −c/b

¯ x

∨ a=0∧d≥0 ∧ (F (−b+

√ d)/(2a) ¯ x

∨ F (−b−

√ d)/(2a) ¯ x

)

  • (ax2+bx+c{ =

<}0)∈F

  • a=0∧b=0∧F −c/b+ε

¯ x

∨ a=0∧d≥0∧(F (−b+

√ d)/(2a)+ε ¯ x

∨F (−b−

√ d)/(2a)+ε ¯ x

)

  • “Proof” Sketch.

“←” simple from virtual substitution lemma with (extended) term witness “→” Valid iff true in every state, so all variables have real numeric value

  • -minimal: solutions form finite union of disjoint intervals (univariate)

WLOG endpoints are the roots since all polynomials quadratic All side conditions have to be met otherwise can’t be solution Non-point intervals contain ε offset since that’s smaller than endpoint

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 18 / 21

slide-71
SLIDE 71

Outline

1

Learning Objectives Recap: Quadratic Equations

2

Real Arithmetic Quadratic Weak Inequalities Virtual Substitution of Infinities Expedition: Infinities Quadratic Strict Inequalities Infinitesimals Virtual Substitution of Infinitesimals

3

Quantifier Elimination by Virtual Substitution

4

Summary

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 18 / 21

slide-72
SLIDE 72

Quadratic Virtual Substitution

Theorem (Virtual Substitution: Quadratic Equation x ∈ a, b, c)

a = 0 ∨ b = 0 ∨ c = 0 →

  • ∃x (ax2 + bx + c = 0 ∧ F) ↔

a = 0 ∧ b = 0 ∧ F −c/b

¯ x

∨ a = 0 ∧ b2 − 4ac ≥ 0 ∧

  • F (−b+

√ b2−4ac)/(2a) ¯ x

∨ F (−b−

√ b2−4ac)/(2a) ¯ x

  • Lemma (Virtual Substitution Lemma for √·)

Extended logic F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

FOLR ωr

x ∈ [

[F] ] iff ω ∈ [ [F (a+b√c)/d

¯ x

] ] where r = ([ [a] ]ω + [ [b] ]ω

  • [

[c] ]ω)/[ [d] ]ω ∈ R

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 19 / 21

slide-73
SLIDE 73

Quantifier Elimination by Virtual Substitution

Theorem (Virtual Substitution: Quadratics) (Weispfenning’97)

Let all atomic formulas in F be of the form ax2 + bx + c ∼ 0 with x ∈ a, b, c and ∼ ∈ {=, ≤, <, =} and d def = b2 − 4ac.

∃x F ↔ F −∞

¯ x

  • ax2+bx+c

=

  • ∈F
  • a=0∧b=0 ∧ F −c/b

¯ x

∨ a=0∧d≥0 ∧ (F (−b+

√ d)/(2a) ¯ x

∨ F (−b−

√ d)/(2a) ¯ x

)

  • (ax2+bx+c{ =

<}0)∈F

  • a=0∧b=0∧F −c/b+ε

¯ x

∨ a=0∧d≥0∧(F (−b+

√ d)/(2a)+ε ¯ x

∨F (−b−

√ d)/(2a)+ε ¯ x

)

  • Lemma (Virtual Substitution Lemmas)

F (a+b√c)/d

x

≡ F (a+b√c)/d

¯ x

F −∞

x

≡ F −∞

¯ x

F e+ε

x

≡ F e+ε

¯ x

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 20 / 21

slide-74
SLIDE 74

Summary

Miracle: FOLR is decidable: Tarski’31 (Complex) Algorithm says whether (closed) formula valid or not. Quantifier elimination effectively associates quantifier-free equivalent Successive quantifier elimination decides FOLR (universal closure) QE accepts free variables, giving equivalent that identifies the requirements for truth Virtual substitution does QE for degree ≤3 by equivalent syntactic rephrasing of semantics Weispfenning’97 QE proceeds inside out, so degree ≤3 needed on each iteration Important fragments permit many optimizations your research? Universally quantified weak inequalities / existentially quantified strict inequalities are easier since infinitesimals/infinities rarely satisfy = Cylindrical algebraic decomposition (CAD) any degree Collins’75 Simplify arithmetic to relevant parts, transform to fit together

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 21 / 21

slide-75
SLIDE 75

Andr´ e Platzer. Foundations of cyber-physical systems. Lecture Notes 15-424/624, Carnegie Mellon University, 2016. URL: http://www.cs.cmu.edu/~aplatzer/course/fcps16.html. Volker Weispfenning. Quantifier elimination for real algebra — the quadratic case and beyond.

  • Appl. Algebra Eng. Commun. Comput., 8(2):85–101, 1997.

Andr´ e Platzer. Logical Analysis of Hybrid Systems: Proving Theorems for Complex Dynamics. Springer, Heidelberg, 2010. doi:10.1007/978-3-642-14509-4. Saugata Basu, Richard Pollack, and Marie-Fran¸ coise Roy. Algorithms in Real Algebraic Geometry. Springer, 2nd edition, 2006. doi:10.1007/3-540-33099-2.

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 21 / 21

slide-76
SLIDE 76

Jacek Bochnak, Michel Coste, and Marie-Francoise Roy. Real Algebraic Geometry, volume 36 of Ergeb. Math. Grenzgeb. Springer, 1998. Alfred Tarski. A Decision Method for Elementary Algebra and Geometry. University of California Press, Berkeley, 2nd edition, 1951. George E. Collins. Hauptvortrag: Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In H. Barkhage, editor, Automata Theory and Formal Languages, volume 33 of LNCS, pages 134–183. Springer, 1975.

Andr´ e Platzer (CMU) FCPS / 21: Virtual Substitution & Real Arithmetic 21 / 21