Real numbers from Cauchy sequences #
This file defines ℝ
as the type of equivalence classes of Cauchy sequences of rational numbers.
This choice is motivated by how easy it is to prove that ℝ
is a commutative ring, by simply
lifting everything to ℚ
.
- cauchy : cau_seq.completion.Cauchy
The type ℝ
of real numbers constructed as equivalence classes of Cauchy sequences of rational
numbers.
The real numbers are isomorphic to the quotient of Cauchy sequences on the rationals.
Equations
- real.equiv_Cauchy = {to_fun := real.cauchy, inv_fun := real.of_cauchy, left_inv := real.equiv_Cauchy._proof_1, right_inv := real.equiv_Cauchy._proof_2}
Equations
- real.has_zero = {zero := zero}
Equations
- real.comm_ring = {add := has_add.add real.has_add, add_assoc := real.comm_ring._proof_1, zero := 0, zero_add := real.comm_ring._proof_2, add_zero := real.comm_ring._proof_3, nsmul := nsmul_rec {add := has_add.add real.has_add}, nsmul_zero' := real.comm_ring._proof_4, nsmul_succ' := real.comm_ring._proof_5, neg := has_neg.neg real.has_neg, sub := λ (a b : ℝ), a + -b, sub_eq_add_neg := real.comm_ring._proof_6, zsmul := zsmul_rec {neg := has_neg.neg real.has_neg}, zsmul_zero' := real.comm_ring._proof_7, zsmul_succ' := real.comm_ring._proof_8, zsmul_neg' := real.comm_ring._proof_9, add_left_neg := real.comm_ring._proof_10, add_comm := real.comm_ring._proof_11, mul := has_mul.mul real.has_mul, mul_assoc := real.comm_ring._proof_12, one := 1, one_mul := real.comm_ring._proof_13, mul_one := real.comm_ring._proof_14, npow := npow_rec {mul := has_mul.mul real.has_mul}, npow_zero' := real.comm_ring._proof_15, npow_succ' := real.comm_ring._proof_16, left_distrib := real.comm_ring._proof_17, right_distrib := real.comm_ring._proof_18, mul_comm := real.comm_ring._proof_19}
Extra instances to short-circuit type class resolution.
These short-circuits have an additional property of ensuring that a computable path is found; if
field ℝ
is found first, then decaying it to these typeclasses would result in a noncomputable
version of them.
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- real.inhabited = {default := 0}
The real numbers are a *
-ring, with the trivial *
-structure.
Equations
Coercion ℚ
→ ℝ
as a ring_hom
. Note that this
is cau_seq.completion.of_rat
, not rat.cast
.
Equations
- real.of_rat = {to_fun := real.of_cauchy ∘ cau_seq.completion.of_rat, map_one' := real.of_rat._proof_1, map_mul' := real.of_rat._proof_2, map_zero' := real.of_rat._proof_3, map_add' := real.of_rat._proof_4}
Equations
- real.partial_order = {le := has_le.le real.has_le, lt := has_lt.lt real.has_lt, le_refl := real.partial_order._proof_1, le_trans := real.partial_order._proof_2, lt_iff_le_not_le := real.partial_order._proof_3, le_antisymm := real.partial_order._proof_4}
Equations
Equations
- real.ordered_comm_ring = {add := comm_ring.add real.comm_ring, add_assoc := _, zero := comm_ring.zero real.comm_ring, zero_add := _, add_zero := _, nsmul := comm_ring.nsmul real.comm_ring, nsmul_zero' := _, nsmul_succ' := _, neg := comm_ring.neg real.comm_ring, sub := comm_ring.sub real.comm_ring, sub_eq_add_neg := _, zsmul := comm_ring.zsmul real.comm_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := comm_ring.mul real.comm_ring, mul_assoc := _, one := comm_ring.one real.comm_ring, one_mul := _, mul_one := _, npow := comm_ring.npow real.comm_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := partial_order.le real.partial_order, lt := partial_order.lt real.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := real.ordered_comm_ring._proof_1, zero_le_one := real.ordered_comm_ring._proof_2, mul_pos := real.mul_pos, mul_comm := _}
Equations
Equations
- real.linear_order = {le := partial_order.le real.partial_order, lt := partial_order.lt real.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_total := real.linear_order._proof_1, decidable_le := λ (a b : ℝ), classical.prop_decidable (a ≤ b), decidable_eq := decidable_eq_of_decidable_le (λ (a b : ℝ), classical.prop_decidable (a ≤ b)), decidable_lt := decidable_lt_of_decidable_le (λ (a b : ℝ), classical.prop_decidable (a ≤ b)), max := max_default (λ (a b : ℝ), classical.prop_decidable (a ≤ b)), max_def := real.linear_order._proof_2, min := min_default (λ (a b : ℝ), classical.prop_decidable (a ≤ b)), min_def := real.linear_order._proof_3}
Equations
- real.linear_ordered_comm_ring = {add := ordered_ring.add real.ordered_ring, add_assoc := _, zero := ordered_ring.zero real.ordered_ring, zero_add := _, add_zero := _, nsmul := ordered_ring.nsmul real.ordered_ring, nsmul_zero' := _, nsmul_succ' := _, neg := ordered_ring.neg real.ordered_ring, sub := ordered_ring.sub real.ordered_ring, sub_eq_add_neg := _, zsmul := ordered_ring.zsmul real.ordered_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ordered_ring.mul real.ordered_ring, mul_assoc := _, one := ordered_ring.one real.ordered_ring, one_mul := _, mul_one := _, npow := ordered_ring.npow real.ordered_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := ordered_ring.le real.ordered_ring, lt := ordered_ring.lt real.ordered_ring, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, le_total := _, decidable_le := linear_order.decidable_le real.linear_order, decidable_eq := linear_order.decidable_eq real.linear_order, decidable_lt := linear_order.decidable_lt real.linear_order, max := max real.linear_order, max_def := _, min := min real.linear_order, min_def := _, exists_pair_ne := _, mul_comm := _}
The real numbers are an ordered *
-ring, with the trivial *
-structure.
Equations
- real.star_ordered_ring = {to_star_ring := real.star_ring, star_mul_self_nonneg := real.star_ordered_ring._proof_1}
Equations
- real.has_inv = {inv := inv'}
Equations
- real.linear_ordered_field = {add := linear_ordered_comm_ring.add real.linear_ordered_comm_ring, add_assoc := _, zero := linear_ordered_comm_ring.zero real.linear_ordered_comm_ring, zero_add := _, add_zero := _, nsmul := linear_ordered_comm_ring.nsmul real.linear_ordered_comm_ring, nsmul_zero' := _, nsmul_succ' := _, neg := linear_ordered_comm_ring.neg real.linear_ordered_comm_ring, sub := linear_ordered_comm_ring.sub real.linear_ordered_comm_ring, sub_eq_add_neg := _, zsmul := linear_ordered_comm_ring.zsmul real.linear_ordered_comm_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := linear_ordered_comm_ring.mul real.linear_ordered_comm_ring, mul_assoc := _, one := linear_ordered_comm_ring.one real.linear_ordered_comm_ring, one_mul := _, mul_one := _, npow := linear_ordered_comm_ring.npow real.linear_ordered_comm_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := linear_ordered_comm_ring.le real.linear_ordered_comm_ring, lt := linear_ordered_comm_ring.lt real.linear_ordered_comm_ring, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, le_total := _, decidable_le := linear_ordered_comm_ring.decidable_le real.linear_ordered_comm_ring, decidable_eq := linear_ordered_comm_ring.decidable_eq real.linear_ordered_comm_ring, decidable_lt := linear_ordered_comm_ring.decidable_lt real.linear_ordered_comm_ring, max := linear_ordered_comm_ring.max real.linear_ordered_comm_ring, max_def := _, min := linear_ordered_comm_ring.min real.linear_ordered_comm_ring, min_def := _, exists_pair_ne := _, mul_comm := _, inv := has_inv.inv real.has_inv, div := field.div._default linear_ordered_comm_ring.mul linear_ordered_comm_ring.mul_assoc linear_ordered_comm_ring.one linear_ordered_comm_ring.one_mul linear_ordered_comm_ring.mul_one linear_ordered_comm_ring.npow linear_ordered_comm_ring.npow_zero' linear_ordered_comm_ring.npow_succ' has_inv.inv, div_eq_mul_inv := real.linear_ordered_field._proof_1, zpow := field.zpow._default linear_ordered_comm_ring.mul linear_ordered_comm_ring.mul_assoc linear_ordered_comm_ring.one linear_ordered_comm_ring.one_mul linear_ordered_comm_ring.mul_one linear_ordered_comm_ring.npow linear_ordered_comm_ring.npow_zero' linear_ordered_comm_ring.npow_succ' has_inv.inv, zpow_zero' := real.linear_ordered_field._proof_2, zpow_succ' := real.linear_ordered_field._proof_3, zpow_neg' := real.linear_ordered_field._proof_4, mul_inv_cancel := real.linear_ordered_field._proof_5, inv_zero := real.linear_ordered_field._proof_6}
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- a.decidable_lt b = has_lt.lt.decidable a b
Equations
- a.decidable_le b = has_le.le.decidable a b
Equations
- a.decidable_eq b = classical.prop_decidable (a = b)
Equations
Equations
- real.conditionally_complete_linear_order = {sup := lattice.sup real.lattice, le := linear_order.le real.linear_order, lt := linear_order.lt real.linear_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := lattice.inf real.lattice, inf_le_left := _, inf_le_right := _, le_inf := _, Sup := Sup real.has_Sup, Inf := Inf real.has_Inf, le_cSup := real.conditionally_complete_linear_order._proof_1, cSup_le := real.conditionally_complete_linear_order._proof_2, cInf_le := real.conditionally_complete_linear_order._proof_3, le_cInf := real.conditionally_complete_linear_order._proof_4, le_total := _, decidable_le := linear_order.decidable_le real.linear_order, decidable_eq := linear_order.decidable_eq real.linear_order, decidable_lt := linear_order.decidable_lt real.linear_order, max := max real.linear_order, max_def := _, min := min real.linear_order, min_def := _}