Fix up (ir)rational definition and point/line segment set definitions.
parent
6d03a9383a
commit
fcbd510dbe
|
@ -1,14 +1,14 @@
|
||||||
import Bookshelf.Real.Basic
|
import Bookshelf.Real.Basic
|
||||||
|
|
||||||
|
/--
|
||||||
|
Assert that a real number is irrational.
|
||||||
|
-/
|
||||||
|
def irrational (x : ℝ) := x ∉ Set.range RatCast.ratCast
|
||||||
|
|
||||||
/--
|
/--
|
||||||
Assert that a real number is rational.
|
Assert that a real number is rational.
|
||||||
|
|
||||||
Note this does *not* require the found rational to be in reduced form. Members
|
Note this does *not* require the found rational to be in reduced form. Members
|
||||||
of `ℚ` expect this (by proving the numerator and denominator are co-prime).
|
of `ℚ` expect this (by proving the numerator and denominator are co-prime).
|
||||||
-/
|
-/
|
||||||
def rational (x : ℝ) := ∃ a : ℤ, ∃ b : ℕ, b ≠ 0 ∧ x = a / b
|
def rational (x : ℝ) := ¬ irrational x
|
||||||
|
|
||||||
/--
|
|
||||||
Assert that a real number is irrational.
|
|
||||||
-/
|
|
||||||
def irrational (x : ℝ) := ¬ rational x
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ example (x y : ℝ) (h : x < y) : ∃ r : ℚ, x < r ∧ r < y := by
|
||||||
-- ========================================
|
-- ========================================
|
||||||
|
|
||||||
example (x : ℚ) (hx : x ≠ 0) (y : ℝ) (hy : irrational y)
|
example (x : ℚ) (hx : x ≠ 0) (y : ℝ) (hy : irrational y)
|
||||||
: irrational (x + y) := by
|
: irrational (x + y) :=
|
||||||
sorry
|
sorry
|
||||||
|
|
||||||
example (x : ℚ) (hx : x ≠ 0) (y : ℝ) (hy : irrational y)
|
example (x : ℚ) (hx : x ≠ 0) (y : ℝ) (hy : irrational y)
|
||||||
|
|
|
@ -70,8 +70,7 @@ namespace Point
|
||||||
/--
|
/--
|
||||||
A `Point` is the set consisting of just itself.
|
A `Point` is the set consisting of just itself.
|
||||||
-/
|
-/
|
||||||
def set_def (p : Point) : Set ℝ² :=
|
def set_def (p : Point) : Set ℝ² := p.val.set_def
|
||||||
{ x : ℝ² | x = p.val.top_left }
|
|
||||||
|
|
||||||
/--
|
/--
|
||||||
The width of a `Point` is `0`.
|
The width of a `Point` is `0`.
|
||||||
|
@ -106,8 +105,7 @@ namespace LineSegment
|
||||||
A `LineSegment` `s` is the set of points corresponding to the shortest line
|
A `LineSegment` `s` is the set of points corresponding to the shortest line
|
||||||
segment joining the two distinct points of `s`.
|
segment joining the two distinct points of `s`.
|
||||||
-/
|
-/
|
||||||
def set_def (s : LineSegment) : Set ℝ² :=
|
def set_def (s : LineSegment) : Set ℝ² := s.val.set_def
|
||||||
sorry
|
|
||||||
|
|
||||||
/--
|
/--
|
||||||
Either the width or height of a `LineSegment` is zero.
|
Either the width or height of a `LineSegment` is zero.
|
||||||
|
|
Loading…
Reference in New Issue