Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - - PowerPoint PPT Presentation

logical foundations of cyber physical systems
SMART_READER_LITE
LIVE PREVIEW

Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - - PowerPoint PPT Presentation

21: Virtual Substitution & Real Arithmetic Logical Foundations of Cyber-Physical Systems Andr Platzer Logical Foundations of Cyber-Physical Systems Andr Platzer Andr Platzer (CMU) LFCPS/21: Virtual Substitution & Real


slide-1
SLIDE 1

21: Virtual Substitution & Real Arithmetic

Logical Foundations of Cyber-Physical Systems

Logical Foundations of Cyber-Physical Systems

André Platzer

André Platzer

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 1 / 22

slide-2
SLIDE 2

Outline

1

Learning Objectives

2

Real Arithmetic Recap: Quadratic Equations Quadratic Weak Inequalities Infinity ∞ Virtual Substitution Expedition: Infinities Quadratic Strict Inequalities Infinitesimal ε Virtual Substitution

3

Quantifier Elimination by Virtual Substitution of Quadratics

4

Summary

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 2 / 22

slide-3
SLIDE 3

Outline

1

Learning Objectives

2

Real Arithmetic Recap: Quadratic Equations Quadratic Weak Inequalities Infinity ∞ Virtual Substitution Expedition: Infinities Quadratic Strict Inequalities Infinitesimal ε Virtual Substitution

3

Quantifier Elimination by Virtual Substitution of Quadratics

4

Summary

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 2 / 22

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 infinities & infinitesimals analytic complexity modeling tradeoffs verifying CPS at scale

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 3 / 22

slide-5
SLIDE 5

Outline

1

Learning Objectives

2

Real Arithmetic Recap: Quadratic Equations Quadratic Weak Inequalities Infinity ∞ Virtual Substitution Expedition: Infinities Quadratic Strict Inequalities Infinitesimal ε Virtual Substitution

3

Quantifier Elimination by Virtual Substitution of Quadratics

4

Summary

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 3 / 22

slide-6
SLIDE 6

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 4 / 22

slide-7
SLIDE 7

Quadratic Inequality Virtual Substitution

Theorem (Virtual Substitution: Quadratic Inequality x ∈ a,b,c) ∃x (ax2 + bx + c ≤ 0∧ F) ↔

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

slide-8
SLIDE 8

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é Platzer (CMU)

LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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

  • ∨ F small

¯

x

  • ...

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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 −∞

¯

x

  • ...

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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

  • ...

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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

  • ∨ (ax2 + bx + c ≤ 0)

−∞ ¯

x

∧ F −∞

¯

x

  • ...

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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

  • ...

Lemma (Virtual Substitution Lemma for −∞)

F −∞

x

≡ F −∞

¯

x

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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 −∞)

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

x

≡ F −∞

¯

x

FOLR

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

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

ωr

x ∈ [

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

¯

x

] ] where r → −∞

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 5 / 22

slide-16
SLIDE 16

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

slide-17
SLIDE 17

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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

(p < 0)−∞

¯

x

≡ (p = 0)−∞

¯

x

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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 (p = 0)−∞

¯

x

≡ Ultimately negative at −∞

limx→−∞ p(x) < 0

p(-∞) < 0

def

  • if

if

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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

n

  • i=0

ai = 0

Ultimately negative at −∞

limx→−∞ p(x) < 0

p(-∞) < 0

def

  • if

if

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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 deg(p)≤0

if

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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

  • p < 0

if deg(p)≤0 if

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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

(−1)nan<0

if deg(p)>0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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∨

  • an=0∧

if deg(p)>0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

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∧(∑n−1

i=0 aixi)(-∞) < 0

  • if deg(p)>0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 6 / 22

slide-26
SLIDE 26

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 7 / 22

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)

x a < 0

−x2 + x + 1 −∞

x a = 0∧ b > 0 x + 1

2

−∞

x a = b = 0 > c

−1 −∞

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 7 / 22

slide-28
SLIDE 28

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 8 / 22

slide-29
SLIDE 29

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-30
SLIDE 30

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ x = ∞ −∞+ x = ∞· x = ∞· x = −∞· x = −∞· x = ∞−∞ =

0·∞ =

±∞/±∞ =

1/0 =

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-31
SLIDE 31

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ x = ∞ −∞+ x = −∞ ∞· x = ∞· x = −∞· x = −∞· x = ∞−∞ =

0·∞ =

±∞/±∞ =

1/0 =

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-32
SLIDE 32

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ x = ∞ −∞+ x = −∞ ∞· x = ∞

for all x > 0

∞· x = −∞· x = −∞· x = ∞−∞ =

0·∞ =

±∞/±∞ =

1/0 =

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-33
SLIDE 33

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ x = ∞ −∞+ x = −∞ ∞· x = ∞

for all x > 0

∞· x = −∞

for all x < 0

−∞· x = −∞· x = ∞−∞ =

0·∞ =

±∞/±∞ =

1/0 =

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-34
SLIDE 34

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ x = ∞ −∞+ x = −∞ ∞· x = ∞

for all x > 0

∞· x = −∞

for all x < 0

−∞· x = −∞

for all x > 0

−∞· x = ∞−∞ =

0·∞ =

±∞/±∞ =

1/0 =

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-35
SLIDE 35

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ 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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-36
SLIDE 36

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ 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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-37
SLIDE 37

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ 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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-38
SLIDE 38

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ 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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-39
SLIDE 39

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ 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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

slide-40
SLIDE 40

Expedition: Infinite Challenges with Infinities R∪{−∞,∞}

Order: ∀x (−∞ ≤ x ≤ ∞) Complete lattice since every subset has a supremum and infimum Arithmetic? ∞+ 1? ∞ ≤ ∞+ 1 but ∞+ 1 ≤ ∞ by order

∞+ 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 Virtual Substitution Infinities only needed virtually during virtual substitution, never explicitly.

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 9 / 22

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

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é Platzer (CMU)

LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

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 never true at the roots but slightly off

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

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 e+ε

¯

x

] ] where r ց e

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 10 / 22

slide-48
SLIDE 48

Expedition: Infinitesimal Nonstandard Field Ext. 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 for x = 0?

ε2 ε

x2 +ε

(x +ε)2

x2 + 2εx + 5ε +ε2

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 11 / 22

slide-49
SLIDE 49

Expedition: Infinitesimal Nonstandard Field Ext. 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 for x = 0?

ε2 < ε < x2 +ε < (x +ε)2 < x2 + 2εx + 5ε +ε2

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 11 / 22

slide-50
SLIDE 50

Expedition: Infinitesimal Nonstandard Field Ext. 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 for x = 0?

ε2 < ε < x2 +ε < (x +ε)2 < x2 + 2εx + 5ε +ε2

Virtual Substitution Infinitesimals only needed virtually dur- ing virtual substitution, never explicitly.

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 11 / 22

slide-51
SLIDE 51

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)e+ε

¯

x

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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)e+ε

¯

x

≡ Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • if

if

  • rdinary virtual √· substitution of e into immediate negativity p+ < 0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • if

if

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • if deg(p)≤0

if deg(p)>0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • p < 0

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • p < 0

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • p < 0

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

slide-60
SLIDE 60

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • p < 0

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

slide-61
SLIDE 61

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)e+ε

¯

x

n

  • i=0

ai = 0

Immediately negative at x

limyցx p(y) < 0

p+ < 0

def

  • p < 0

if deg(p)≤0 p < 0∨(p = 0∧(p′)+ < 0) if deg(p)>0 Break ties by successive derivative p′ immediately negative at root of p

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 12 / 22

slide-62
SLIDE 62

Example: Virtual Substitution of Infinitesimals

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

(ax2+bx+c)

+ < 0 ≡ ax2+bx+c < 0

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

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 13 / 22

slide-63
SLIDE 63

Example: Virtual Substitution of Infinitesimals

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

(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−4ac)/(2a)

¯

x

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 13 / 22

slide-64
SLIDE 64

Example: Virtual Substitution of Infinitesimals

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

(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−4ac)/(2a)

¯

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 13 / 22

slide-65
SLIDE 65

Example: Virtual Substitution of Infinitesimals

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

(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 a < 0

−x2 + x + 1

x a > 0 x2 − x − 1 x a < 0

− 1

2x2 + x − 1 10

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 13 / 22

slide-66
SLIDE 66

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 e+ε

¯

x

] ] where r ց e

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 14 / 22

slide-67
SLIDE 67

Outline

1

Learning Objectives

2

Real Arithmetic Recap: Quadratic Equations Quadratic Weak Inequalities Infinity ∞ Virtual Substitution Expedition: Infinities Quadratic Strict Inequalities Infinitesimal ε Virtual Substitution

3

Quantifier Elimination by Virtual Substitution of Quadratics

4

Summary

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 14 / 22

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 its discriminant d

def

= b2 − 4ac.

∃x F ↔

F−∞

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

)

  • (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

)

  • Equivalence needs roots and off-roots from all atomic formulas in F

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 15 / 22

slide-69
SLIDE 69

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 its discriminant d

def

= b2 − 4ac.

∃x F ↔

F−∞

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

)

  • (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

)

  • Equivalence needs roots and off-roots from all atomic formulas in F

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 15 / 22

slide-70
SLIDE 70

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 its discriminant d

def

= b2 − 4ac.

∃x F ↔

F−∞

¯

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

)

  • (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

)

  • Equivalence needs roots and off-roots from all atomic formulas in F

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 15 / 22

slide-71
SLIDE 71

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 its discriminant d

def

= b2 − 4ac.

∃x F ↔

F−∞

¯

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

)

  • (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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 15 / 22

slide-72
SLIDE 72

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 crucially relevant.

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 16 / 22

slide-73
SLIDE 73

Quantifier Elimination by Virtual Substitution

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

∃x F ↔ F−∞

¯

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

)

  • (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 smaller than endpoint

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 17 / 22

slide-74
SLIDE 74

Example: Nonnegative Roots of Quadratic Polynomials

a = 0 →

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

↔ b2 − 4ac ≥ 0∧(2ba ≤ 0∧ 4ac ≥ 0∨−2a ≤ 0∧ 4ac ≤ 0 ∨2ba ≤ 0∧ 4ac ≥ 0∨ 2a ≤ 0∧ 4ac ≤ 0)

  • −(−b +
  • b2−4ac)/(2a) = ((−1+ 0
  • b2−4ac)/1)·((−b +
  • b2−4ac)/(2a)

= (b −

  • b2−4ac)/(2a)

(−x ≤ 0)(b−

b2−4ac)/(2a)

¯

x

≡ b2a≤0∧ b2−(−1)2(b2−4ac)≥0∨−1· 2a≤0∧ b2−(−1)2(b2−4ac)≤0 ≡ 2ba ≤ 0∧ 4ac ≥ 0∨−2a ≤ 0∧ 4ac ≤ 0 (−x ≤ 0)(b+

b2−4ac)/(2a)

¯

x

≡ b2a ≤ 0∧ b2 − 12(b2 − 4ac) ≥ 0∨ 1· 2a ≤ 0∧ b2 − 12(b2 − 4ac) ≤ 0 ≡ 2ba ≤ 0∧ 4ac ≥ 0∨ 2a ≤ 0∧ 4ac ≤ 0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 18 / 22

slide-75
SLIDE 75

Example: Nonnegative Roots of Quadratic Polynomials

∃x (x2 − x + c = 0∧ x ≥ 0) ↔ (−1)2 − 4c ≥ 0∧(c ≥ 0∨ c ≤ 0 ∨c ≥ 0∨ false ∧ c ≤ 0)

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 19 / 22

slide-76
SLIDE 76

Example: Nonnegative Roots of Quadratic Polynomials

∃x (x2−x+c = 0∧ x ≥ 0) ↔1− 4c ≥ 0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 19 / 22

slide-77
SLIDE 77

Example: Nonnegative Roots

∃x (x2−x+c = 0∧ x ≥ 0) ↔1− 4c ≥ 0 ∃x (x2−x+c ≤ 0∧ x ≥ 0) ↔(x2−x+c ≤ 0∧ x ≥ 0)

−∞ ¯

x

  • false

∨1− 4c ≥ 0∨(x2−x+c ≤ 0∧ x ≥ 0)0

¯

x

  • c≤0∧0≥0 (subsumed)

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 19 / 22

slide-78
SLIDE 78

Example: Nonnegative Roots

∃x (x2−x+c = 0∧ x ≥ 0) ↔1− 4c ≥ 0 ∃x (x2−x+c ≤ 0∧ x ≥ 0) ↔(x2−x+c ≤ 0∧ x ≥ 0)

−∞ ¯

x

  • false

∨1− 4c ≥ 0∨(x2−x+c ≤ 0∧ x ≥ 0)0

¯

x

  • c≤0∧0≥0 (subsumed)

∃x (x2 − x + c ≤ 0∧ x ≥ 0∧−x + 2 = 0)

more roots!

↔(x2−x+c ≤ 0∧...)

−∞ ¯

x

  • false

∨ 1− 4c ≥ 0∧(x2−x+c ≤ 0∧ x ≥ 0∧−x + 2 = 0)(−1±√

1−4c)/2

¯

x

  • 8−4c=0

∨−1 = 0∧(x2−x+c ≤ 0∧ x ≥ 0∧−x + 2 = 0)0

x

  • c≤0∧0≥0∧2=0

∨−1 = 0∧(x2−x+c ≤ 0∧ x ≥ 0∧−x + 2 = 0)2

x

  • 2+c≤0

≡ 2+ c ≤ 0

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 19 / 22

slide-79
SLIDE 79

Outline

1

Learning Objectives

2

Real Arithmetic Recap: Quadratic Equations Quadratic Weak Inequalities Infinity ∞ Virtual Substitution Expedition: Infinities Quadratic Strict Inequalities Infinitesimal ε Virtual Substitution

3

Quantifier Elimination by Virtual Substitution of Quadratics

4

Summary

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 19 / 22

slide-80
SLIDE 80

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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 20 / 22

slide-81
SLIDE 81

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 its discriminant d

def

= b2 − 4ac.

∃x F ↔

F−∞

¯

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

)

  • (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é Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 21 / 22

slide-82
SLIDE 82

Summary

Miracle: FOLR is decidable: Tarski’31 Algorithm decides whether (closed) formula valid or not Quantifier elimination computes quantifier-free equivalent Successive quantifier elimination decides FOLR (after universal closure)

QE accepts free variables, giving equivalent that identifies the

requirements for truth (synthesis) 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 don’t satisfy = Cylindrical algebraic decomposition (CAD) any degree Collins’75 Simplify arithmetic to relevant parts, transform to fit together

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 22 / 22

slide-83
SLIDE 83

André Platzer. Logical Foundations of Cyber-Physical Systems. Springer, Switzerland, 2018. URL: http://www.springer.com/978-3-319-63587-3,

doi:10.1007/978-3-319-63588-0.

Volker Weispfenning. Quantifier elimination for real algebra — the quadratic case and beyond.

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

doi:10.1007/s002000050055.

André Platzer. Logical Analysis of Hybrid Systems: Proving Theorems for Complex Dynamics. Springer, Heidelberg, 2010.

doi:10.1007/978-3-642-14509-4.

Jacek Bochnak, Michel Coste, and Marie-Francoise Roy. Real Algebraic Geometry, volume 36 of Ergeb. Math. Grenzgeb. Springer, Berlin, 1998.

doi:10.1007/978-3-662-03718-8.

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 22 / 22

slide-84
SLIDE 84

Saugata Basu, Richard Pollack, and Marie-Françoise Roy. Algorithms in Real Algebraic Geometry. Springer, Berlin, 2nd edition, 2006.

doi:10.1007/3-540-33099-2.

Alfred Tarski. A Decision Method for Elementary Algebra and Geometry. University of California Press, Berkeley, 2nd edition, 1951.

doi:10.1007/978-3-7091-9459-1_3.

George E. Collins. 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, Berlin, 1975. Springer.

doi:10.1007/3-540-07407-4_17.

George E. Collins and Hoon Hong. Partial cylindrical algebraic decomposition for quantifier elimination.

  • J. Symb. Comput., 12(3):299–328, 1991.

doi:10.1016/S0747-7171(08)80152-6.

André Platzer (CMU) LFCPS/21: Virtual Substitution & Real Arithmetic LFCPS/21 22 / 22