Theorem: BoxIntegral.Box.mem_splitCenterBox
File: Mathlib/Analysis/BoxIntegral/Box/SubboxInduction.lean

Proof steps:
state_before: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
⊢ y ∈ I.splitCenterBox s ↔ y ∈ I ∧ ∀ (i : ι), (I.lower i + I.upper i) / 2 < y i ↔ i ∈ s
state_after: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
⊢ (∀ (i : ι),
      y i ∈
        Set.Ioc (s.piecewise (fun i => (I.lower i + I.upper i) / 2) I.lower i)
          (s.piecewise I.upper (fun i => (I.lower i + I.upper i) / 2) i)) ↔
    ∀ (x : ι), y x ∈ Set.Ioc (I.lower x) (I.upper x) ∧ ((I.lower x + I.upper x) / 2 < y x ↔ x ∈ s)
tactic: simp only [splitCenterBox, mem_def, ← forall_and]
state_before: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
⊢ (∀ (i : ι),
      y i ∈
        Set.Ioc (s.piecewise (fun i => (I.lower i + I.upper i) / 2) I.lower i)
          (s.piecewise I.upper (fun i => (I.lower i + I.upper i) / 2) i)) ↔
    ∀ (x : ι), y x ∈ Set.Ioc (I.lower x) (I.upper x) ∧ ((I.lower x + I.upper x) / 2 < y x ↔ x ∈ s)
state_after: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
⊢ y i ∈
      Set.Ioc (s.piecewise (fun i => (I.lower i + I.upper i) / 2) I.lower i)
        (s.piecewise I.upper (fun i => (I.lower i + I.upper i) / 2) i) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ ((I.lower i + I.upper i) / 2 < y i ↔ i ∈ s)
tactic: refine forall_congr' fun i ↦ ?_
state_before: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
⊢ y i ∈
      Set.Ioc (s.piecewise (fun i => (I.lower i + I.upper i) / 2) I.lower i)
        (s.piecewise I.upper (fun i => (I.lower i + I.upper i) / 2) i) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ ((I.lower i + I.upper i) / 2 < y i ↔ i ∈ s)
state_after: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
⊢ y i ∈
      Set.Ioc (if i ∈ s then (I.lower i + I.upper i) / 2 else I.lower i)
        (if i ∈ s then I.upper i else (I.lower i + I.upper i) / 2) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ ((I.lower i + I.upper i) / 2 < y i ↔ i ∈ s)
tactic: dsimp only [Set.piecewise]
state_before: ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
⊢ y i ∈
      Set.Ioc (if i ∈ s then (I.lower i + I.upper i) / 2 else I.lower i)
        (if i ∈ s then I.upper i else (I.lower i + I.upper i) / 2) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ ((I.lower i + I.upper i) / 2 < y i ↔ i ∈ s)
state_after: case pos
ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
hs : i ∈ s
⊢ y i ∈ Set.Ioc ((I.lower i + I.upper i) / 2) (I.upper i) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ (I.lower i + I.upper i) / 2 < y i

case neg
ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
hs : i ∉ s
⊢ y i ∈ Set.Ioc (I.lower i) ((I.lower i + I.upper i) / 2) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ y i ≤ (I.lower i + I.upper i) / 2
tactic: split_ifs with hs <;> simp only [hs, iff_true_iff, iff_false_iff, not_lt]
state_before: case pos
ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
hs : i ∈ s
⊢ y i ∈ Set.Ioc ((I.lower i + I.upper i) / 2) (I.upper i) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ (I.lower i + I.upper i) / 2 < y i

case neg
ι : Type u_1
I J : Box ι
s : Set ι
y : ι → ℝ
i : ι
hs : i ∉ s
⊢ y i ∈ Set.Ioc (I.lower i) ((I.lower i + I.upper i) / 2) ↔
    y i ∈ Set.Ioc (I.lower i) (I.upper i) ∧ y i ≤ (I.lower i + I.upper i) / 2
state_after: no goals
tactic: exacts [⟨fun H ↦ ⟨⟨(left_lt_add_div_two.2 (I.lower_lt_upper i)).trans H.1, H.2⟩, H.1⟩,
      fun H ↦ ⟨H.2, H.1.2⟩⟩,
    ⟨fun H ↦ ⟨⟨H.1, H.2.trans (add_div_two_lt_right.2 (I.lower_lt_upper i)).le⟩, H.2⟩,
      fun H ↦ ⟨H.1.1, H.2⟩⟩]