Order for Rational Numbers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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
@[protected]
A rational number is called nonnegative if its numerator is nonnegative.
Instances for rat.nonneg
@[protected, instance]
@[protected, instance]
Equations
- rat.decidable_le a b = show decidable (b - a).nonneg, from (b - a).decidable_nonneg
@[protected, instance]
Equations
- rat.linear_order = {le := rat.le, lt := partial_order.lt._default rat.le, le_refl := rat.le_refl, le_trans := rat.le_trans, lt_iff_le_not_le := rat.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), max := max_default (λ (a b : ℚ), (b - a).decidable_nonneg), max_def := rat.linear_order._proof_3, min := min_default (λ (a b : ℚ), (b - a).decidable_nonneg), min_def := rat.linear_order._proof_4}
@[protected, instance]
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
- rat.linear_ordered_field = {add := field.add rat.field, add_assoc := _, zero := field.zero rat.field, zero_add := _, add_zero := _, nsmul := field.nsmul rat.field, nsmul_zero' := _, nsmul_succ' := _, neg := field.neg rat.field, sub := field.sub rat.field, sub_eq_add_neg := _, zsmul := field.zsmul rat.field, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := field.int_cast rat.field, nat_cast := field.nat_cast rat.field, one := field.one rat.field, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := field.mul rat.field, mul_assoc := _, one_mul := _, mul_one := _, npow := field.npow rat.field, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := linear_order.le rat.linear_order, lt := linear_order.lt rat.linear_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := rat.linear_ordered_field._proof_1, exists_pair_ne := _, zero_le_one := rat.linear_ordered_field._proof_2, mul_pos := rat.linear_ordered_field._proof_3, le_total := _, decidable_le := linear_order.decidable_le rat.linear_order, decidable_eq := linear_order.decidable_eq rat.linear_order, decidable_lt := linear_order.decidable_lt rat.linear_order, max := linear_order.max rat.linear_order, max_def := _, min := linear_order.min rat.linear_order, min_def := _, mul_comm := _, inv := field.inv rat.field, div := field.div rat.field, div_eq_mul_inv := _, zpow := field.zpow rat.field, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, rat_cast := field.rat_cast rat.field, mul_inv_cancel := _, inv_zero := _, rat_cast_mk := _, qsmul := field.qsmul rat.field, qsmul_eq_mul' := _}
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]