l3lab/ntp-mathlib huggingface dataset:
theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b := by
  by_cases h₁ : a₁ < b <;> simp [pair, h₁, add_assoc]
  · by_cases h₂ : a₂ < b <;> simp [pair, h₂, h]
    simp? at h₂ says simp only [not_lt] at h₂
    apply add_lt_add_of_le_of_lt
    exact mul_self_le_mul_self h₂
    exact Nat.lt_add_right _ h
  · 

Proof state:
case neg
a₁ a₂ b : ℕ
h : a₁ < a₂
h₁ : ¬a₁ < b
⊢ a₁ * a₁ + (a₁ + b) < if a₂ < b then b * b + a₂ else a₂ * a₂ + (a₂ + b)

Next tactic:
simp at h₁
theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b := by
  by_cases h₁ : a₁ < b <;> simp [pair, h₁, add_assoc]
  · by_cases h₂ : a₂ < b <;> simp [pair, h₂, h]
    simp? at h₂ says simp only [not_lt] at h₂
    apply add_lt_add_of_le_of_lt
    exact mul_self_le_mul_self h₂
    exact Nat.lt_add_right _ h
  · simp at h₁
    

Proof state:
case neg
a₁ a₂ b : ℕ
h : a₁ < a₂
h₁ : b ≤ a₁
⊢ a₁ * a₁ + (a₁ + b) < if a₂ < b then b * b + a₂ else a₂ * a₂ + (a₂ + b)

Next tactic:
simp only [not_lt_of_gt (lt_of_le_of_lt h₁ h), ite_false]
theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b := by
  by_cases h₁ : a₁ < b <;> simp [pair, h₁, add_assoc]
  · by_cases h₂ : a₂ < b <;> simp [pair, h₂, h]
    simp? at h₂ says simp only [not_lt] at h₂
    apply add_lt_add_of_le_of_lt
    exact mul_self_le_mul_self h₂
    exact Nat.lt_add_right _ h
  · simp at h₁
    simp only [not_lt_of_gt (lt_of_le_of_lt h₁ h), ite_false]
    

Proof state:
case neg
a₁ a₂ b : ℕ
h : a₁ < a₂
h₁ : b ≤ a₁
⊢ a₁ * a₁ + (a₁ + b) < a₂ * a₂ + (a₂ + b)

Next tactic:
apply add_lt_add
theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b := by
  by_cases h₁ : a₁ < b <;> simp [pair, h₁, add_assoc]
  · by_cases h₂ : a₂ < b <;> simp [pair, h₂, h]
    simp? at h₂ says simp only [not_lt] at h₂
    apply add_lt_add_of_le_of_lt
    exact mul_self_le_mul_self h₂
    exact Nat.lt_add_right _ h
  · simp at h₁
    simp only [not_lt_of_gt (lt_of_le_of_lt h₁ h), ite_false]
    apply add_lt_add
    

Proof state:
case neg.h₁
a₁ a₂ b : ℕ
h : a₁ < a₂
h₁ : b ≤ a₁
⊢ a₁ * a₁ < a₂ * a₂
case neg.h₂ a₁ a₂ b : ℕ h : a₁ < a₂ h₁ : b ≤ a₁ ⊢ a₁ + b < a₂ + b

Next tactic:
exact mul_self_lt_mul_self h
theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b := by
  by_cases h₁ : a₁ < b <;> simp [pair, h₁, add_assoc]
  · by_cases h₂ : a₂ < b <;> simp [pair, h₂, h]
    simp? at h₂ says simp only [not_lt] at h₂
    apply add_lt_add_of_le_of_lt
    exact mul_self_le_mul_self h₂
    exact Nat.lt_add_right _ h
  · simp at h₁
    simp only [not_lt_of_gt (lt_of_le_of_lt h₁ h), ite_false]
    apply add_lt_add
    exact mul_self_lt_mul_self h
    

Proof state:
case neg.h₂
a₁ a₂ b : ℕ
h : a₁ < a₂
h₁ : b ≤ a₁
⊢ a₁ + b < a₂ + b

Next tactic:
apply add_lt_add_right
theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b := by
  by_cases h₁ : a₁ < b <;> simp [pair, h₁, add_assoc]
  · by_cases h₂ : a₂ < b <;> simp [pair, h₂, h]
    simp? at h₂ says simp only [not_lt] at h₂
    apply add_lt_add_of_le_of_lt
    exact mul_self_le_mul_self h₂
    exact Nat.lt_add_right _ h
  · simp at h₁
    simp only [not_lt_of_gt (lt_of_le_of_lt h₁ h), ite_false]
    apply add_lt_add
    exact mul_self_lt_mul_self h
    apply add_lt_add_right; 

Proof state:
case neg.h₂.bc
a₁ a₂ b : ℕ
h : a₁ < a₂
h₁ : b ≤ a₁
⊢ a₁ < a₂

Next tactic:
assumption
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  

Proof state:
a b₁ b₂ : ℕ
h : b₁ < b₂
⊢ pair a b₁ < pair a b₂

Next tactic:
by_cases h₁ : a < b₁
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> 

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : a < b₁
⊢ pair a b₁ < pair a b₂

Next tactic:
simp [pair, h₁, add_assoc]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> 

Proof state:
case neg
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : ¬a < b₁
⊢ pair a b₁ < pair a b₂

Next tactic:
simp [pair, h₁, add_assoc]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · 

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : a < b₁
⊢ b₁ * b₁ + a < if a < b₂ then b₂ * b₂ + a else a * a + (a + b₂)

Next tactic:
simp [pair, lt_trans h₁ h, h]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : a < b₁
⊢ b₁ * b₁ < b₂ * b₂

Next tactic:
exact mul_self_lt_mul_self h
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · 

Proof state:
case neg
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : ¬a < b₁
⊢ a * a + (a + b₁) < if a < b₂ then b₂ * b₂ + a else a * a + (a + b₂)

Next tactic:
by_cases h₂ : a < b₂
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> 

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : ¬a < b₁
h₂ : a < b₂
⊢ a * a + (a + b₁) < if a < b₂ then b₂ * b₂ + a else a * a + (a + b₂)

Next tactic:
simp [pair, h₂, h]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> 

Proof state:
case neg
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : ¬a < b₁
h₂ : ¬a < b₂
⊢ a * a + (a + b₁) < if a < b₂ then b₂ * b₂ + a else a * a + (a + b₂)

Next tactic:
simp [pair, h₂, h]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> simp [pair, h₂, h]
    

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : ¬a < b₁
h₂ : a < b₂
⊢ a * a + (a + b₁) < b₂ * b₂ + a

Next tactic:
simp? at h₁ says simp only [not_lt] at h₁
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> simp [pair, h₂, h]
    simp? at h₁ says 

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₁ : ¬a < b₁
h₂ : a < b₂
⊢ a * a + (a + b₁) < b₂ * b₂ + a

Next tactic:
simp only [not_lt] at h₁
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> simp [pair, h₂, h]
    simp? at h₁ says simp only [not_lt] at h₁
    

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₂ : a < b₂
h₁ : b₁ ≤ a
⊢ a * a + (a + b₁) < b₂ * b₂ + a

Next tactic:
rw [add_comm, add_comm _ a, add_assoc, add_lt_add_iff_left]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> simp [pair, h₂, h]
    simp? at h₁ says simp only [not_lt] at h₁
    rw [add_comm, add_comm _ a, add_assoc, add_lt_add_iff_left]
    

Proof state:
case pos
a b₁ b₂ : ℕ
h : b₁ < b₂
h₂ : a < b₂
h₁ : b₁ ≤ a
⊢ b₁ + a * a < b₂ * b₂

Next tactic:
rwa [add_comm, ← sqrt_lt, sqrt_add_eq]
theorem pair_lt_pair_right (a) {b₁ b₂} (h : b₁ < b₂) : pair a b₁ < pair a b₂ := by
  by_cases h₁ : a < b₁ <;> simp [pair, h₁, add_assoc]
  · simp [pair, lt_trans h₁ h, h]
    exact mul_self_lt_mul_self h
  · by_cases h₂ : a < b₂ <;> simp [pair, h₂, h]
    simp? at h₁ says simp only [not_lt] at h₁
    rw [add_comm, add_comm _ a, add_assoc, add_lt_add_iff_left]
    rwa [add_comm, ← sqrt_lt, sqrt_add_eq]
    

Proof state:
case pos.h
a b₁ b₂ : ℕ
h : b₁ < b₂
h₂ : a < b₂
h₁ : b₁ ≤ a
⊢ b₁ ≤ a + a

Next tactic:
exact le_trans h₁ (Nat.le_add_left _ _)
theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2 := by
  

Proof state:
m n : ℕ
⊢ pair m n < (max m n + 1) ^ 2

Next tactic:
rw [pair, add_sq, mul_one, two_mul, sq, add_assoc, add_assoc]
theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2 := by
  rw [pair, add_sq, mul_one, two_mul, sq, add_assoc, add_assoc]
  

Proof state:
m n : ℕ
⊢ (if m < n then n * n + m else m * m + (m + n)) < max m n * max m n + (max m n + max m n + 1 ^ 2)

Next tactic:
cases' (lt_or_le m n) with h h
theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2 := by
  rw [pair, add_sq, mul_one, two_mul, sq, add_assoc, add_assoc]
  cases' (lt_or_le m n) with h h
  

Proof state:
case inl
m n : ℕ
h : m < n
⊢ (if m < n then n * n + m else m * m + (m + n)) < max m n * max m n + (max m n + max m n + 1 ^ 2)
case inr
m n : ℕ
h : n ≤ m
⊢ (if m < n then n * n + m else m * m + (m + n)) < max m n * max m n + (max m n + max m n + 1 ^ 2)

Next tactic:
rw [if_pos h, max_eq_right h.le, add_lt_add_iff_left, add_assoc]
theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2 := by
  rw [pair, add_sq, mul_one, two_mul, sq, add_assoc, add_assoc]
  cases' (lt_or_le m n) with h h
  rw [if_pos h, max_eq_right h.le, add_lt_add_iff_left, add_assoc]
  

Proof state:
case inl
m n : ℕ
h : m < n
⊢ m < n + (n + 1 ^ 2)
case inr
m n : ℕ
h : n ≤ m
⊢ (if m < n then n * n + m else m * m + (m + n)) < max m n * max m n + (max m n + max m n + 1 ^ 2)

Next tactic:
exact h.trans_le (self_le_add_right n _)
theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2 := by
  rw [pair, add_sq, mul_one, two_mul, sq, add_assoc, add_assoc]
  cases' (lt_or_le m n) with h h
  rw [if_pos h, max_eq_right h.le, add_lt_add_iff_left, add_assoc]
  exact h.trans_le (self_le_add_right n _)
  

Proof state:
case inr
m n : ℕ
h : n ≤ m
⊢ (if m < n then n * n + m else m * m + (m + n)) < max m n * max m n + (max m n + max m n + 1 ^ 2)

Next tactic:
rw [if_neg h.not_lt, max_eq_left h, add_lt_add_iff_left, add_assoc, add_lt_add_iff_left]
theorem pair_lt_max_add_one_sq (m n : ℕ) : pair m n < (max m n + 1) ^ 2 := by
  rw [pair, add_sq, mul_one, two_mul, sq, add_assoc, add_assoc]
  cases' (lt_or_le m n) with h h
  rw [if_pos h, max_eq_right h.le, add_lt_add_iff_left, add_assoc]
  exact h.trans_le (self_le_add_right n _)
  rw [if_neg h.not_lt, max_eq_left h, add_lt_add_iff_left, add_assoc, add_lt_add_iff_left]
  

Proof state:
case inr
m n : ℕ
h : n ≤ m
⊢ n < m + 1 ^ 2

Next tactic:
exact lt_succ_of_le h
theorem max_sq_add_min_le_pair (m n : ℕ) : max m n ^ 2 + min m n ≤ pair m n := by
  

Proof state:
m n : ℕ
⊢ max m n ^ 2 + min m n ≤ pair m n

Next tactic:
rw [pair]
theorem max_sq_add_min_le_pair (m n : ℕ) : max m n ^ 2 + min m n ≤ pair m n := by
  rw [pair]
  

Proof state:
m n : ℕ
⊢ max m n ^ 2 + min m n ≤ if m < n then n * n + m else m * m + m + n

Next tactic:
cases' lt_or_le m n with h h
theorem max_sq_add_min_le_pair (m n : ℕ) : max m n ^ 2 + min m n ≤ pair m n := by
  rw [pair]
  cases' lt_or_le m n with h h
  

Proof state:
case inl
m n : ℕ
h : m < n
⊢ max m n ^ 2 + min m n ≤ if m < n then n * n + m else m * m + m + n
case inr m n : ℕ h : n ≤ m ⊢ max m n ^ 2 + min m n ≤ if m < n then n * n + m else m * m + m + n

Next tactic:
rw [if_pos h, max_eq_right h.le, min_eq_left h.le, sq]
theorem max_sq_add_min_le_pair (m n : ℕ) : max m n ^ 2 + min m n ≤ pair m n := by
  rw [pair]
  cases' lt_or_le m n with h h
  rw [if_pos h, max_eq_right h.le, min_eq_left h.le, sq]
  

Proof state:
case inr
m n : ℕ
h : n ≤ m
⊢ max m n ^ 2 + min m n ≤ if m < n then n * n + m else m * m + m + n

Next tactic:
rw [if_neg h.not_lt, max_eq_left h, min_eq_right h, sq, add_assoc, add_le_add_iff_left]
theorem max_sq_add_min_le_pair (m n : ℕ) : max m n ^ 2 + min m n ≤ pair m n := by
  rw [pair]
  cases' lt_or_le m n with h h
  rw [if_pos h, max_eq_right h.le, min_eq_left h.le, sq]
  rw [if_neg h.not_lt, max_eq_left h, min_eq_right h, sq, add_assoc, add_le_add_iff_left]
  

Proof state:
case inr
m n : ℕ
h : n ≤ m
⊢ n ≤ m + n

Next tactic:
exact le_add_self
theorem add_le_pair (m n : ℕ) : m + n ≤ pair m n :=
  (max_sq_add_min_le_pair _ _).trans' <| by
    

Proof state:
m n : ℕ
⊢ m + n ≤ max m n ^ 2 + min m n

Next tactic:
rw [sq, ← min_add_max, add_comm, add_le_add_iff_right]
theorem add_le_pair (m n : ℕ) : m + n ≤ pair m n :=
  (max_sq_add_min_le_pair _ _).trans' <| by
    rw [sq, ← min_add_max, add_comm, add_le_add_iff_right]
    

Proof state:
m n : ℕ
⊢ max m n ≤ max m n * max m n

Next tactic:
exact le_mul_self _
theorem iSup_unpair {α} [CompleteLattice α] (f : ℕ → ℕ → α) :
    ⨆ n : ℕ, f n.unpair.1 n.unpair.2 = ⨆ (i : ℕ) (j : ℕ), f i j := by
  

Proof state:
α : Type u_1
inst✝ : CompleteLattice α
f : ℕ → ℕ → α
⊢ ⨆ n, f (unpair n).1 (unpair n).2 = ⨆ i, ⨆ j, f i j

Next tactic:
rw [← (iSup_prod : ⨆ i : ℕ × ℕ, f i.1 i.2 = _), ← Nat.surjective_unpair.iSup_comp]
theorem iUnion_unpair_prod {α β} {s : ℕ → Set α} {t : ℕ → Set β} :
    ⋃ n : ℕ, s n.unpair.fst ×ˢ t n.unpair.snd = (⋃ n, s n) ×ˢ ⋃ n, t n := by
  

Proof state:
α : Type u_1
β : Type u_2
s : ℕ → Set α
t : ℕ → Set β
⊢ ⋃ n, s (unpair n).1 ×ˢ t (unpair n).2 = (⋃ n, s n) ×ˢ ⋃ n, t n

Next tactic:
rw [← Set.iUnion_prod]
theorem iUnion_unpair_prod {α β} {s : ℕ → Set α} {t : ℕ → Set β} :
    ⋃ n : ℕ, s n.unpair.fst ×ˢ t n.unpair.snd = (⋃ n, s n) ×ˢ ⋃ n, t n := by
  rw [← Set.iUnion_prod]
  

Proof state:
α : Type u_1
β : Type u_2
s : ℕ → Set α
t : ℕ → Set β
⊢ ⋃ n, s (unpair n).1 ×ˢ t (unpair n).2 = ⋃ x, s x.1 ×ˢ t x.2

Next tactic:
exact surjective_unpair.iUnion_comp (fun x => s x.fst ×ˢ t x.snd)
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  

Proof state:
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
⊢ FinStronglyMeasurable f μ

Next tactic:
borelize G
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  

Proof state:
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
⊢ FinStronglyMeasurable f μ

Next tactic:
haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  

Proof state:
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
⊢ FinStronglyMeasurable f μ

Next tactic:
let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by 

Proof state:
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
⊢ 0 ∈ Set.range f ∪ {0}

Next tactic:
simp
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  

Proof state:
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
⊢ FinStronglyMeasurable f μ

Next tactic:
refine' ⟨fs, _, _⟩
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  refine' ⟨fs, _, _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
⊢ ∀ (n : ℕ), ↑↑μ (support ↑(fs n)) < ⊤

Next tactic:
have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
      SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  refine' ⟨fs, _, _⟩
  · have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
      SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
    

Proof state:
case refine'_1
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
h_fs_Lp : ∀ (n : ℕ), Memℒp (↑(fs n)) p
⊢ ∀ (n : ℕ), ↑↑μ (support ↑(fs n)) < ⊤

Next tactic:
exact fun n => (fs n).measure_support_lt_top_of_memℒp (h_fs_Lp n) hp_ne_zero hp_ne_top
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  refine' ⟨fs, _, _⟩
  · have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
      SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
    exact fun n => (fs n).measure_support_lt_top_of_memℒp (h_fs_Lp n) hp_ne_zero hp_ne_top
  · 

Proof state:
case refine'_2
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
⊢ ∀ (x : α), Tendsto (fun n => ↑(fs n) x) atTop (𝓝 (f x))

Next tactic:
intro x
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  refine' ⟨fs, _, _⟩
  · have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
      SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
    exact fun n => (fs n).measure_support_lt_top_of_memℒp (h_fs_Lp n) hp_ne_zero hp_ne_top
  · intro x
    

Proof state:
case refine'_2
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
x : α
⊢ Tendsto (fun n => ↑(fs n) x) atTop (𝓝 (f x))

Next tactic:
apply SimpleFunc.tendsto_approxOn
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  refine' ⟨fs, _, _⟩
  · have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
      SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
    exact fun n => (fs n).measure_support_lt_top_of_memℒp (h_fs_Lp n) hp_ne_zero hp_ne_top
  · intro x
    apply SimpleFunc.tendsto_approxOn
    

Proof state:
case refine'_2.hx
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
x : α
⊢ f x ∈ closure (Set.range f ∪ {0})

Next tactic:
apply subset_closure
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
    (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ := by
  borelize G
  haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
    hf_meas.separableSpace_range_union_singleton
  let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
  refine' ⟨fs, _, _⟩
  · have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
      SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
    exact fun n => (fs n).measure_support_lt_top_of_memℒp (h_fs_Lp n) hp_ne_zero hp_ne_top
  · intro x
    apply SimpleFunc.tendsto_approxOn
    apply subset_closure
    

Proof state:
case refine'_2.hx.a
α : Type u_1
G : Type u_2
p : ℝ≥0∞
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : NormedAddCommGroup G
f : α → G
hf : Memℒp f p
hf_meas : StronglyMeasurable f
hp_ne_zero : p ≠ 0
hp_ne_top : p ≠ ⊤
this✝¹ : MeasurableSpace G := borel G
this✝ : BorelSpace G
this : SeparableSpace ↑(Set.range f ∪ {0})
fs : ℕ → α →ₛ G := SimpleFunc.approxOn f (_ : Measurable f) (Set.range f ∪ {0}) 0 (_ : 0 ∈ Set.range f ∪ {0})
x : α
⊢ f x ∈ Set.range f ∪ {0}

Next tactic:
simp