# mathlib3documentation

analysis.box_integral.box.basic

# 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 (ι → ℝ) and has_mem (ι → ℝ) (box_integral.box ι) as described above;
• partial_order and semilattice_sup instances such that I ≤ J is equivalent to (I : set (ι → ℝ)) ⊆ J;
• lattice instances on with_bot (box_integral.box ι);
• box_integral.box.Icc: the closed box set.Icc I.lower I.upper; defined as a bundled monotone map from box ι to set (ι → ℝ);
• box_integral.box.face I i : box (fin n): a hyperface of I : 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 of nndist 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 #

structure box_integral.box (ι : Type u_2) :
Type u_2

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
@[protected, instance]
def box_integral.box.inhabited {ι : Type u_1} :
Equations
theorem box_integral.box.lower_ne_upper {ι : Type u_1} (I : box_integral.box ι) (i : ι) :
I.lower i I.upper i
@[protected, instance]
def box_integral.box.has_mem {ι : Type u_1} :
Equations
@[protected, instance]
def box_integral.box.set.has_coe_t {ι : Type u_1} :
(set ))
Equations
@[simp]
theorem box_integral.box.mem_mk {ι : Type u_1} {l u x : ι } {H : (i : ι), l i < u i} :
x {lower := l, upper := u, lower_lt_upper := H} (i : ι), x i set.Ioc (l i) (u i)
@[simp, norm_cast]
theorem box_integral.box.mem_coe {ι : Type u_1} (I : box_integral.box ι) {x : ι } :
x I x I
theorem box_integral.box.mem_def {ι : Type u_1} (I : box_integral.box ι) {x : ι } :
x I (i : ι), x i set.Ioc (I.lower i) (I.upper i)
theorem box_integral.box.mem_univ_Ioc {ι : Type u_1} {x : ι } {I : box_integral.box ι} :
x set.univ.pi (λ (i : ι), set.Ioc (I.lower i) (I.upper i)) x I
theorem box_integral.box.coe_eq_pi {ι : Type u_1} (I : box_integral.box ι) :
I = set.univ.pi (λ (i : ι), set.Ioc (I.lower i) (I.upper i))
@[simp]
theorem box_integral.box.upper_mem {ι : Type u_1} (I : box_integral.box ι) :
theorem box_integral.box.exists_mem {ι : Type u_1} (I : box_integral.box ι) :
(x : ι ), x I
@[simp]
theorem box_integral.box.coe_ne_empty {ι : Type u_1} (I : box_integral.box ι) :
@[simp]
theorem box_integral.box.empty_ne_coe {ι : Type u_1} (I : box_integral.box ι) :
@[protected, instance]
def box_integral.box.has_le {ι : Type u_1} :
Equations
theorem box_integral.box.le_def {ι : Type u_1} (I J : box_integral.box ι) :
I J (x : ι ), x I x J
theorem box_integral.box.le_tfae {ι : Type u_1} (I J : box_integral.box ι) :
@[simp, norm_cast]
theorem box_integral.box.coe_subset_coe {ι : Type u_1} {I J : box_integral.box ι} :
I J I J
@[simp, norm_cast]
theorem box_integral.box.coe_inj {ι : Type u_1} {I J : box_integral.box ι} :
I = J I = J
@[ext]
theorem box_integral.box.ext {ι : Type u_1} {I J : box_integral.box ι} (H : (x : ι ), x I x J) :
I = J
theorem box_integral.box.ne_of_disjoint_coe {ι : Type u_1} {I J : box_integral.box ι} (h : J) :
I J
@[protected, instance]
Equations
@[protected]
def box_integral.box.Icc {ι : Type u_1} :
↪o set )

Closed box corresponding to I : box_integral.box ι.

Equations
theorem box_integral.box.Icc_def {ι : Type u_1} {I : box_integral.box ι} :
@[simp]
theorem box_integral.box.upper_mem_Icc {ι : Type u_1} (I : box_integral.box ι) :
@[simp]
theorem box_integral.box.lower_mem_Icc {ι : Type u_1} (I : box_integral.box ι) :
@[protected]
theorem box_integral.box.is_compact_Icc {ι : Type u_1} (I : box_integral.box ι) :
theorem box_integral.box.Icc_eq_pi {ι : Type u_1} {I : box_integral.box ι} :
= set.univ.pi (λ (i : ι), set.Icc (I.lower i) (I.upper i))
theorem box_integral.box.le_iff_Icc {ι : Type u_1} {I J : box_integral.box ι} :
theorem box_integral.box.antitone_lower {ι : Type u_1} :
antitone (λ (I : , I.lower)
theorem box_integral.box.monotone_upper {ι : Type u_1} :
monotone (λ (I : , I.upper)

### Supremum of two boxes #

@[protected, instance]
def box_integral.box.has_sup {ι : Type u_1} :

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
@[protected, instance]
Equations

### with_bot (box ι)#

In this section we define coercion from with_bot (box ι) to set (ι → ℝ) by sending ⊥ to ∅.

@[protected, instance]
def box_integral.box.with_bot_coe {ι : Type u_1} :
(set ))
Equations
@[simp, norm_cast]
theorem box_integral.box.coe_bot {ι : Type u_1} :
@[simp, norm_cast]
theorem box_integral.box.coe_coe {ι : Type u_1} {I : box_integral.box ι} :
theorem box_integral.box.is_some_iff {ι : Type u_1} {I : with_bot } :
theorem box_integral.box.bUnion_coe_eq_coe {ι : Type u_1} (I : with_bot ) :
( (J : (hJ : J = I), J) = I
@[simp, norm_cast]
theorem box_integral.box.with_bot_coe_subset_iff {ι : Type u_1} {I J : with_bot } :
I J I J
@[simp, norm_cast]
theorem box_integral.box.with_bot_coe_inj {ι : Type u_1} {I J : with_bot } :
I = J I = J
noncomputable def box_integral.box.mk' {ι : Type u_1} (l u : ι ) :

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
@[simp]
theorem box_integral.box.mk'_eq_bot {ι : Type u_1} {l u : ι } :
(i : ι), u i l i
@[simp]
theorem box_integral.box.mk'_eq_coe {ι : Type u_1} {I : box_integral.box ι} {l u : ι } :
l = I.lower u = I.upper
@[simp]
theorem box_integral.box.coe_mk' {ι : Type u_1} (l u : ι ) :
u) = set.univ.pi (λ (i : ι), set.Ioc (l i) (u i))
@[protected, instance]
noncomputable def box_integral.box.with_bot.has_inf {ι : Type u_1} :
Equations
@[simp]
theorem box_integral.box.coe_inf {ι : Type u_1} (I J : with_bot ) :
(I J) = I J
@[protected, instance]
noncomputable def box_integral.box.with_bot.lattice {ι : Type u_1} :
Equations
@[simp, norm_cast]
theorem box_integral.box.disjoint_with_bot_coe {ι : Type u_1} {I J : with_bot } :
J J
theorem box_integral.box.disjoint_coe {ι : Type u_1} {I J : box_integral.box ι} :

### Hyperface of a box in ℝⁿ⁺¹ = fin (n + 1) → ℝ#

def box_integral.box.face {n : } (I : box_integral.box (fin (n + 1))) (i : fin (n + 1)) :

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
@[simp]
theorem box_integral.box.face_upper {n : } (I : box_integral.box (fin (n + 1))) (i : fin (n + 1)) (ᾰ : fin n) :
(I.face i).upper = I.upper ((i.succ_above) ᾰ)
@[simp]
theorem box_integral.box.face_lower {n : } (I : box_integral.box (fin (n + 1))) (i : fin (n + 1)) (ᾰ : fin n) :
(I.face i).lower = I.lower ((i.succ_above) ᾰ)
@[simp]
theorem box_integral.box.face_mk {n : } (l u : fin (n + 1) ) (h : (i : fin (n + 1)), l i < u i) (i : fin (n + 1)) :
theorem box_integral.box.face_mono {n : } {I J : box_integral.box (fin (n + 1))} (h : I J) (i : fin (n + 1)) :
I.face i J.face i
theorem box_integral.box.monotone_face {n : } (i : fin (n + 1)) :
monotone (λ (I : box_integral.box (fin (n + 1))), I.face i)
theorem box_integral.box.maps_to_insert_nth_face_Icc {n : } (I : box_integral.box (fin (n + 1))) {i : fin (n + 1)} {x : } (hx : x set.Icc (I.lower i) (I.upper i)) :
theorem box_integral.box.maps_to_insert_nth_face {n : } (I : box_integral.box (fin (n + 1))) {i : fin (n + 1)} {x : } (hx : x set.Ioc (I.lower i) (I.upper i)) :
theorem box_integral.box.continuous_on_face_Icc {X : Type u_1} {n : } {f : (fin (n + 1) ) X} {I : box_integral.box (fin (n + 1))} (h : ) {i : fin (n + 1)} {x : } (hx : x set.Icc (I.lower i) (I.upper i)) :

### Covering of the interior of a box by a monotone sequence of smaller boxes #

@[protected]
def box_integral.box.Ioo {ι : Type u_1} :
→o set )

The interior of a box.

Equations
@[protected]
theorem box_integral.box.Ioo_subset_Icc {ι : Type u_1} (I : box_integral.box ι) :
theorem box_integral.box.Union_Ioo_of_tendsto {ι : Type u_1} [finite ι] {I : box_integral.box ι} {J : } (hJ : monotone J) (hl : (nhds I.lower)) (hu : (nhds I.upper)) :
theorem box_integral.box.exists_seq_mono_tendsto {ι : Type u_1} (I : box_integral.box ι) :
(J : , ( (n : ),
noncomputable def box_integral.box.distortion {ι : Type u_1} [fintype ι] (I : box_integral.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
theorem box_integral.box.distortion_eq_of_sub_eq_div {ι : Type u_1} [fintype ι] {I J : box_integral.box ι} {r : } (h : (i : ι), I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
theorem box_integral.box.dist_le_distortion_mul {ι : Type u_1} [fintype ι] (I : box_integral.box ι) (i : ι) :
(I.distortion) * (I.upper i - I.lower i)
theorem box_integral.box.diam_Icc_le_of_distortion_le {ι : Type u_1} [fintype ι] (I : box_integral.box ι) (i : ι) {c : nnreal} (h : I.distortion c) :
c * (I.upper i - I.lower i)