14.5. Rewriting other interval conventions
Only Set.Ioc is accepted directly. If a goal uses a closed interval
Set.Icc, separate the lower endpoint from the remaining half-open interval.
For a predicate φ the exact rewrites are:
-
∀ x ∈ Set.Icc a b, φ xbecomes(a ≤ b → φ a) ∧ ∀ x ∈ Set.Ioc a b, φ x. -
∃ x ∈ Set.Icc a b, φ xbecomesa ≤ b ∧ (φ a ∨ ∃ x ∈ Set.Ioc a b, φ x).
For an open interval Set.Ioo, exclude the upper endpoint from Set.Ioc:
-
∀ x ∈ Set.Ioo a b, φ xbecomes∀ x ∈ Set.Ioc a b, x ≠ b → φ x. -
∃ x ∈ Set.Ioo a b, φ xbecomes∃ x ∈ Set.Ioc a b, φ x ∧ x ≠ b.
After the endpoint proposition has been handled separately, rcf can prove
the remaining singly quantified part. This worked closed-interval example
checks the lower endpoint separately and sends the Set.Ioc tail to rcf:
example : ∀ x : ℝ,
x ∈ Set.Icc (0 : ℝ) 1 → x ^ 2 ≤ 1 := ⊢ ∀ x ∈ Set.Icc 0 1, x ^ 2 ≤ 1
endpoint:0 ^ 2 ≤ 1⊢ ∀ x ∈ Set.Icc 0 1, x ^ 2 ≤ 1
endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1⊢ ∀ x ∈ Set.Icc 0 1, x ^ 2 ≤ 1
endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1x:ℝhx:x ∈ Set.Icc 0 1⊢ x ^ 2 ≤ 1
endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1x:ℝhx:x ∈ Set.Icc 0 1h:0 = x⊢ x ^ 2 ≤ 1endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1x:ℝhx:x ∈ Set.Icc 0 1h:0 < x⊢ x ^ 2 ≤ 1
endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1x:ℝhx:x ∈ Set.Icc 0 1h:0 = x⊢ x ^ 2 ≤ 1 endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1hx:0 ∈ Set.Icc 0 1⊢ 0 ^ 2 ≤ 1
All goals completed! 🐙
endpoint:0 ^ 2 ≤ 1tail:∀ x ∈ Set.Ioc 0 1, x ^ 2 ≤ 1x:ℝhx:x ∈ Set.Icc 0 1h:0 < x⊢ x ^ 2 ≤ 1 All goals completed! 🐙
The open-interval rewrite is likewise accepted directly:
example : ∀ x : ℝ,
x ∈ Set.Ioc (0 : ℝ) 1 → x ≠ 1 → x < 1 := ⊢ ∀ x ∈ Set.Ioc 0 1, x ≠ 1 → x < 1
All goals completed! 🐙
example : ∃ x : ℝ,
x ∈ Set.Ioc (0 : ℝ) 1 ∧ x = 1 / 2 ∧ x ≠ 1 := ⊢ ∃ x ∈ Set.Ioc 0 1, x = 1 / 2 ∧ x ≠ 1
All goals completed! 🐙
When rcf sees Set.Icc or Set.Ioo directly, its error message includes
the corresponding rewrite above.