Rectangular boxes in ℝⁿ
#
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
In this file we define rectangular boxes in ℝⁿ
. As usual, we represent ℝⁿ
as the type of
functions ι → ℝ
(usually ι = fin n
for some n
). When we need to interpret a box [l, u]
as a
set, we use the product {x | ∀ i, l i < x i ∧ x i ≤ u i}
of half-open intervals (l i, u i]
. We
exclude l i
because this way boxes of a partition are disjoint as sets in ℝⁿ
.
Currently, the only use cases for these constructions are the definitions of Riemann-style integrals (Riemann, Henstock-Kurzweil, McShane).
Main definitions #
We use the same structure box_integral.box
both for ambient boxes and for elements of a partition.
Each box is stored as two points lower upper : ι → ℝ
and a proof of ∀ i, lower i < upper i
. We
define instances has_mem (ι → ℝ) (box ι)
and has_coe_t (box ι) (set $ ι → ℝ)
so that each box is
interpreted as the set {x | ∀ i, x i ∈ set.Ioc (I.lower i) (I.upper i)}
. This way boxes of a
partition are pairwise disjoint and their union is exactly the original box.
We require boxes to be nonempty, because this way coercion to sets is injective. The empty box can
be represented as ⊥ : with_bot (box_integral.box ι)
.
We define the following operations on boxes:
- coercion to
set (ι → ℝ)
andhas_mem (ι → ℝ) (box_integral.box ι)
as described above; partial_order
andsemilattice_sup
instances such thatI ≤ J
is equivalent to(I : set (ι → ℝ)) ⊆ J
;lattice
instances onwith_bot (box_integral.box ι)
;box_integral.box.Icc
: the closed boxset.Icc I.lower I.upper
; defined as a bundled monotone map frombox ι
toset (ι → ℝ)
;box_integral.box.face I i : box (fin n)
: a hyperface ofI : box_integral.box (fin (n + 1))
;box_integral.box.distortion
: the maximal ratio of two lengths of edges of a box; defined as the supremum ofnndist I.lower I.upper / nndist (I.lower i) (I.upper i)
.
We also provide a convenience constructor box_integral.box.mk' (l u : ι → ℝ) : with_bot (box ι)
that returns the box ⟨l, u, _⟩
if it is nonempty and ⊥
otherwise.
Tags #
rectangular box
Rectangular box: definition and partial order #
A nontrivial rectangular box in ι → ℝ
with corners lower
and upper
. Repesents the product
of half-open intervals (lower i, upper i]
.
Instances for box_integral.box
- box_integral.box.has_sizeof_inst
- box_integral.box.inhabited
- box_integral.box.has_mem
- box_integral.box.set.has_coe_t
- box_integral.box.has_le
- box_integral.box.partial_order
- box_integral.box.has_sup
- box_integral.box.semilattice_sup
- box_integral.prepartition.has_mem
- box_integral.tagged_prepartition.has_mem
Equations
- box_integral.box.inhabited = {default := {lower := 0, upper := 1, lower_lt_upper := _}}
Equations
- box_integral.box.set.has_coe_t = {coe := λ (I : box_integral.box ι), {x : ι → ℝ | x ∈ I}}
Equations
- box_integral.box.partial_order = {le := has_le.le box_integral.box.has_le, lt := partial_order.lt (partial_order.lift coe box_integral.box.injective_coe), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _}
Closed box corresponding to I : box_integral.box ι
.
Equations
- box_integral.box.Icc = order_embedding.of_map_le_iff (λ (I : box_integral.box ι), set.Icc I.lower I.upper) box_integral.box.Icc._proof_1
Supremum of two boxes #
I ⊔ J
is the least box that includes both I
and J
. Since ↑I ∪ ↑J
is usually not a box,
↑(I ⊔ J)
is larger than ↑I ∪ ↑J
.
Equations
- box_integral.box.has_sup = {sup := λ (I J : box_integral.box ι), {lower := I.lower ⊓ J.lower, upper := I.upper ⊔ J.upper, lower_lt_upper := _}}
Equations
- box_integral.box.semilattice_sup = {sup := has_sup.sup box_integral.box.has_sup, le := partial_order.le box_integral.box.partial_order, lt := partial_order.lt box_integral.box.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _}
with_bot (box ι)
#
In this section we define coercion from with_bot (box ι)
to set (ι → ℝ)
by sending ⊥
to ∅
.
Equations
- box_integral.box.with_bot_coe = {coe := λ (o : with_bot (box_integral.box ι)), option.elim ∅ coe o}
Make a with_bot (box ι)
from a pair of corners l u : ι → ℝ
. If l i < u i
for all i
,
then the result is ⟨l, u, _⟩ : box ι
, otherwise it is ⊥
. In any case, the result interpreted
as a set in ι → ℝ
is the set {x : ι → ℝ | ∀ i, x i ∈ Ioc (l i) (u i)}
.
Equations
- box_integral.box.with_bot.has_inf = {inf := λ (I : with_bot (box_integral.box ι)), with_bot.rec_bot_coe (λ (J : with_bot (box_integral.box ι)), ⊥) (λ (I : box_integral.box ι) (J : with_bot (box_integral.box ι)), with_bot.rec_bot_coe ⊥ (λ (J : box_integral.box ι), box_integral.box.mk' (I.lower ⊔ J.lower) (I.upper ⊓ J.upper)) J) I}
Equations
- box_integral.box.with_bot.lattice = {sup := semilattice_sup.sup with_bot.semilattice_sup, le := semilattice_sup.le with_bot.semilattice_sup, lt := semilattice_sup.lt with_bot.semilattice_sup, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := has_inf.inf box_integral.box.with_bot.has_inf, inf_le_left := _, inf_le_right := _, le_inf := _}
Face of a box in ℝⁿ⁺¹ = fin (n + 1) → ℝ
: the box in ℝⁿ = fin n → ℝ
with corners at
I.lower ∘ fin.succ_above i
and I.upper ∘ fin.succ_above i
.
Equations
- I.face i = {lower := I.lower ∘ ⇑(i.succ_above), upper := I.upper ∘ ⇑(i.succ_above), lower_lt_upper := _}
Covering of the interior of a box by a monotone sequence of smaller boxes #
The interior of a box.
The distortion of a box I
is the maximum of the ratios of the lengths of its edges.
It is defined as the maximum of the ratios
nndist I.lower I.upper / nndist (I.lower i) (I.upper i)
.
Equations
- I.distortion = finset.univ.sup (λ (i : ι), has_nndist.nndist I.lower I.upper / has_nndist.nndist (I.lower i) (I.upper i))