l3lab/ntp-mathlib huggingface dataset:
protected theorem naturality {α β} (f : α → F β) (x : List α) :
    η (List.traverse f x) = List.traverse (@η _ ∘ f) x := by
  -- Porting note: added `ApplicativeTransformation` theorems
  induction x <;> 

Proof state:
case cons
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α : Type u_1
β : Type u
f : α → F β
head✝ : α
tail✝ : List α
tail_ih✝ :
  (fun {α} => ApplicativeTransformation.app η α) (List.traverse f tail✝) =
    List.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) tail✝
⊢ (fun {α} => ApplicativeTransformation.app η α) (List.traverse f (head✝ :: tail✝)) =
    List.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) (head✝ :: tail✝)

Next tactic:
simp! [*, functor_norm, ApplicativeTransformation.preserves_map,
    ApplicativeTransformation.preserves_seq, ApplicativeTransformation.preserves_pure]
@[simp]
theorem traverse_append :
    ∀ as bs : List α', traverse f (as ++ bs) = (· ++ ·) <$> traverse f as <*> traverse f bs
  | [], bs => by 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f : α' → F β'
inst✝ : LawfulApplicative F
bs : List α'
⊢ traverse f ([] ++ bs) = Seq.seq ((fun x x_1 => x ++ x_1) <$> traverse f []) fun x => traverse f bs

Next tactic:
simp [functor_norm]
@[simp]
theorem traverse_append :
    ∀ as bs : List α', traverse f (as ++ bs) = (· ++ ·) <$> traverse f as <*> traverse f bs
  | [], bs => by simp [functor_norm]
  | a :: as, bs => by 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f : α' → F β'
inst✝ : LawfulApplicative F
a : α'
as bs : List α'
⊢ traverse f (a :: as ++ bs) = Seq.seq ((fun x x_1 => x ++ x_1) <$> traverse f (a :: as)) fun x => traverse f bs

Next tactic:
simp [traverse_append as bs, functor_norm]
@[simp]
theorem traverse_append :
    ∀ as bs : List α', traverse f (as ++ bs) = (· ++ ·) <$> traverse f as <*> traverse f bs
  | [], bs => by simp [functor_norm]
  | a :: as, bs => by simp [traverse_append as bs, functor_norm]; 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f : α' → F β'
inst✝ : LawfulApplicative F
a : α'
as bs : List α'
⊢ (Seq.seq
      (Seq.seq (((fun x => x ∘ fun x x_1 => x ++ x_1) ∘ Function.comp ∘ fun x x_1 => x :: x_1) <$> f a) fun x =>
        traverse f as)
      fun x => traverse f bs) =
    Seq.seq (Seq.seq (((fun x => (fun x x_1 => x ++ x_1) ∘ x) ∘ fun x x_1 => x :: x_1) <$> f a) fun x => traverse f as)
      fun x => traverse f bs

Next tactic:
congr
theorem mem_traverse {f : α' → Set β'} :
    ∀ (l : List α') (n : List β'), n ∈ traverse f l ↔ Forall₂ (fun b a => b ∈ f a) n l
  | [], [] => by 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f✝ : α' → F β'
inst✝ : LawfulApplicative F
f : α' → Set β'
⊢ [] ∈ traverse f [] ↔ Forall₂ (fun b a => b ∈ f a) [] []

Next tactic:
simp
theorem mem_traverse {f : α' → Set β'} :
    ∀ (l : List α') (n : List β'), n ∈ traverse f l ↔ Forall₂ (fun b a => b ∈ f a) n l
  | [], [] => by simp
  | a :: as, [] => by 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f✝ : α' → F β'
inst✝ : LawfulApplicative F
f : α' → Set β'
a : α'
as : List α'
⊢ [] ∈ traverse f (a :: as) ↔ Forall₂ (fun b a => b ∈ f a) [] (a :: as)

Next tactic:
simp
theorem mem_traverse {f : α' → Set β'} :
    ∀ (l : List α') (n : List β'), n ∈ traverse f l ↔ Forall₂ (fun b a => b ∈ f a) n l
  | [], [] => by simp
  | a :: as, [] => by simp
  | [], b :: bs => by 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f✝ : α' → F β'
inst✝ : LawfulApplicative F
f : α' → Set β'
b : β'
bs : List β'
⊢ b :: bs ∈ traverse f [] ↔ Forall₂ (fun b a => b ∈ f a) (b :: bs) []

Next tactic:
simp
theorem mem_traverse {f : α' → Set β'} :
    ∀ (l : List α') (n : List β'), n ∈ traverse f l ↔ Forall₂ (fun b a => b ∈ f a) n l
  | [], [] => by simp
  | a :: as, [] => by simp
  | [], b :: bs => by simp
  | a :: as, b :: bs => by 

Proof state:
F G : Type u → Type u
inst✝² : Applicative F
inst✝¹ : Applicative G
α' β' : Type u
f✝ : α' → F β'
inst✝ : LawfulApplicative F
f : α' → Set β'
a : α'
as : List α'
b : β'
bs : List β'
⊢ b :: bs ∈ traverse f (a :: as) ↔ Forall₂ (fun b a => b ∈ f a) (b :: bs) (a :: as)

Next tactic:
simp [mem_traverse as bs]
protected theorem traverse_map {α β γ : Type u} (g : α → β) (f : β → G γ) (x : σ ⊕ α) :
    Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x := by
  

Proof state:
σ : Type u
F G : Type u → Type u
inst✝¹ : Applicative F
inst✝ : Applicative G
α β γ : Type u
g : α → β
f : β → G γ
x : σ ⊕ α
⊢ Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x

Next tactic:
cases x
protected theorem traverse_map {α β γ : Type u} (g : α → β) (f : β → G γ) (x : σ ⊕ α) :
    Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x := by
  cases x <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝¹ : Applicative F
inst✝ : Applicative G
α β γ : Type u
g : α → β
f : β → G γ
val✝ : σ
⊢ Sum.traverse f (g <$> inl val✝) = Sum.traverse (f ∘ g) (inl val✝)

Next tactic:
simp [Sum.traverse, id_map, functor_norm]
protected theorem traverse_map {α β γ : Type u} (g : α → β) (f : β → G γ) (x : σ ⊕ α) :
    Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x := by
  cases x <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝¹ : Applicative F
inst✝ : Applicative G
α β γ : Type u
g : α → β
f : β → G γ
val✝ : α
⊢ Sum.traverse f (g <$> inr val✝) = Sum.traverse (f ∘ g) (inr val✝)

Next tactic:
simp [Sum.traverse, id_map, functor_norm]
protected theorem traverse_map {α β γ : Type u} (g : α → β) (f : β → G γ) (x : σ ⊕ α) :
    Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x := by
  cases x <;> simp [Sum.traverse, id_map, functor_norm] <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝¹ : Applicative F
inst✝ : Applicative G
α β γ : Type u
g : α → β
f : β → G γ
val✝ : σ
⊢ (match g <$> inl val✝ with
    | inl x => pure (inl x)
    | inr x => inr <$> f x) =
    pure (inl val✝)

Next tactic:
rfl
protected theorem traverse_map {α β γ : Type u} (g : α → β) (f : β → G γ) (x : σ ⊕ α) :
    Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x := by
  cases x <;> simp [Sum.traverse, id_map, functor_norm] <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝¹ : Applicative F
inst✝ : Applicative G
α β γ : Type u
g : α → β
f : β → G γ
val✝ : α
⊢ (match g <$> inr val✝ with
    | inl x => pure (inl x)
    | inr x => inr <$> f x) =
    inr <$> f (g val✝)

Next tactic:
rfl
protected theorem id_traverse {σ α} (x : σ ⊕ α) :
    Sum.traverse (pure : α → Id α) x = x := by 

Proof state:
σ✝ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
σ α : Type u_1
x : σ ⊕ α
⊢ Sum.traverse pure x = x

Next tactic:
cases x
protected theorem id_traverse {σ α} (x : σ ⊕ α) :
    Sum.traverse (pure : α → Id α) x = x := by cases x <;> 

Proof state:
case inl
σ✝ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
σ α : Type u_1
val✝ : σ
⊢ Sum.traverse pure (inl val✝) = inl val✝

Next tactic:
rfl
protected theorem id_traverse {σ α} (x : σ ⊕ α) :
    Sum.traverse (pure : α → Id α) x = x := by cases x <;> 

Proof state:
case inr
σ✝ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
σ α : Type u_1
val✝ : α
⊢ Sum.traverse pure (inr val✝) = inr val✝

Next tactic:
rfl
protected theorem comp_traverse {α β γ : Type u} (f : β → F γ) (g : α → G β) (x : σ ⊕ α) :
    Sum.traverse (Comp.mk ∘ (f <$> ·) ∘ g) x =
    Comp.mk.{u} (Sum.traverse f <$> Sum.traverse g x) := by
  

Proof state:
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
x : σ ⊕ α
⊢ Sum.traverse (Comp.mk ∘ (fun x => f <$> x) ∘ g) x = Comp.mk (Sum.traverse f <$> Sum.traverse g x)

Next tactic:
cases x
protected theorem comp_traverse {α β γ : Type u} (f : β → F γ) (g : α → G β) (x : σ ⊕ α) :
    Sum.traverse (Comp.mk ∘ (f <$> ·) ∘ g) x =
    Comp.mk.{u} (Sum.traverse f <$> Sum.traverse g x) := by
  cases x <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
val✝ : σ
⊢ Sum.traverse (Comp.mk ∘ (fun x => f <$> x) ∘ g) (inl val✝) = Comp.mk (Sum.traverse f <$> Sum.traverse g (inl val✝))

Next tactic:
simp! [Sum.traverse, map_id, functor_norm]
protected theorem comp_traverse {α β γ : Type u} (f : β → F γ) (g : α → G β) (x : σ ⊕ α) :
    Sum.traverse (Comp.mk ∘ (f <$> ·) ∘ g) x =
    Comp.mk.{u} (Sum.traverse f <$> Sum.traverse g x) := by
  cases x <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
val✝ : α
⊢ Sum.traverse (Comp.mk ∘ (fun x => f <$> x) ∘ g) (inr val✝) = Comp.mk (Sum.traverse f <$> Sum.traverse g (inr val✝))

Next tactic:
simp! [Sum.traverse, map_id, functor_norm]
protected theorem comp_traverse {α β γ : Type u} (f : β → F γ) (g : α → G β) (x : σ ⊕ α) :
    Sum.traverse (Comp.mk ∘ (f <$> ·) ∘ g) x =
    Comp.mk.{u} (Sum.traverse f <$> Sum.traverse g x) := by
  cases x <;> simp! [Sum.traverse, map_id, functor_norm] <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
val✝ : σ
⊢ pure (inl val✝) = Comp.mk (pure (pure (inl val✝)))

Next tactic:
rfl
protected theorem comp_traverse {α β γ : Type u} (f : β → F γ) (g : α → G β) (x : σ ⊕ α) :
    Sum.traverse (Comp.mk ∘ (f <$> ·) ∘ g) x =
    Comp.mk.{u} (Sum.traverse f <$> Sum.traverse g x) := by
  cases x <;> simp! [Sum.traverse, map_id, functor_norm] <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
val✝ : α
⊢ Comp.mk (((fun x => inr <$> x) ∘ f) <$> g val✝) = Comp.mk ((Sum.traverse f ∘ inr) <$> g val✝)

Next tactic:
rfl
protected theorem traverse_eq_map_id {α β} (f : α → β) (x : σ ⊕ α) :
    Sum.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x) := by
  

Proof state:
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β : Type u
f : α → β
x : σ ⊕ α
⊢ Sum.traverse (pure ∘ f) x = pure (f <$> x)

Next tactic:
induction x
protected theorem traverse_eq_map_id {α β} (f : α → β) (x : σ ⊕ α) :
    Sum.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x) := by
  induction x <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β : Type u
f : α → β
val✝ : σ
⊢ Sum.traverse (pure ∘ f) (inl val✝) = pure (f <$> inl val✝)

Next tactic:
simp! [*, functor_norm]
protected theorem traverse_eq_map_id {α β} (f : α → β) (x : σ ⊕ α) :
    Sum.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x) := by
  induction x <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β : Type u
f : α → β
val✝ : α
⊢ Sum.traverse (pure ∘ f) (inr val✝) = pure (f <$> inr val✝)

Next tactic:
simp! [*, functor_norm]
protected theorem traverse_eq_map_id {α β} (f : α → β) (x : σ ⊕ α) :
    Sum.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x) := by
  induction x <;> simp! [*, functor_norm] <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β : Type u
f : α → β
val✝ : σ
⊢ inl val✝ = f <$> inl val✝

Next tactic:
rfl
protected theorem traverse_eq_map_id {α β} (f : α → β) (x : σ ⊕ α) :
    Sum.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x) := by
  induction x <;> simp! [*, functor_norm] <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β : Type u
f : α → β
val✝ : α
⊢ inr (f val✝) = f <$> inr val✝

Next tactic:
rfl
protected theorem map_traverse {α β γ} (g : α → G β) (f : β → γ) (x : σ ⊕ α) :
    (f <$> ·) <$> Sum.traverse g x = Sum.traverse (f <$> g ·) x := by
  

Proof state:
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α : Type u_1
β γ : Type u
g : α → G β
f : β → γ
x : σ ⊕ α
⊢ (fun x => f <$> x) <$> Sum.traverse g x = Sum.traverse (fun x => f <$> g x) x

Next tactic:
cases x
protected theorem map_traverse {α β γ} (g : α → G β) (f : β → γ) (x : σ ⊕ α) :
    (f <$> ·) <$> Sum.traverse g x = Sum.traverse (f <$> g ·) x := by
  cases x <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α : Type u_1
β γ : Type u
g : α → G β
f : β → γ
val✝ : σ
⊢ (fun x => f <$> x) <$> Sum.traverse g (inl val✝) = Sum.traverse (fun x => f <$> g x) (inl val✝)

Next tactic:
simp [Sum.traverse, id_map, functor_norm]
protected theorem map_traverse {α β γ} (g : α → G β) (f : β → γ) (x : σ ⊕ α) :
    (f <$> ·) <$> Sum.traverse g x = Sum.traverse (f <$> g ·) x := by
  cases x <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α : Type u_1
β γ : Type u
g : α → G β
f : β → γ
val✝ : α
⊢ (fun x => f <$> x) <$> Sum.traverse g (inr val✝) = Sum.traverse (fun x => f <$> g x) (inr val✝)

Next tactic:
simp [Sum.traverse, id_map, functor_norm]
protected theorem map_traverse {α β γ} (g : α → G β) (f : β → γ) (x : σ ⊕ α) :
    (f <$> ·) <$> Sum.traverse g x = Sum.traverse (f <$> g ·) x := by
  cases x <;> simp [Sum.traverse, id_map, functor_norm] <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α : Type u_1
β γ : Type u
g : α → G β
f : β → γ
val✝ : σ
⊢ pure (f <$> inl val✝) = pure (inl val✝)

Next tactic:
congr
protected theorem map_traverse {α β γ} (g : α → G β) (f : β → γ) (x : σ ⊕ α) :
    (f <$> ·) <$> Sum.traverse g x = Sum.traverse (f <$> g ·) x := by
  cases x <;> simp [Sum.traverse, id_map, functor_norm] <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α : Type u_1
β γ : Type u
g : α → G β
f : β → γ
val✝ : α
⊢ ((fun x => f <$> x) ∘ inr) <$> g val✝ = (inr ∘ f) <$> g val✝

Next tactic:
congr
protected theorem naturality {α β} (f : α → F β) (x : σ ⊕ α) :
    η (Sum.traverse f x) = Sum.traverse (@η _ ∘ f) x := by
  -- Porting note: added `ApplicativeTransformation` theorems
  

Proof state:
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α : Type u_1
β : Type u
f : α → F β
x : σ ⊕ α
⊢ (fun {α} => ApplicativeTransformation.app η α) (Sum.traverse f x) =
    Sum.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) x

Next tactic:
cases x
protected theorem naturality {α β} (f : α → F β) (x : σ ⊕ α) :
    η (Sum.traverse f x) = Sum.traverse (@η _ ∘ f) x := by
  -- Porting note: added `ApplicativeTransformation` theorems
  cases x <;> 

Proof state:
case inl
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α : Type u_1
β : Type u
f : α → F β
val✝ : σ
⊢ (fun {α} => ApplicativeTransformation.app η α) (Sum.traverse f (inl val✝)) =
    Sum.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) (inl val✝)

Next tactic:
simp! [Sum.traverse, functor_norm, ApplicativeTransformation.preserves_map,
    ApplicativeTransformation.preserves_seq, ApplicativeTransformation.preserves_pure]
protected theorem naturality {α β} (f : α → F β) (x : σ ⊕ α) :
    η (Sum.traverse f x) = Sum.traverse (@η _ ∘ f) x := by
  -- Porting note: added `ApplicativeTransformation` theorems
  cases x <;> 

Proof state:
case inr
σ : Type u
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α : Type u_1
β : Type u
f : α → F β
val✝ : α
⊢ (fun {α} => ApplicativeTransformation.app η α) (Sum.traverse f (inr val✝)) =
    Sum.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) (inr val✝)

Next tactic:
simp! [Sum.traverse, functor_norm, ApplicativeTransformation.preserves_map,
    ApplicativeTransformation.preserves_seq, ApplicativeTransformation.preserves_pure]
@[simp]
theorem trim_eq_self [MeasurableSpace α] {μ : Measure α} : μ.trim le_rfl = μ := by
  

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
μ : Measure α
⊢ Measure.trim μ (_ : inst✝ ≤ inst✝) = μ

Next tactic:
simp [Measure.trim]
theorem toOuterMeasure_trim_eq_trim_toOuterMeasure (μ : Measure α) (hm : m ≤ m0) :
    @Measure.toOuterMeasure _ m (μ.trim hm) = @OuterMeasure.trim _ m μ.toOuterMeasure := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ✝ : Measure α
s : Set α
μ : Measure α
hm : m ≤ m0
⊢ ↑(Measure.trim μ hm) = OuterMeasure.trim ↑μ

Next tactic:
rw [Measure.trim, toMeasure_toOuterMeasure (ms := m)]
@[simp]
theorem zero_trim (hm : m ≤ m0) : (0 : Measure α).trim hm = (0 : @Measure α m) := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
⊢ Measure.trim 0 hm = 0

Next tactic:
simp [Measure.trim, @OuterMeasure.toMeasure_zero _ m]
theorem trim_measurableSet_eq (hm : m ≤ m0) (hs : @MeasurableSet α m s) : μ.trim hm s = μ s := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
hs : MeasurableSet s
⊢ ↑↑(Measure.trim μ hm) s = ↑↑μ s

Next tactic:
rw [Measure.trim, toMeasure_apply (ms := m) _ _ hs]
theorem le_trim (hm : m ≤ m0) : μ s ≤ μ.trim hm s := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
⊢ ↑↑μ s ≤ ↑↑(Measure.trim μ hm) s

Next tactic:
simp_rw [Measure.trim]
theorem le_trim (hm : m ≤ m0) : μ s ≤ μ.trim hm s := by
  simp_rw [Measure.trim]
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
⊢ ↑↑μ s ≤ ↑↑(OuterMeasure.toMeasure ↑μ (_ : m ≤ OuterMeasure.caratheodory ↑μ)) s

Next tactic:
exact @le_toMeasure_apply _ m _ _ _
theorem measure_trim_toMeasurable_eq_zero {hm : m ≤ m0} (hs : μ.trim hm s = 0) :
    μ (@toMeasurable α m (μ.trim hm) s) = 0 :=
  measure_eq_zero_of_trim_eq_zero hm (by 

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
hs : ↑↑(Measure.trim μ hm) s = 0
⊢ ↑↑(Measure.trim μ hm) (toMeasurable (Measure.trim μ hm) s) = 0

Next tactic:
rwa [@measure_toMeasurable _ m]
theorem trim_trim {m₁ m₂ : MeasurableSpace α} {hm₁₂ : m₁ ≤ m₂} {hm₂ : m₂ ≤ m0} :
    (μ.trim hm₂).trim hm₁₂ = μ.trim (hm₁₂.trans hm₂) := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
m₁ m₂ : MeasurableSpace α
hm₁₂ : m₁ ≤ m₂
hm₂ : m₂ ≤ m0
⊢ Measure.trim (Measure.trim μ hm₂) hm₁₂ = Measure.trim μ (_ : m₁ ≤ m0)

Next tactic:
refine @Measure.ext _ m₁ _ _ (fun t ht => ?_)
theorem trim_trim {m₁ m₂ : MeasurableSpace α} {hm₁₂ : m₁ ≤ m₂} {hm₂ : m₂ ≤ m0} :
    (μ.trim hm₂).trim hm₁₂ = μ.trim (hm₁₂.trans hm₂) := by
  refine @Measure.ext _ m₁ _ _ (fun t ht => ?_)
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
m₁ m₂ : MeasurableSpace α
hm₁₂ : m₁ ≤ m₂
hm₂ : m₂ ≤ m0
t : Set α
ht : MeasurableSet t
⊢ ↑↑(Measure.trim (Measure.trim μ hm₂) hm₁₂) t = ↑↑(Measure.trim μ (_ : m₁ ≤ m0)) t

Next tactic:
rw [trim_measurableSet_eq hm₁₂ ht, trim_measurableSet_eq (hm₁₂.trans hm₂) ht,
    trim_measurableSet_eq hm₂ (hm₁₂ t ht)]
theorem restrict_trim (hm : m ≤ m0) (μ : Measure α) (hs : @MeasurableSet α m s) :
    @Measure.restrict α m (μ.trim hm) s = (μ.restrict s).trim hm := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ✝ : Measure α
s : Set α
hm : m ≤ m0
μ : Measure α
hs : MeasurableSet s
⊢ Measure.restrict (Measure.trim μ hm) s = Measure.trim (Measure.restrict μ s) hm

Next tactic:
refine @Measure.ext _ m _ _ (fun t ht => ?_)
theorem restrict_trim (hm : m ≤ m0) (μ : Measure α) (hs : @MeasurableSet α m s) :
    @Measure.restrict α m (μ.trim hm) s = (μ.restrict s).trim hm := by
  refine @Measure.ext _ m _ _ (fun t ht => ?_)
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ✝ : Measure α
s : Set α
hm : m ≤ m0
μ : Measure α
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
⊢ ↑↑(Measure.restrict (Measure.trim μ hm) s) t = ↑↑(Measure.trim (Measure.restrict μ s) hm) t

Next tactic:
rw [@Measure.restrict_apply α m _ _ _ ht, trim_measurableSet_eq hm ht,
    Measure.restrict_apply (hm t ht),
    trim_measurableSet_eq hm (@MeasurableSet.inter α m t s ht hs)]
instance isFiniteMeasure_trim (hm : m ≤ m0) [IsFiniteMeasure μ] : IsFiniteMeasure (μ.trim hm) where
  measure_univ_lt_top := by
    

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
inst✝ : IsFiniteMeasure μ
⊢ ↑↑(Measure.trim μ hm) Set.univ < ⊤

Next tactic:
rw [trim_measurableSet_eq hm (@MeasurableSet.univ _ m)]
instance isFiniteMeasure_trim (hm : m ≤ m0) [IsFiniteMeasure μ] : IsFiniteMeasure (μ.trim hm) where
  measure_univ_lt_top := by
    rw [trim_measurableSet_eq hm (@MeasurableSet.univ _ m)]
    

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hm : m ≤ m0
inst✝ : IsFiniteMeasure μ
⊢ ↑↑μ Set.univ < ⊤

Next tactic:
exact measure_lt_top _ _
theorem sigmaFiniteTrim_mono {m m₂ m0 : MeasurableSpace α} {μ : Measure α} (hm : m ≤ m0)
    (hm₂ : m₂ ≤ m) [SigmaFinite (μ.trim (hm₂.trans hm))] : SigmaFinite (μ.trim hm) := by
  

Proof state:
α : Type u_1
m✝ m0✝ : MeasurableSpace α
μ✝ : Measure α
s : Set α
m m₂ m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hm₂ : m₂ ≤ m
inst✝ : SigmaFinite (Measure.trim μ (_ : m₂ ≤ m0))
⊢ SigmaFinite (Measure.trim μ hm)

Next tactic:
have _ := Measure.FiniteSpanningSetsIn (μ.trim (hm₂.trans hm)) Set.univ
theorem sigmaFiniteTrim_mono {m m₂ m0 : MeasurableSpace α} {μ : Measure α} (hm : m ≤ m0)
    (hm₂ : m₂ ≤ m) [SigmaFinite (μ.trim (hm₂.trans hm))] : SigmaFinite (μ.trim hm) := by
  have _ := Measure.FiniteSpanningSetsIn (μ.trim (hm₂.trans hm)) Set.univ
  

Proof state:
α : Type u_1
m✝ m0✝ : MeasurableSpace α
μ✝ : Measure α
s : Set α
m m₂ m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hm₂ : m₂ ≤ m
inst✝ : SigmaFinite (Measure.trim μ (_ : m₂ ≤ m0))
x✝ : Type u_1
⊢ SigmaFinite (Measure.trim μ hm)

Next tactic:
refine' Measure.FiniteSpanningSetsIn.sigmaFinite _
theorem sigmaFiniteTrim_mono {m m₂ m0 : MeasurableSpace α} {μ : Measure α} (hm : m ≤ m0)
    (hm₂ : m₂ ≤ m) [SigmaFinite (μ.trim (hm₂.trans hm))] : SigmaFinite (μ.trim hm) := by
  have _ := Measure.FiniteSpanningSetsIn (μ.trim (hm₂.trans hm)) Set.univ
  refine' Measure.FiniteSpanningSetsIn.sigmaFinite _
  · 

Proof state:
case refine'_1
α : Type u_1
m✝ m0✝ : MeasurableSpace α
μ✝ : Measure α
s : Set α
m m₂ m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hm₂ : m₂ ≤ m
inst✝ : SigmaFinite (Measure.trim μ (_ : m₂ ≤ m0))
x✝ : Type u_1
⊢ Set (Set α)

Next tactic:
exact Set.univ