l3lab/ntp-mathlib huggingface dataset:
@[simp, norm_cast]
theorem withBotCoe_inj {I J : WithBot (Box ι)} : (I : Set (ι → ℝ)) = J ↔ I = J := by
  

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
I J : WithBot (Box ι)
⊢ ↑I = ↑J ↔ I = J

Next tactic:
simp only [Subset.antisymm_iff, ← le_antisymm_iff, withBotCoe_subset_iff]
@[simp]
theorem mk'_eq_bot {l u : ι → ℝ} : mk' l u = ⊥ ↔ ∃ i, u i ≤ l i := by
  

Proof state:
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
⊢ mk' l u = ⊥ ↔ ∃ i, u i ≤ l i

Next tactic:
rw [mk']
@[simp]
theorem mk'_eq_bot {l u : ι → ℝ} : mk' l u = ⊥ ↔ ∃ i, u i ≤ l i := by
  rw [mk']
  

Proof state:
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
⊢ (if h : ∀ (i : ι), l i < u i then ↑{ lower := l, upper := u, lower_lt_upper := h } else ⊥) = ⊥ ↔ ∃ i, u i ≤ l i

Next tactic:
split_ifs with h
@[simp]
theorem mk'_eq_bot {l u : ι → ℝ} : mk' l u = ⊥ ↔ ∃ i, u i ≤ l i := by
  rw [mk']
  split_ifs with h <;> 

Proof state:
case pos
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
h : ∀ (i : ι), l i < u i
⊢ ↑{ lower := l, upper := u, lower_lt_upper := h } = ⊥ ↔ ∃ i, u i ≤ l i

Next tactic:
simpa using h
@[simp]
theorem mk'_eq_bot {l u : ι → ℝ} : mk' l u = ⊥ ↔ ∃ i, u i ≤ l i := by
  rw [mk']
  split_ifs with h <;> 

Proof state:
case neg
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
h : ¬∀ (i : ι), l i < u i
⊢ ⊥ = ⊥ ↔ ∃ i, u i ≤ l i

Next tactic:
simpa using h
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  

Proof state:
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
⊢ mk' l u = ↑I ↔ l = I.lower ∧ u = I.upper

Next tactic:
cases' I with lI uI hI
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; 

Proof state:
case mk
ι : Type u_1
J : Box ι
x y l u lI uI : ι → ℝ
hI : ∀ (i : ι), lI i < uI i
⊢ mk' l u = ↑{ lower := lI, upper := uI, lower_lt_upper := hI } ↔
    l = { lower := lI, upper := uI, lower_lt_upper := hI }.lower ∧
      u = { lower := lI, upper := uI, lower_lt_upper := hI }.upper

Next tactic:
rw [mk']
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; rw [mk']; 

Proof state:
case mk
ι : Type u_1
J : Box ι
x y l u lI uI : ι → ℝ
hI : ∀ (i : ι), lI i < uI i
⊢ (if h : ∀ (i : ι), l i < u i then ↑{ lower := l, upper := u, lower_lt_upper := h } else ⊥) =
      ↑{ lower := lI, upper := uI, lower_lt_upper := hI } ↔
    l = { lower := lI, upper := uI, lower_lt_upper := hI }.lower ∧
      u = { lower := lI, upper := uI, lower_lt_upper := hI }.upper

Next tactic:
split_ifs with h
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; rw [mk']; split_ifs with h
  · 

Proof state:
case pos
ι : Type u_1
J : Box ι
x y l u lI uI : ι → ℝ
hI : ∀ (i : ι), lI i < uI i
h : ∀ (i : ι), l i < u i
⊢ ↑{ lower := l, upper := u, lower_lt_upper := h } = ↑{ lower := lI, upper := uI, lower_lt_upper := hI } ↔
    l = { lower := lI, upper := uI, lower_lt_upper := hI }.lower ∧
      u = { lower := lI, upper := uI, lower_lt_upper := hI }.upper

Next tactic:
simp [WithBot.coe_eq_coe]
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; rw [mk']; split_ifs with h
  · simp [WithBot.coe_eq_coe]
  · 

Proof state:
case neg
ι : Type u_1
J : Box ι
x y l u lI uI : ι → ℝ
hI : ∀ (i : ι), lI i < uI i
h : ¬∀ (i : ι), l i < u i
⊢ ⊥ = ↑{ lower := lI, upper := uI, lower_lt_upper := hI } ↔
    l = { lower := lI, upper := uI, lower_lt_upper := hI }.lower ∧
      u = { lower := lI, upper := uI, lower_lt_upper := hI }.upper

Next tactic:
suffices l = lI → u ≠ uI by simpa
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; rw [mk']; split_ifs with h
  · simp [WithBot.coe_eq_coe]
  · suffices l = lI → u ≠ uI by 

Proof state:
ι : Type u_1
J : Box ι
x y l u lI uI : ι → ℝ
hI : ∀ (i : ι), lI i < uI i
h : ¬∀ (i : ι), l i < u i
this : l = lI → u ≠ uI
⊢ ⊥ = ↑{ lower := lI, upper := uI, lower_lt_upper := hI } ↔
    l = { lower := lI, upper := uI, lower_lt_upper := hI }.lower ∧
      u = { lower := lI, upper := uI, lower_lt_upper := hI }.upper

Next tactic:
simpa
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; rw [mk']; split_ifs with h
  · simp [WithBot.coe_eq_coe]
  · suffices l = lI → u ≠ uI by simpa
    

Proof state:
case neg
ι : Type u_1
J : Box ι
x y l u lI uI : ι → ℝ
hI : ∀ (i : ι), lI i < uI i
h : ¬∀ (i : ι), l i < u i
⊢ l = lI → u ≠ uI

Next tactic:
rintro rfl rfl
@[simp]
theorem mk'_eq_coe {l u : ι → ℝ} : mk' l u = I ↔ l = I.lower ∧ u = I.upper := by
  cases' I with lI uI hI; rw [mk']; split_ifs with h
  · simp [WithBot.coe_eq_coe]
  · suffices l = lI → u ≠ uI by simpa
    rintro rfl rfl
    

Proof state:
case neg
ι : Type u_1
J : Box ι
x y l u : ι → ℝ
h : ¬∀ (i : ι), l i < u i
hI : ∀ (i : ι), l i < u i
⊢ False

Next tactic:
exact h hI
@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i) := by
  

Proof state:
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
⊢ ↑(mk' l u) = Set.pi univ fun i => Ioc (l i) (u i)

Next tactic:
rw [mk']
@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i) := by
  rw [mk']; 

Proof state:
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
⊢ ↑(if h : ∀ (i : ι), l i < u i then ↑{ lower := l, upper := u, lower_lt_upper := h } else ⊥) =
    Set.pi univ fun i => Ioc (l i) (u i)

Next tactic:
split_ifs with h
@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i) := by
  rw [mk']; split_ifs with h
  · 

Proof state:
case pos
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
h : ∀ (i : ι), l i < u i
⊢ ↑↑{ lower := l, upper := u, lower_lt_upper := h } = Set.pi univ fun i => Ioc (l i) (u i)

Next tactic:
exact coe_eq_pi _
@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i) := by
  rw [mk']; split_ifs with h
  · exact coe_eq_pi _
  · 

Proof state:
case neg
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
h : ¬∀ (i : ι), l i < u i
⊢ ↑⊥ = Set.pi univ fun i => Ioc (l i) (u i)

Next tactic:
rcases not_forall.mp h with ⟨i, hi⟩
@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i) := by
  rw [mk']; split_ifs with h
  · exact coe_eq_pi _
  · rcases not_forall.mp h with ⟨i, hi⟩
    

Proof state:
case neg.intro
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
h : ¬∀ (i : ι), l i < u i
i : ι
hi : ¬l i < u i
⊢ ↑⊥ = Set.pi univ fun i => Ioc (l i) (u i)

Next tactic:
rw [coe_bot, univ_pi_eq_empty]
@[simp]
theorem coe_mk' (l u : ι → ℝ) : (mk' l u : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (l i) (u i) := by
  rw [mk']; split_ifs with h
  · exact coe_eq_pi _
  · rcases not_forall.mp h with ⟨i, hi⟩
    rw [coe_bot, univ_pi_eq_empty]
    

Proof state:
case neg.intro
ι : Type u_1
I J : Box ι
x y l u : ι → ℝ
h : ¬∀ (i : ι), l i < u i
i : ι
hi : ¬l i < u i
⊢ Ioc (l ?m.488822) (u ?m.488822) = ∅
ι : Type u_1 I J : Box ι x y l u : ι → ℝ h : ¬∀ (i : ι), l i < u i i : ι hi : ¬l i < u i ⊢ ι

Next tactic:
exact Ioc_eq_empty hi
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
I J : WithBot (Box ι)
⊢ ↑(I ⊓ J) = ↑I ∩ ↑J

Next tactic:
induction I using WithBot.recBotCoe
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · 

Proof state:
case bot
ι : Type u_1
I J✝ : Box ι
x y : ι → ℝ
J : WithBot (Box ι)
⊢ ↑(⊥ ⊓ J) = ↑⊥ ∩ ↑J

Next tactic:
change ∅ = _
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · change ∅ = _
    

Proof state:
case bot
ι : Type u_1
I J✝ : Box ι
x y : ι → ℝ
J : WithBot (Box ι)
⊢ ∅ = ↑⊥ ∩ ↑J

Next tactic:
simp
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · change ∅ = _
    simp
  

Proof state:
case coe
ι : Type u_1
I J✝ : Box ι
x y : ι → ℝ
J : WithBot (Box ι)
a✝ : Box ι
⊢ ↑(↑a✝ ⊓ J) = ↑↑a✝ ∩ ↑J

Next tactic:
induction J using WithBot.recBotCoe
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · change ∅ = _
    simp
  induction J using WithBot.recBotCoe
  · 

Proof state:
case coe.bot
ι : Type u_1
I J : Box ι
x y : ι → ℝ
a✝ : Box ι
⊢ ↑(↑a✝ ⊓ ⊥) = ↑↑a✝ ∩ ↑⊥

Next tactic:
change ∅ = _
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · change ∅ = _
    simp
  induction J using WithBot.recBotCoe
  · change ∅ = _
    

Proof state:
case coe.bot
ι : Type u_1
I J : Box ι
x y : ι → ℝ
a✝ : Box ι
⊢ ∅ = ↑↑a✝ ∩ ↑⊥

Next tactic:
simp
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · change ∅ = _
    simp
  induction J using WithBot.recBotCoe
  · change ∅ = _
    simp
  

Proof state:
case coe.coe
ι : Type u_1
I J : Box ι
x y : ι → ℝ
a✝¹ a✝ : Box ι
⊢ ↑(↑a✝¹ ⊓ ↑a✝) = ↑↑a✝¹ ∩ ↑↑a✝

Next tactic:
change ((mk' _ _ : WithBot (Box ι)) : Set (ι → ℝ)) = _
@[simp]
theorem coe_inf (I J : WithBot (Box ι)) : (↑(I ⊓ J) : Set (ι → ℝ)) = (I : Set _) ∩ J := by
  induction I using WithBot.recBotCoe
  · change ∅ = _
    simp
  induction J using WithBot.recBotCoe
  · change ∅ = _
    simp
  change ((mk' _ _ : WithBot (Box ι)) : Set (ι → ℝ)) = _
  

Proof state:
case coe.coe
ι : Type u_1
I J : Box ι
x y : ι → ℝ
a✝¹ a✝ : Box ι
⊢ ↑(mk' (fun i => (a✝¹.lower ⊔ a✝.lower) i) fun i => (a✝¹.upper ⊓ a✝.upper) i) = ↑↑a✝¹ ∩ ↑↑a✝

Next tactic:
simp only [coe_eq_pi, ← pi_inter_distrib, Ioc_inter_Ioc, Pi.sup_apply, Pi.inf_apply, coe_mk',
    coe_coe]
instance : Lattice (WithBot (Box ι)) :=
  { WithBot.semilatticeSup,
    Box.WithBot.inf with
    inf_le_left := fun I J ↦ by
      

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
src✝¹ : SemilatticeSup (WithBot (Box ι)) := WithBot.semilatticeSup
src✝ : Inf (WithBot (Box ι)) := WithBot.inf
I J : WithBot (Box ι)
⊢ I ⊓ J ≤ I

Next tactic:
rw [← withBotCoe_subset_iff, coe_inf]
instance : Lattice (WithBot (Box ι)) :=
  { WithBot.semilatticeSup,
    Box.WithBot.inf with
    inf_le_left := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
src✝¹ : SemilatticeSup (WithBot (Box ι)) := WithBot.semilatticeSup
src✝ : Inf (WithBot (Box ι)) := WithBot.inf
I J : WithBot (Box ι)
⊢ ↑I ∩ ↑J ⊆ ↑I

Next tactic:
exact inter_subset_left _ _
instance : Lattice (WithBot (Box ι)) :=
  { WithBot.semilatticeSup,
    Box.WithBot.inf with
    inf_le_left := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      exact inter_subset_left _ _
    inf_le_right := fun I J ↦ by
      

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
src✝¹ : SemilatticeSup (WithBot (Box ι)) := WithBot.semilatticeSup
src✝ : Inf (WithBot (Box ι)) := WithBot.inf
I J : WithBot (Box ι)
⊢ I ⊓ J ≤ J

Next tactic:
rw [← withBotCoe_subset_iff, coe_inf]
instance : Lattice (WithBot (Box ι)) :=
  { WithBot.semilatticeSup,
    Box.WithBot.inf with
    inf_le_left := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      exact inter_subset_left _ _
    inf_le_right := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
src✝¹ : SemilatticeSup (WithBot (Box ι)) := WithBot.semilatticeSup
src✝ : Inf (WithBot (Box ι)) := WithBot.inf
I J : WithBot (Box ι)
⊢ ↑I ∩ ↑J ⊆ ↑J

Next tactic:
exact inter_subset_right _ _
instance : Lattice (WithBot (Box ι)) :=
  { WithBot.semilatticeSup,
    Box.WithBot.inf with
    inf_le_left := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      exact inter_subset_left _ _
    inf_le_right := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      exact inter_subset_right _ _
    le_inf := fun I J₁ J₂ h₁ h₂ ↦ by
      

Proof state:
ι : Type u_1
I✝ J : Box ι
x y : ι → ℝ
src✝¹ : SemilatticeSup (WithBot (Box ι)) := WithBot.semilatticeSup
src✝ : Inf (WithBot (Box ι)) := WithBot.inf
I J₁ J₂ : WithBot (Box ι)
h₁ : I ≤ J₁
h₂ : I ≤ J₂
⊢ I ≤ J₁ ⊓ J₂

Next tactic:
simp only [← withBotCoe_subset_iff, coe_inf] at *
instance : Lattice (WithBot (Box ι)) :=
  { WithBot.semilatticeSup,
    Box.WithBot.inf with
    inf_le_left := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      exact inter_subset_left _ _
    inf_le_right := fun I J ↦ by
      rw [← withBotCoe_subset_iff, coe_inf]
      exact inter_subset_right _ _
    le_inf := fun I J₁ J₂ h₁ h₂ ↦ by
      simp only [← withBotCoe_subset_iff, coe_inf] at *
      

Proof state:
ι : Type u_1
I✝ J : Box ι
x y : ι → ℝ
src✝¹ : SemilatticeSup (WithBot (Box ι)) := WithBot.semilatticeSup
src✝ : Inf (WithBot (Box ι)) := WithBot.inf
I J₁ J₂ : WithBot (Box ι)
h₁ : ↑I ⊆ ↑J₁
h₂ : ↑I ⊆ ↑J₂
⊢ ↑I ⊆ ↑J₁ ∩ ↑J₂

Next tactic:
exact subset_inter h₁ h₂
@[simp, norm_cast]
theorem disjoint_withBotCoe {I J : WithBot (Box ι)} :
    Disjoint (I : Set (ι → ℝ)) J ↔ Disjoint I J := by
  

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
I J : WithBot (Box ι)
⊢ Disjoint ↑I ↑J ↔ Disjoint I J

Next tactic:
simp only [disjoint_iff_inf_le, ← withBotCoe_subset_iff, coe_inf]
@[simp, norm_cast]
theorem disjoint_withBotCoe {I J : WithBot (Box ι)} :
    Disjoint (I : Set (ι → ℝ)) J ↔ Disjoint I J := by
  simp only [disjoint_iff_inf_le, ← withBotCoe_subset_iff, coe_inf]
  

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
I J : WithBot (Box ι)
⊢ ↑I ⊓ ↑J ≤ ⊥ ↔ ↑I ∩ ↑J ⊆ ↑⊥

Next tactic:
rfl
theorem not_disjoint_coe_iff_nonempty_inter :
    ¬Disjoint (I : WithBot (Box ι)) J ↔ (I ∩ J : Set (ι → ℝ)).Nonempty := by
  

Proof state:
ι : Type u_1
I J : Box ι
x y : ι → ℝ
⊢ ¬Disjoint ↑I ↑J ↔ Set.Nonempty (↑I ∩ ↑J)

Next tactic:
rw [disjoint_coe, Set.not_disjoint_iff_nonempty_inter]
theorem mapsTo_insertNth_face {n} (I : Box (Fin (n + 1))) {i : Fin (n + 1)} {x : ℝ}
    (hx : x ∈ Ioc (I.lower i) (I.upper i)) :
    MapsTo (i.insertNth x) (I.face i : Set (_ → _)) (I : Set (_ → _)) := by
  

Proof state:
ι : Type u_1
I✝ J : Box ι
x✝ y : ι → ℝ
n : ℕ
I : Box (Fin (n + 1))
i : Fin (n + 1)
x : ℝ
hx : x ∈ Ioc (lower I i) (upper I i)
⊢ MapsTo (Fin.insertNth i x) ↑(face I i) ↑I

Next tactic:
intro y hy
theorem mapsTo_insertNth_face {n} (I : Box (Fin (n + 1))) {i : Fin (n + 1)} {x : ℝ}
    (hx : x ∈ Ioc (I.lower i) (I.upper i)) :
    MapsTo (i.insertNth x) (I.face i : Set (_ → _)) (I : Set (_ → _)) := by
  intro y hy
  

Proof state:
ι : Type u_1
I✝ J : Box ι
x✝ y✝ : ι → ℝ
n : ℕ
I : Box (Fin (n + 1))
i : Fin (n + 1)
x : ℝ
hx : x ∈ Ioc (lower I i) (upper I i)
y : Fin n → ℝ
hy : y ∈ ↑(face I i)
⊢ Fin.insertNth i x y ∈ ↑I

Next tactic:
simp_rw [mem_coe, mem_def, i.forall_iff_succAbove, Fin.insertNth_apply_same,
    Fin.insertNth_apply_succAbove]
theorem mapsTo_insertNth_face {n} (I : Box (Fin (n + 1))) {i : Fin (n + 1)} {x : ℝ}
    (hx : x ∈ Ioc (I.lower i) (I.upper i)) :
    MapsTo (i.insertNth x) (I.face i : Set (_ → _)) (I : Set (_ → _)) := by
  intro y hy
  simp_rw [mem_coe, mem_def, i.forall_iff_succAbove, Fin.insertNth_apply_same,
    Fin.insertNth_apply_succAbove]
  

Proof state:
ι : Type u_1
I✝ J : Box ι
x✝ y✝ : ι → ℝ
n : ℕ
I : Box (Fin (n + 1))
i : Fin (n + 1)
x : ℝ
hx : x ∈ Ioc (lower I i) (upper I i)
y : Fin n → ℝ
hy : y ∈ ↑(face I i)
⊢ x ∈ Ioc (lower I i) (upper I i) ∧ ∀ (j : Fin n), y j ∈ Ioc (lower I (Fin.succAbove i j)) (upper I (Fin.succAbove i j))

Next tactic:
exact ⟨hx, hy⟩
theorem exists_seq_mono_tendsto (I : Box ι) :
    ∃ J : ℕ →o Box ι,
      (∀ n, Box.Icc (J n) ⊆ Box.Ioo I) ∧
        Tendsto (lower ∘ J) atTop (𝓝 I.lower) ∧ Tendsto (upper ∘ J) atTop (𝓝 I.upper) := by
  

Proof state:
ι : Type u_1
I✝ J : Box ι
x y : ι → ℝ
I : Box ι
⊢ ∃ J,
    (∀ (n : ℕ), Box.Icc (J n) ⊆ Box.Ioo I) ∧
      Tendsto (lower ∘ ⇑J) atTop (𝓝 I.lower) ∧ Tendsto (upper ∘ ⇑J) atTop (𝓝 I.upper)

Next tactic:
choose a b ha_anti hb_mono ha_mem hb_mem hab ha_tendsto hb_tendsto using
    fun i ↦ exists_seq_strictAnti_strictMono_tendsto (I.lower_lt_upper i)
theorem exists_seq_mono_tendsto (I : Box ι) :
    ∃ J : ℕ →o Box ι,
      (∀ n, Box.Icc (J n) ⊆ Box.Ioo I) ∧
        Tendsto (lower ∘ J) atTop (𝓝 I.lower) ∧ Tendsto (upper ∘ J) atTop (𝓝 I.upper) := by
  choose a b ha_anti hb_mono ha_mem hb_mem hab ha_tendsto hb_tendsto using
    fun i ↦ exists_seq_strictAnti_strictMono_tendsto (I.lower_lt_upper i)
  

Proof state:
ι : Type u_1
I✝ J : Box ι
x y : ι → ℝ
I : Box ι
a b : ι → ℕ → ℝ
ha_anti : ∀ (i : ι), StrictAnti (a i)
hb_mono : ∀ (i : ι), StrictMono (b i)
ha_mem : ∀ (i : ι) (k : ℕ), a i k ∈ Ioo (lower I i) (upper I i)
hb_mem : ∀ (i : ι) (l : ℕ), b i l ∈ Ioo (lower I i) (upper I i)
hab : ∀ (i : ι) (k l : ℕ), a i k < b i l
ha_tendsto : ∀ (i : ι), Tendsto (a i) atTop (𝓝 (lower I i))
hb_tendsto : ∀ (i : ι), Tendsto (b i) atTop (𝓝 (upper I i))
⊢ ∃ J,
    (∀ (n : ℕ), Box.Icc (J n) ⊆ Box.Ioo I) ∧
      Tendsto (lower ∘ ⇑J) atTop (𝓝 I.lower) ∧ Tendsto (upper ∘ ⇑J) atTop (𝓝 I.upper)

Next tactic:
exact
    ⟨⟨fun k ↦ ⟨flip a k, flip b k, fun i ↦ hab _ _ _⟩, fun k l hkl ↦
        le_iff_bounds.2 ⟨fun i ↦ (ha_anti i).antitone hkl, fun i ↦ (hb_mono i).monotone hkl⟩⟩,
      fun n x hx i _ ↦ ⟨(ha_mem _ _).1.trans_le (hx.1 _), (hx.2 _).trans_lt (hb_mem _ _).2⟩,
      tendsto_pi_nhds.2 ha_tendsto, tendsto_pi_nhds.2 hb_tendsto⟩
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
⊢ distortion I = distortion J

Next tactic:
simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
⊢ (Finset.sup Finset.univ fun i =>
      (Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b) / Real.nnabs r) /
        (Real.nnabs (upper J i - lower J i) / Real.nnabs r)) =
    Finset.sup Finset.univ fun i =>
      (Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b)) / Real.nnabs (upper J i - lower J i)

Next tactic:
congr 1 with i
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  

Proof state:
case e_f.h.a
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
⊢ ↑((Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b) / Real.nnabs r) /
        (Real.nnabs (upper J i - lower J i) / Real.nnabs r)) =
    ↑((Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b)) / Real.nnabs (upper J i - lower J i))

Next tactic:
have : 0 < r := by
    by_contra hr
    have := div_nonpos_of_nonneg_of_nonpos (sub_nonneg.2 <| J.lower_le_upper i) (not_lt.1 hr)
    rw [← h] at this
    exact this.not_lt (sub_pos.2 <| I.lower_lt_upper i)
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  have : 0 < r := by
    

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
⊢ 0 < r

Next tactic:
by_contra hr
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  have : 0 < r := by
    by_contra hr
    

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
hr : ¬0 < r
⊢ False

Next tactic:
have := div_nonpos_of_nonneg_of_nonpos (sub_nonneg.2 <| J.lower_le_upper i) (not_lt.1 hr)
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  have : 0 < r := by
    by_contra hr
    have := div_nonpos_of_nonneg_of_nonpos (sub_nonneg.2 <| J.lower_le_upper i) (not_lt.1 hr)
    

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
hr : ¬0 < r
this : (upper J i - lower J i) / r ≤ 0
⊢ False

Next tactic:
rw [← h] at this
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  have : 0 < r := by
    by_contra hr
    have := div_nonpos_of_nonneg_of_nonpos (sub_nonneg.2 <| J.lower_le_upper i) (not_lt.1 hr)
    rw [← h] at this
    

Proof state:
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
hr : ¬0 < r
this : upper I i - lower I i ≤ 0
⊢ False

Next tactic:
exact this.not_lt (sub_pos.2 <| I.lower_lt_upper i)
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  have : 0 < r := by
    by_contra hr
    have := div_nonpos_of_nonneg_of_nonpos (sub_nonneg.2 <| J.lower_le_upper i) (not_lt.1 hr)
    rw [← h] at this
    exact this.not_lt (sub_pos.2 <| I.lower_lt_upper i)
  

Proof state:
case e_f.h.a
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
this : 0 < r
⊢ ↑((Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b) / Real.nnabs r) /
        (Real.nnabs (upper J i - lower J i) / Real.nnabs r)) =
    ↑((Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b)) / Real.nnabs (upper J i - lower J i))

Next tactic:
have hn0 := (map_ne_zero Real.nnabs).2 this.ne'
theorem distortion_eq_of_sub_eq_div {I J : Box ι} {r : ℝ}
    (h : ∀ i, I.upper i - I.lower i = (J.upper i - J.lower i) / r) :
    distortion I = distortion J := by
  simp only [distortion, nndist_pi_def, Real.nndist_eq', h, map_div₀]
  congr 1 with i
  have : 0 < r := by
    by_contra hr
    have := div_nonpos_of_nonneg_of_nonpos (sub_nonneg.2 <| J.lower_le_upper i) (not_lt.1 hr)
    rw [← h] at this
    exact this.not_lt (sub_pos.2 <| I.lower_lt_upper i)
  have hn0 := (map_ne_zero Real.nnabs).2 this.ne'
  

Proof state:
case e_f.h.a
ι : Type u_1
I✝ J✝ : Box ι
x y : ι → ℝ
inst✝ : Fintype ι
I J : Box ι
r : ℝ
h : ∀ (i : ι), upper I i - lower I i = (upper J i - lower J i) / r
i : ι
this : 0 < r
hn0 : Real.nnabs r ≠ 0
⊢ ↑((Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b) / Real.nnabs r) /
        (Real.nnabs (upper J i - lower J i) / Real.nnabs r)) =
    ↑((Finset.sup Finset.univ fun b => Real.nnabs (upper J b - lower J b)) / Real.nnabs (upper J i - lower J i))

Next tactic:
simp_rw [NNReal.finset_sup_div, div_div_div_cancel_right _ hn0]