Theorem: AntitoneOn.integral_le_sum
File: Mathlib/Analysis/SumIntegralComparisons.lean

tactic: intro k hk
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
⊢ ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))

tactic: refine' (hf.mono _).intervalIntegrable
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
k : ℕ
hk : k < a
⊢ IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))

tactic: rw [uIcc_of_le]
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
k : ℕ
hk : k < a
⊢ uIcc (x₀ + ↑k) (x₀ + ↑(k + 1)) ⊆ Icc x₀ (x₀ + ↑a)

tactic: apply Icc_subset_Icc
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
k : ℕ
hk : k < a
⊢ Icc (x₀ + ↑k) (x₀ + ↑(k + 1)) ⊆ Icc x₀ (x₀ + ↑a)

tactic: simp only [le_add_iff_nonneg_right, Nat.cast_nonneg]
state_before: case h₁
x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
k : ℕ
hk : k < a
⊢ x₀ ≤ x₀ + ↑k

tactic: simp only [add_le_add_iff_left, Nat.cast_le, Nat.succ_le_of_lt hk]
state_before: case h₂
x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
k : ℕ
hk : k < a
⊢ x₀ + ↑(k + 1) ≤ x₀ + ↑a

tactic: simp only [add_le_add_iff_left, Nat.cast_le, Nat.le_succ]
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
k : ℕ
hk : k < a
⊢ x₀ + ↑k ≤ x₀ + ↑(k + 1)

tactic: convert (intervalIntegral.sum_integral_adjacent_intervals hint).symm
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
⊢ (∫ (x : ℝ) in x₀..x₀ + ↑a, f x) = ∑ i in Finset.range a, ∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f x

tactic: simp only [Nat.cast_zero, add_zero]
state_before: case h.e'_2.h.e'_6
x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
⊢ x₀ = x₀ + ↑0

tactic: apply Finset.sum_le_sum fun i hi => ?_
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
⊢ (∑ i in Finset.range a, ∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f x) ≤
    ∑ i in Finset.range a, ∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f (x₀ + ↑i)

tactic: have ia : i < a := Finset.mem_range.1 hi
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
⊢ (∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f x) ≤ ∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f (x₀ + ↑i)

tactic: refine' intervalIntegral.integral_mono_on (by simp) (hint _ ia) (by simp) fun x hx => _
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
⊢ (∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f x) ≤ ∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f (x₀ + ↑i)

tactic: apply hf _ _ hx.1
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
x : ℝ
hx : x ∈ Icc (x₀ + ↑i) (x₀ + ↑(i + 1))
⊢ f x ≤ f (x₀ + ↑i)

tactic: simp
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
⊢ x₀ + ↑i ≤ x₀ + ↑(i + 1)

tactic: simp
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
⊢ IntervalIntegrable (fun x => f (x₀ + ↑i)) volume (x₀ + ↑i) (x₀ + ↑(i + 1))

tactic: simp only [ia.le, mem_Icc, le_add_iff_nonneg_right, Nat.cast_nonneg, add_le_add_iff_left,
  Nat.cast_le, and_self_iff]
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
x : ℝ
hx : x ∈ Icc (x₀ + ↑i) (x₀ + ↑(i + 1))
⊢ x₀ + ↑i ∈ Icc x₀ (x₀ + ↑a)

tactic: refine' mem_Icc.2 ⟨le_trans (by simp) hx.1, le_trans hx.2 _⟩
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
x : ℝ
hx : x ∈ Icc (x₀ + ↑i) (x₀ + ↑(i + 1))
⊢ x ∈ Icc x₀ (x₀ + ↑a)

tactic: simp only [add_le_add_iff_left, Nat.cast_le, Nat.succ_le_of_lt ia]
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
x : ℝ
hx : x ∈ Icc (x₀ + ↑i) (x₀ + ↑(i + 1))
⊢ x₀ + ↑(i + 1) ≤ x₀ + ↑a

tactic: simp
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
i : ℕ
hi : i ∈ Finset.range a
ia : i < a
x : ℝ
hx : x ∈ Icc (x₀ + ↑i) (x₀ + ↑(i + 1))
⊢ x₀ ≤ x₀ + ↑i

tactic: simp
state_before: x₀ : ℝ
a b : ℕ
f : ℝ → ℝ
hf : AntitoneOn f (Icc x₀ (x₀ + ↑a))
hint : ∀ (k : ℕ), k < a → IntervalIntegrable f volume (x₀ + ↑k) (x₀ + ↑(k + 1))
⊢ (∑ i in Finset.range a, ∫ (x : ℝ) in x₀ + ↑i..x₀ + ↑(i + 1), f (x₀ + ↑i)) = ∑ i in Finset.range a, f (x₀ + ↑i)