Order for Rational Numbers
Summary
We define the order on ℚ
, prove that ℚ
is a discrete, linearly ordered field, and define
functions such as abs
and sqrt
that depend on this order.
Notations
/.
is infix notation forrat.mk
.
Tags
rat, rationals, field, ℚ, numerator, denominator, num, denom, order, ordering, sqrt, abs
@[instance]
Equations
- a.decidable_nonneg = a.cases_on (λ (a_num : ℤ) (a_denom : ℕ) (a_pos : 0 < a_denom) (a_cop : a_num.nat_abs.coprime a_denom), _.mpr (0.decidable_le a_num))
@[instance]
Equations
- rat.decidable_le a b = show decidable (b - a).nonneg, from (b - a).decidable_nonneg
@[instance]
Equations
- rat.decidable_linear_order = {le := rat.le, lt := linear_order.lt._default rat.le, le_refl := rat.le_refl, le_trans := rat.le_trans, lt_iff_le_not_le := rat.decidable_linear_order._proof_1, le_antisymm := rat.le_antisymm, le_total := rat.le_total, decidable_le := λ (a b : ℚ), (b - a).decidable_nonneg, decidable_eq := λ (a b : ℚ), rat.decidable_eq a b, decidable_lt := decidable_lt_of_decidable_le (λ (a b : ℚ), (b - a).decidable_nonneg)}
@[instance]
@[instance]
Equations
@[instance]
Equations
@[instance]
Equations
@[instance]
Equations
@[instance]
Equations
@[instance]
@[instance]
Equations
@[instance]
Equations
@[instance]
Equations
- rat.discrete_linear_ordered_field = {add := field.add rat.field, add_assoc := _, zero := field.zero rat.field, zero_add := _, add_zero := _, neg := field.neg rat.field, add_left_neg := _, add_comm := _, mul := field.mul rat.field, mul_assoc := _, one := field.one rat.field, one_mul := _, mul_one := _, left_distrib := _, right_distrib := _, le := decidable_linear_order.le rat.decidable_linear_order, lt := decidable_linear_order.lt rat.decidable_linear_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := rat.discrete_linear_ordered_field._proof_1, exists_pair_ne := _, mul_pos := rat.discrete_linear_ordered_field._proof_2, le_total := _, zero_lt_one := rat.discrete_linear_ordered_field._proof_3, mul_comm := _, inv := field.inv rat.field, mul_inv_cancel := _, inv_zero := _, decidable_le := decidable_linear_order.decidable_le rat.decidable_linear_order, decidable_eq := decidable_linear_order.decidable_eq rat.decidable_linear_order, decidable_lt := decidable_linear_order.decidable_lt rat.decidable_linear_order}
@[instance]
@[instance]
@[instance]
@[instance]
@[instance]
@[instance]
@[instance]