l3lab/ntp-mathlib huggingface dataset:
theorem toList_nonempty : ∀ {s : String}, s ≠ "" → s.toList = s.head :: (s.drop 1).toList
  | ⟨s⟩, h => by
    cases s with
    | nil => simp only [ne_eq, not_true_eq_false] at h
    | cons c cs =>
      simp only [toList, List.cons.injEq]
      constructor <;> [

Proof state:
case cons.left
c : Char
cs : List Char
h : { data := c :: cs } ≠ ""
⊢ c = head { data := c :: cs }

Next tactic:
rfl
theorem toList_nonempty : ∀ {s : String}, s ≠ "" → s.toList = s.head :: (s.drop 1).toList
  | ⟨s⟩, h => by
    cases s with
    | nil => simp only [ne_eq, not_true_eq_false] at h
    | cons c cs =>
      simp only [toList, List.cons.injEq]
      constructor <;> [rfl; 

Proof state:
case cons.right
c : Char
cs : List Char
h : { data := c :: cs } ≠ ""
⊢ cs = (drop { data := c :: cs } 1).data

Next tactic:
simp [drop_eq]
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    

Proof state:
a b c : String
⊢ a ≤ b → b ≤ c → a ≤ c

Next tactic:
simp only [le_iff_toList_le]
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    

Proof state:
a b c : String
⊢ toList a ≤ toList b → toList b ≤ toList c → toList a ≤ toList c

Next tactic:
apply le_trans
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    

Proof state:
a b : String
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a

Next tactic:
simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    

Proof state:
a b : String
⊢ a ≤ b → b ≤ a → a = b

Next tactic:
simp only [le_iff_toList_le, ← toList_inj]
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    

Proof state:
a b : String
⊢ toList a ≤ toList b → toList b ≤ toList a → toList a = toList b

Next tactic:
apply le_antisymm
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    

Proof state:
a b : String
⊢ a ≤ b ∨ b ≤ a

Next tactic:
simp only [le_iff_toList_le]
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    

Proof state:
a b : String
⊢ toList a ≤ toList b ∨ toList b ≤ toList a

Next tactic:
apply le_total
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    

Proof state:
a b : String
⊢ compare a b = compareOfLessAndEq a b

Next tactic:
simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    

Proof state:
a b : String
⊢ (if List.lt a.data b.data then Ordering.lt else if a = b then Ordering.eq else Ordering.gt) =
    if List.Lex (fun x x_1 => x < x_1) a.data b.data then Ordering.lt else if a = b then Ordering.eq else Ordering.gt

Next tactic:
split_ifs
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case pos
a b : String
h✝¹ : List.lt a.data b.data
h✝ : List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ Ordering.lt = Ordering.lt

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case pos
a b : String
h✝² : List.lt a.data b.data
h✝¹ : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
h✝ : a = b
⊢ False

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case neg
a b : String
h✝² : List.lt a.data b.data
h✝¹ : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
h✝ : ¬a = b
⊢ False

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case pos
a b : String
h✝² : ¬List.lt a.data b.data
h✝¹ : a = b
h✝ : List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ False

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case neg
a b : String
h✝² : ¬List.lt a.data b.data
h✝¹ : a = b
h✝ : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ Ordering.eq = Ordering.eq

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case pos
a b : String
h✝² : ¬List.lt a.data b.data
h✝¹ : ¬a = b
h✝ : List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ False

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    

Proof state:
case neg
a b : String
h✝² : ¬List.lt a.data b.data
h✝¹ : ¬a = b
h✝ : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ Ordering.gt = Ordering.gt

Next tactic:
simp only [List.lt_iff_lex_lt] at *
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    simp only [List.lt_iff_lex_lt] at * <;>
    

Proof state:
case pos
a b : String
h✝² : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
h✝¹ : a = b
h✝ : List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ False

Next tactic:
contradiction
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    simp only [List.lt_iff_lex_lt] at * <;>
    

Proof state:
case neg
a b : String
h✝² : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
h✝¹ : ¬a = b
h✝ : List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ False

Next tactic:
contradiction
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    simp only [List.lt_iff_lex_lt] at * <;>
    

Proof state:
case pos
a b : String
h✝² : a = b
h✝¹ : List.Lex (fun x x_1 => x < x_1) a.data b.data
h✝ : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ False

Next tactic:
contradiction
instance : LinearOrder String where
  le_refl a := le_iff_toList_le.mpr le_rfl
  le_trans a b c := by
    simp only [le_iff_toList_le]
    apply le_trans
  lt_iff_le_not_le a b := by
    simp only [lt_iff_toList_lt, le_iff_toList_le, lt_iff_le_not_le]
  le_antisymm a b := by
    simp only [le_iff_toList_le, ← toList_inj]
    apply le_antisymm
  le_total a b := by
    simp only [le_iff_toList_le]
    apply le_total
  decidableLE := String.decidableLE
  compare_eq_compareOfLessAndEq a b := by
    simp only [compare, compareOfLessAndEq, instLTString, List.instLTList, lt_iff_toList_lt,
      List.LT', toList]
    split_ifs <;>
    simp only [List.lt_iff_lex_lt] at * <;>
    

Proof state:
case pos
a b : String
h✝² : ¬a = b
h✝¹ : List.Lex (fun x x_1 => x < x_1) a.data b.data
h✝ : ¬List.Lex (fun x x_1 => x < x_1) a.data b.data
⊢ False

Next tactic:
contradiction
@[simp]
theorem List.asString_inj {l l' : List Char} : l.asString = l'.asString ↔ l = l' :=
  ⟨fun h ↦ by 

Proof state:
l l' : List Char
h : asString l = asString l'
⊢ l = l'

Next tactic:
rw [← toList_inv_asString l, ← toList_inv_asString l', toList_inj, h]
theorem List.asString_eq {l : List Char} {s : String} : l.asString = s ↔ l = s.toList := by
  

Proof state:
l : List Char
s : String
⊢ asString l = s ↔ l = toList s

Next tactic:
rw [← asString_inv_toList s, asString_inj, asString_inv_toList s]
theorem not_isFiniteMeasure_iff : ¬IsFiniteMeasure μ ↔ μ Set.univ = ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
⊢ ¬IsFiniteMeasure μ ↔ ↑↑μ univ = ⊤

Next tactic:
refine' ⟨fun h => _, fun h => fun h' => h'.measure_univ_lt_top.ne h⟩
theorem not_isFiniteMeasure_iff : ¬IsFiniteMeasure μ ↔ μ Set.univ = ∞ := by
  refine' ⟨fun h => _, fun h => fun h' => h'.measure_univ_lt_top.ne h⟩
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
h : ¬IsFiniteMeasure μ
⊢ ↑↑μ univ = ⊤

Next tactic:
by_contra h'
theorem not_isFiniteMeasure_iff : ¬IsFiniteMeasure μ ↔ μ Set.univ = ∞ := by
  refine' ⟨fun h => _, fun h => fun h' => h'.measure_univ_lt_top.ne h⟩
  by_contra h'
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
h : ¬IsFiniteMeasure μ
h' : ¬↑↑μ univ = ⊤
⊢ False

Next tactic:
exact h ⟨lt_top_iff_ne_top.mpr h'⟩
instance Restrict.isFiniteMeasure (μ : Measure α) [hs : Fact (μ s < ∞)] :
    IsFiniteMeasure (μ.restrict s) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
μ : Measure α
hs : Fact (↑↑μ s < ⊤)
⊢ ↑↑(Measure.restrict μ s) univ < ⊤

Next tactic:
simpa using hs.elim
instance isFiniteMeasureRestrict (μ : Measure α) (s : Set α) [h : IsFiniteMeasure μ] :
    IsFiniteMeasure (μ.restrict s) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s✝ t : Set α
μ : Measure α
s : Set α
h : IsFiniteMeasure μ
⊢ ↑↑(Measure.restrict μ s) univ < ⊤

Next tactic:
simpa using measure_lt_top μ s
theorem measure_compl_le_add_of_le_add [IsFiniteMeasure μ] (hs : MeasurableSet s)
    (ht : MeasurableSet t) {ε : ℝ≥0∞} (h : μ s ≤ μ t + ε) : μ tᶜ ≤ μ sᶜ + ε := by
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝ : IsFiniteMeasure μ
hs : MeasurableSet s
ht : MeasurableSet t
ε : ℝ≥0∞
h : ↑↑μ s ≤ ↑↑μ t + ε
⊢ ↑↑μ tᶜ ≤ ↑↑μ sᶜ + ε

Next tactic:
rw [measure_compl ht (measure_ne_top μ _), measure_compl hs (measure_ne_top μ _),
    tsub_le_iff_right]
theorem measure_compl_le_add_of_le_add [IsFiniteMeasure μ] (hs : MeasurableSet s)
    (ht : MeasurableSet t) {ε : ℝ≥0∞} (h : μ s ≤ μ t + ε) : μ tᶜ ≤ μ sᶜ + ε := by
  rw [measure_compl ht (measure_ne_top μ _), measure_compl hs (measure_ne_top μ _),
    tsub_le_iff_right]
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝ : IsFiniteMeasure μ
hs : MeasurableSet s
ht : MeasurableSet t
ε : ℝ≥0∞
h : ↑↑μ s ≤ ↑↑μ t + ε
⊢ ↑↑μ univ ≤ ↑↑μ univ - ↑↑μ s + ε + ↑↑μ t

Next tactic:
calc
    μ univ = μ univ - μ s + μ s := (tsub_add_cancel_of_le <| measure_mono s.subset_univ).symm
    _ ≤ μ univ - μ s + (μ t + ε) := (add_le_add_left h _)
    _ = _ := by rw [add_right_comm, add_assoc]
theorem measure_compl_le_add_of_le_add [IsFiniteMeasure μ] (hs : MeasurableSet s)
    (ht : MeasurableSet t) {ε : ℝ≥0∞} (h : μ s ≤ μ t + ε) : μ tᶜ ≤ μ sᶜ + ε := by
  rw [measure_compl ht (measure_ne_top μ _), measure_compl hs (measure_ne_top μ _),
    tsub_le_iff_right]
  calc
    μ univ = μ univ - μ s + μ s := (tsub_add_cancel_of_le <| measure_mono s.subset_univ).symm
    _ ≤ μ univ - μ s + (μ t + ε) := (add_le_add_left h _)
    _ = _ := by 

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝ : IsFiniteMeasure μ
hs : MeasurableSet s
ht : MeasurableSet t
ε : ℝ≥0∞
h : ↑↑μ s ≤ ↑↑μ t + ε
⊢ ↑↑μ univ - ↑↑μ s + (↑↑μ t + ε) = ↑↑μ univ - ↑↑μ s + ε + ↑↑μ t

Next tactic:
rw [add_right_comm, add_assoc]
instance isFiniteMeasureZero : IsFiniteMeasure (0 : Measure α) :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
⊢ ↑↑0 univ < ⊤

Next tactic:
simp
instance (priority := 50) isFiniteMeasureOfIsEmpty [IsEmpty α] : IsFiniteMeasure μ := by
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝ : IsEmpty α
⊢ IsFiniteMeasure μ

Next tactic:
rw [eq_zero_of_isEmpty μ]
instance (priority := 50) isFiniteMeasureOfIsEmpty [IsEmpty α] : IsFiniteMeasure μ := by
  rw [eq_zero_of_isEmpty μ]
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝ : IsEmpty α
⊢ IsFiniteMeasure 0

Next tactic:
infer_instance
instance isFiniteMeasureAdd [IsFiniteMeasure μ] [IsFiniteMeasure ν] : IsFiniteMeasure (μ + ν) where
  measure_univ_lt_top := by
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝² : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
⊢ ↑↑(μ + ν) univ < ⊤

Next tactic:
rw [Measure.coe_add, Pi.add_apply, ENNReal.add_lt_top]
instance isFiniteMeasureAdd [IsFiniteMeasure μ] [IsFiniteMeasure ν] : IsFiniteMeasure (μ + ν) where
  measure_univ_lt_top := by
    rw [Measure.coe_add, Pi.add_apply, ENNReal.add_lt_top]
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝² : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
⊢ ↑↑μ univ < ⊤ ∧ ↑↑ν univ < ⊤

Next tactic:
exact ⟨measure_lt_top _ _, measure_lt_top _ _⟩
instance IsFiniteMeasure.average : IsFiniteMeasure ((μ univ)⁻¹ • μ) where
  measure_univ_lt_top := by
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
⊢ ↑↑((↑↑μ univ)⁻¹ • μ) univ < ⊤

Next tactic:
rw [smul_apply, smul_eq_mul, ← ENNReal.div_eq_inv_mul]
instance IsFiniteMeasure.average : IsFiniteMeasure ((μ univ)⁻¹ • μ) where
  measure_univ_lt_top := by
    rw [smul_apply, smul_eq_mul, ← ENNReal.div_eq_inv_mul]
    

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
⊢ ↑↑μ univ / ↑↑μ univ < ⊤

Next tactic:
exact ENNReal.div_self_le_one.trans_lt ENNReal.one_lt_top
instance isFiniteMeasureSMulOfNNRealTower {R} [SMul R ℝ≥0] [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0 ℝ≥0∞]
    [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [IsFiniteMeasure μ] {r : R} : IsFiniteMeasure (r • μ) := by
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝⁵ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
R : Type ?u.12260
inst✝⁴ : SMul R ℝ≥0
inst✝³ : SMul R ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝¹ : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝ : IsFiniteMeasure μ
r : R
⊢ IsFiniteMeasure (r • μ)

Next tactic:
rw [← smul_one_smul ℝ≥0 r μ]
instance isFiniteMeasureSMulOfNNRealTower {R} [SMul R ℝ≥0] [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0 ℝ≥0∞]
    [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [IsFiniteMeasure μ] {r : R} : IsFiniteMeasure (r • μ) := by
  rw [← smul_one_smul ℝ≥0 r μ]
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝⁵ : MeasurableSpace β
μ ν ν₁ ν₂ : Measure α
s t : Set α
R : Type ?u.12260
inst✝⁴ : SMul R ℝ≥0
inst✝³ : SMul R ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝¹ : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝ : IsFiniteMeasure μ
r : R
⊢ IsFiniteMeasure ((r • 1) • μ)

Next tactic:
infer_instance
@[instance]
theorem Measure.isFiniteMeasure_map {m : MeasurableSpace α} (μ : Measure α) [IsFiniteMeasure μ]
    (f : α → β) : IsFiniteMeasure (μ.map f) := by
  

Proof state:
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
m : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
f : α → β
⊢ IsFiniteMeasure (map f μ)

Next tactic:
by_cases hf : AEMeasurable f μ
@[instance]
theorem Measure.isFiniteMeasure_map {m : MeasurableSpace α} (μ : Measure α) [IsFiniteMeasure μ]
    (f : α → β) : IsFiniteMeasure (μ.map f) := by
  by_cases hf : AEMeasurable f μ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
m : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
f : α → β
hf : AEMeasurable f
⊢ IsFiniteMeasure (map f μ)

Next tactic:
constructor
@[instance]
theorem Measure.isFiniteMeasure_map {m : MeasurableSpace α} (μ : Measure α) [IsFiniteMeasure μ]
    (f : α → β) : IsFiniteMeasure (μ.map f) := by
  by_cases hf : AEMeasurable f μ
  · constructor
    

Proof state:
case pos.measure_univ_lt_top
α : Type u_1
β : Type u_2
δ : Type u_3
ι : Type u_4
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ✝ ν ν₁ ν₂ : Measure α
s t : Set α
m : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
f : α → β
hf : AEMeasurable f
⊢ ↑↑(map f μ) univ < ⊤

Next tactic:
rw [map_apply_of_aemeasurable hf MeasurableSet.univ]