hex

14.2. The four quantifier forms🔗

Quantification over the whole real line may be universal or existential. The body can combine equalities, inequalities, conjunctions, disjunctions, negations, and implications:

/-- A universal sentence over the real line. -/ example : x : , x ^ 2 1 x ^ 4 - x ^ 2 0 := (x : ), x ^ 2 1 x ^ 4 - x ^ 2 0 All goals completed! 🐙 /-- An existential sentence over the real line. -/ example : x : , x ^ 3 - x - 1 = 0 1 < x x < 2 := x, x ^ 3 - x - 1 = 0 1 < x x < 2 All goals completed! 🐙

The bounded forms use Set.Ioc a b, which denotes (a, b]. The lower endpoint is excluded and the upper endpoint is included:

/-- Universal quantification over `(0, 1]`. -/ example : x : , x Set.Ioc (0 : ) 1 x > 0 := x Set.Ioc 0 1, x > 0 All goals completed! 🐙 /-- Existential quantification over `(0, 1]`. The upper endpoint is a witness. -/ example : x : , x Set.Ioc (0 : ) 1 x = 1 := x Set.Ioc 0 1, x = 1 All goals completed! 🐙

An interval is empty when a ≥ b. Universal statements on an empty interval are true, while existential statements are false. These examples also show that the lower endpoint is not part of a nonempty interval:

example : x : , x Set.Ioc (1 : ) 1 x ^ 2 < 0 := x Set.Ioc 1 1, x ^ 2 < 0 All goals completed! 🐙 example : ¬ x : , x Set.Ioc (1 : ) 1 x = x := ¬ x Set.Ioc 1 1, x = x x:hx:x Set.Ioc 1 1right✝:x = xFalse All goals completed! 🐙 example : x : , x Set.Ioc (0 : ) 1 x 0 := x Set.Ioc 0 1, x 0 All goals completed! 🐙