formal
stringlengths
41
427k
informal
stringclasses
1 value
List.foldr_eq_foldrTR ** ⊢ @foldr = @foldrTR ** funext α β f init l ** case h.h.h.h.h α : Type u_2 β : Type u_1 f : α → β → β init : β l : List α ⊢ foldr f init l = foldrTR f init l ** simp [foldrTR, Array.foldr_eq_foldr_data, -Array.size_toArray] ** Qed
List.unzip_eq_unzipTR ** ⊢ @unzip = @unzipTR ** funext α β l ** case h.h.h α : Type u_2 β : Type u_1 l : List (α × β) ⊢ unzip l = unzipTR l ** simp [unzipTR] ** case h.h.h α : Type u_2 β : Type u_1 l : List (α × β) ⊢ unzip l = foldr (fun x x_1 => (x.fst :: x_1.fst, x.snd :: x_1.snd)) ([], []) l ** induction l <;> simp [*] ** Qed
List.enumFrom_eq_enumFromTR ** ⊢ @enumFrom = @enumFromTR ** funext α n l ** case h.h.h α : Type u_1 n : Nat l : List α ⊢ enumFrom n l = enumFromTR n l ** simp [enumFromTR, -Array.size_toArray] ** case h.h.h α : Type u_1 n : Nat l : List α ⊢ enumFrom n l = (Array.foldr (fun a x => (x.fst - 1, (x.fst - 1, a) :: x.snd)) (n + Array.size (toArray l), []) (toArray l) (Array.size (toArray l))).snd ** let f := fun (a : α) (n, acc) => (n-1, (n-1, a) :: acc) ** case h.h.h α : Type u_1 n : Nat l : List α f : α → Nat × List (Nat × α) → Nat × List (Nat × α) := fun a x => match x with | (n, acc) => (n - 1, (n - 1, a) :: acc) ⊢ enumFrom n l = (Array.foldr (fun a x => (x.fst - 1, (x.fst - 1, a) :: x.snd)) (n + Array.size (toArray l), []) (toArray l) (Array.size (toArray l))).snd ** rw [Array.foldr_eq_foldr_data] ** case h.h.h α : Type u_1 n : Nat l : List α f : α → Nat × List (Nat × α) → Nat × List (Nat × α) := fun a x => match x with | (n, acc) => (n - 1, (n - 1, a) :: acc) ⊢ enumFrom n l = (foldr (fun a x => (x.fst - 1, (x.fst - 1, a) :: x.snd)) (n + Array.size (toArray l), []) (toArray l).data).snd ** simp [go] ** α : Type u_1 n✝ : Nat l : List α f : α → Nat × List (Nat × α) → Nat × List (Nat × α) := fun a x => match x with | (n, acc) => (n - 1, (n - 1, a) :: acc) a : α as : List α n : Nat ⊢ foldr f (n + length (a :: as), []) (a :: as) = (n, enumFrom n (a :: as)) ** rw [← show _ + as.length = n + (a::as).length from Nat.succ_add .., foldr, go as] ** α : Type u_1 n✝ : Nat l : List α f : α → Nat × List (Nat × α) → Nat × List (Nat × α) := fun a x => match x with | (n, acc) => (n - 1, (n - 1, a) :: acc) a : α as : List α n : Nat ⊢ f a (Nat.succ n, enumFrom (Nat.succ n) as) = (n, enumFrom n (a :: as)) ** simp [enumFrom] ** α : Type u_1 n✝ : Nat l : List α f : α → Nat × List (Nat × α) → Nat × List (Nat × α) := fun a x => match x with | (n, acc) => (n - 1, (n - 1, a) :: acc) a : α as : List α n : Nat ⊢ Nat.succ n - 1 = n ** rfl ** Qed
List.dropLast_eq_dropLastTR ** ⊢ @dropLast = @dropLastTR ** funext α l ** case h.h α : Type u_1 l : List α ⊢ dropLast l = dropLastTR l ** simp [dropLastTR] ** Qed
List.intersperse_eq_intersperseTR ** ⊢ @intersperse = @intersperseTR ** funext α sep l ** case h.h.h α : Type u_1 sep : α l : List α ⊢ intersperse sep l = intersperseTR sep l ** simp [intersperseTR] ** case h.h.h α : Type u_1 sep : α l : List α ⊢ intersperse sep l = match l with | [] => [] | [x] => [x] | x :: y :: xs => x :: sep :: y :: foldr (fun a r => sep :: a :: r) [] xs ** match l with | [] | [_] => rfl | x::y::xs => simp [intersperse]; induction xs generalizing y <;> simp [*] ** α : Type u_1 sep : α l : List α head✝ : α ⊢ intersperse sep [head✝] = match [head✝] with | [] => [] | [x] => [x] | x :: y :: xs => x :: sep :: y :: foldr (fun a r => sep :: a :: r) [] xs ** rfl ** α : Type u_1 sep : α l : List α x y : α xs : List α ⊢ intersperse sep (x :: y :: xs) = match x :: y :: xs with | [] => [] | [x] => [x] | x :: y :: xs => x :: sep :: y :: foldr (fun a r => sep :: a :: r) [] xs ** simp [intersperse] ** α : Type u_1 sep : α l : List α x y : α xs : List α ⊢ intersperse sep (y :: xs) = y :: foldr (fun a r => sep :: a :: r) [] xs ** induction xs generalizing y <;> simp [*] ** Qed
List.intercalate_eq_intercalateTR ** ⊢ @intercalate = @intercalateTR ** funext α sep l ** case h.h.h α : Type u_1 sep : List α l : List (List α) ⊢ intercalate sep l = intercalateTR sep l ** simp [intercalate, intercalateTR] ** case h.h.h α : Type u_1 sep : List α l : List (List α) ⊢ join (intersperse sep l) = match l with | [] => [] | [x] => x | x :: xs => intercalateTR.go (toArray sep) x xs #[] ** match l with | [] => rfl | [_] => simp | x::y::xs => let rec go {acc x} : ∀ xs, intercalateTR.go sep.toArray x xs acc = acc.data ++ join (intersperse sep (x::xs)) | [] => by simp [intercalateTR.go] | _::_ => by simp [intercalateTR.go, go] simp [intersperse, go] ** α : Type u_1 sep : List α l : List (List α) ⊢ join (intersperse sep []) = match [] with | [] => [] | [x] => x | x :: xs => intercalateTR.go (toArray sep) x xs #[] ** rfl ** α : Type u_1 sep : List α l : List (List α) head✝ : List α ⊢ join (intersperse sep [head✝]) = match [head✝] with | [] => [] | [x] => x | x :: xs => intercalateTR.go (toArray sep) x xs #[] ** simp ** α : Type u_1 sep : List α l : List (List α) x y : List α xs : List (List α) ⊢ join (intersperse sep (x :: y :: xs)) = match x :: y :: xs with | [] => [] | [x] => x | x :: xs => intercalateTR.go (toArray sep) x xs #[] ** simp [intersperse, go] ** α : Type u_1 sep : List α l : List (List α) x✝ y : List α xs : List (List α) acc : Array α x : List α ⊢ intercalateTR.go (toArray sep) x [] acc = acc.data ++ join (intersperse sep [x]) ** simp [intercalateTR.go] ** α : Type u_1 sep : List α l : List (List α) x✝ y : List α xs : List (List α) acc : Array α x head✝ : List α tail✝ : List (List α) ⊢ intercalateTR.go (toArray sep) x (head✝ :: tail✝) acc = acc.data ++ join (intersperse sep (x :: head✝ :: tail✝)) ** simp [intercalateTR.go, go] ** Qed
List.removeNth_eq_removeNthTR ** ⊢ @removeNth = @removeNthTR ** funext α l n ** case h.h.h α : Type u_1 l : List α n : Nat ⊢ removeNth l n = removeNthTR l n ** simp [removeNthTR] ** case h.h.h α : Type u_1 l : List α n : Nat ⊢ removeNth l n = removeNthTR.go l l n #[] ** suffices ∀ xs acc, l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ xs.removeNth n from (this l #[] (by simp)).symm ** case h.h.h α : Type u_1 l : List α n : Nat ⊢ ∀ (xs : List α) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n ** intro xs ** α : Type u_1 l : List α n : Nat this : ∀ (xs : List α) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n ⊢ l = #[].data ++ l ** simp ** case h.h.h.nil α : Type u_1 l : List α n : Nat acc : Array α ⊢ l = acc.data ++ [] → removeNthTR.go l [] n acc = acc.data ++ removeNth [] n ** simp [removeNth, removeNthTR.go] ** case h.h.h.cons α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n n : Nat acc : Array α ⊢ l = acc.data ++ x :: xs → removeNthTR.go l (x :: xs) n acc = acc.data ++ removeNth (x :: xs) n ** cases n <;> simp [removeNth, removeNthTR.go, *] ** case h.h.h.cons.succ α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n acc : Array α n✝ : Nat ⊢ l = acc.data ++ x :: xs → removeNthTR.go l xs n✝ (Array.push acc x) = acc.data ++ x :: removeNth xs n✝ ** intro h ** case h.h.h.cons.succ α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n acc : Array α n✝ : Nat h : l = acc.data ++ x :: xs ⊢ removeNthTR.go l xs n✝ (Array.push acc x) = acc.data ++ x :: removeNth xs n✝ ** rw [IH] ** case h.h.h.cons.succ α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n acc : Array α n✝ : Nat h : l = acc.data ++ x :: xs ⊢ (Array.push acc x).data ++ removeNth xs n✝ = acc.data ++ x :: removeNth xs n✝ case h.h.h.cons.succ.a α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n acc : Array α n✝ : Nat h : l = acc.data ++ x :: xs ⊢ l = (Array.push acc x).data ++ xs ** simp ** case h.h.h.cons.succ.a α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n acc : Array α n✝ : Nat h : l = acc.data ++ x :: xs ⊢ l = (Array.push acc x).data ++ xs ** simp ** case h.h.h.cons.succ.a α : Type u_1 l : List α x : α xs : List α IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → removeNthTR.go l xs n acc = acc.data ++ removeNth xs n acc : Array α n✝ : Nat h : l = acc.data ++ x :: xs ⊢ l = acc.data ++ x :: xs ** exact h ** Qed
List.replaceF_eq_replaceFTR ** ⊢ @replaceF = @replaceFTR ** funext α p l ** case h.h.h α : Type u_1 p : α → Option α l : List α ⊢ replaceF p l = replaceFTR p l ** simp [replaceFTR] ** case h.h.h α : Type u_1 p : α → Option α l : List α ⊢ replaceF p l = replaceFTR.go p l #[] ** exact (go #[] _).symm ** α : Type u_1 p : α → Option α l : List α acc : Array α ⊢ replaceFTR.go p [] acc = acc.data ++ replaceF p [] ** simp [replaceFTR.go, replaceF] ** α : Type u_1 p : α → Option α l : List α acc : Array α x : α xs : List α ⊢ replaceFTR.go p (x :: xs) acc = acc.data ++ replaceF p (x :: xs) ** simp [replaceFTR.go, replaceF] ** α : Type u_1 p : α → Option α l : List α acc : Array α x : α xs : List α ⊢ (match p x with | none => replaceFTR.go p xs (Array.push acc x) | some a' => acc.data ++ a' :: xs) = acc.data ++ match p x with | none => x :: replaceF p xs | some a => a :: xs ** cases p x <;> simp ** case none α : Type u_1 p : α → Option α l : List α acc : Array α x : α xs : List α ⊢ replaceFTR.go p xs (Array.push acc x) = acc.data ++ x :: replaceF p xs ** rw [go _ xs] ** case none α : Type u_1 p : α → Option α l : List α acc : Array α x : α xs : List α ⊢ (Array.push acc x).data ++ replaceF p xs = acc.data ++ x :: replaceF p xs ** simp ** Qed
List.splitOnP_eq_splitOnPTR ** ⊢ @splitOnP = @splitOnPTR ** funext α P l ** case h.h.h α : Type u_1 P : α → Bool l : List α ⊢ splitOnP P l = splitOnPTR P l ** simp [splitOnPTR] ** case h.h.h α : Type u_1 P : α → Bool l : List α ⊢ splitOnP P l = splitOnPTR.go P l #[] #[] ** suffices ∀ xs acc r, splitOnPTR.go P xs acc r = r.data ++ splitOnP.go P xs acc.data.reverse from (this l #[] #[]).symm ** case h.h.h α : Type u_1 P : α → Bool l : List α ⊢ ∀ (xs : List α) (acc : Array α) (r : Array (List α)), splitOnPTR.go P xs acc r = r.data ++ splitOnP.go P xs (reverse acc.data) ** intro xs acc r ** case h.h.h α : Type u_1 P : α → Bool l xs : List α acc : Array α r : Array (List α) ⊢ splitOnPTR.go P xs acc r = r.data ++ splitOnP.go P xs (reverse acc.data) ** induction xs generalizing acc r with simp [splitOnP.go, splitOnPTR.go] | cons x xs IH => cases P x <;> simp [*] ** case h.h.h.cons α : Type u_1 P : α → Bool l : List α x : α xs : List α IH : ∀ (acc : Array α) (r : Array (List α)), splitOnPTR.go P xs acc r = r.data ++ splitOnP.go P xs (reverse acc.data) acc : Array α r : Array (List α) ⊢ (bif P x then splitOnPTR.go P xs #[] (Array.push r acc.data) else splitOnPTR.go P xs (Array.push acc x) r) = r.data ++ if P x = true then acc.data :: splitOnP.go P xs [] else splitOnP.go P xs (x :: reverse acc.data) ** cases P x <;> simp [*] ** Qed
List.modifyNthTR_go_eq ** α✝ : Type u_1 f : α✝ → α✝ acc : Array α✝ n : Nat ⊢ modifyNthTR.go f [] n acc = acc.data ++ modifyNth f n [] ** cases n <;> simp [modifyNthTR.go, modifyNth] ** α✝ : Type u_1 f : α✝ → α✝ acc : Array α✝ a : α✝ l : List α✝ ⊢ modifyNthTR.go f (a :: l) 0 acc = acc.data ++ modifyNth f 0 (a :: l) ** simp [modifyNthTR.go, modifyNth] ** α✝ : Type u_1 f : α✝ → α✝ acc : Array α✝ a : α✝ l : List α✝ n : Nat ⊢ modifyNthTR.go f (a :: l) (n + 1) acc = acc.data ++ modifyNth f (n + 1) (a :: l) ** simp [modifyNthTR.go, modifyNth, modifyNthTR_go_eq l] ** Qed
List.insertNthTR_go_eq ** α✝ : Type u_1 a : α✝ acc : Array α✝ n✝ : Nat ⊢ insertNthTR.go a (n✝ + 1) [] acc = acc.data ++ insertNth (n✝ + 1) a [] ** simp [insertNthTR.go, insertNth] ** α✝ : Type u_1 a✝ : α✝ acc : Array α✝ n : Nat a : α✝ l : List α✝ ⊢ insertNthTR.go a✝ (n + 1) (a :: l) acc = acc.data ++ insertNth (n + 1) a✝ (a :: l) ** simp [insertNthTR.go, insertNth, insertNthTR_go_eq n l] ** Qed
List.headD_eq_head? ** α : Type u_1 l : List α a : α ⊢ headD l a = Option.getD (head? l) a ** cases l <;> rfl ** Qed
List.takeD_succ ** α : Type u_1 n : Nat l : List α a : α ⊢ takeD (n + 1) l a = Option.getD (head? l) a :: takeD n (tail l) a ** simp [takeD] ** Qed
List.takeD_nil ** α : Type u_1 n : Nat a : α ⊢ takeD n [] a = replicate n a ** induction n <;> simp [*] ** Qed
List.takeDTR_go_eq ** α✝ : Type u_1 dflt : α✝ acc : Array α✝ x✝ : List α✝ ⊢ takeDTR.go dflt 0 x✝ acc = acc.data ++ takeD 0 x✝ dflt ** simp [takeDTR.go] ** α✝ : Type u_1 dflt : α✝ acc : Array α✝ n✝ : Nat ⊢ takeDTR.go dflt (n✝ + 1) [] acc = acc.data ++ takeD (n✝ + 1) [] dflt ** simp [takeDTR.go] ** α✝ : Type u_1 dflt : α✝ acc : Array α✝ n✝ : Nat head✝ : α✝ l : List α✝ ⊢ takeDTR.go dflt (n✝ + 1) (head✝ :: l) acc = acc.data ++ takeD (n✝ + 1) (head✝ :: l) dflt ** simp [takeDTR.go, takeDTR_go_eq _ l] ** Qed
List.scanlTR_go_eq ** α✝¹ : Type u_1 α✝ : Type u_2 f : α✝¹ → α✝ → α✝¹ a : α✝¹ acc : Array α✝¹ ⊢ scanlTR.go f [] a acc = acc.data ++ scanl f a [] ** simp [scanlTR.go, scanl] ** α✝¹ : Type u_1 α✝ : Type u_2 f : α✝¹ → α✝ → α✝¹ a✝ : α✝¹ acc : Array α✝¹ a : α✝ l : List α✝ ⊢ scanlTR.go f (a :: l) a✝ acc = acc.data ++ scanl f a✝ (a :: l) ** simp [scanlTR.go, scanl, scanlTR_go_eq l] ** Qed
List.inits_eq_initsTR ** ⊢ @inits = @initsTR ** funext α l ** case h.h α : Type u_1 l : List α ⊢ inits l = initsTR l ** simp [initsTR] ** case h.h α : Type u_1 l : List α ⊢ inits l = reverse (foldr (fun a arrs => Array.push (Array.map (fun t => a :: t) arrs) []) #[[]] l).data ** induction l <;> simp [*, reverse_map] ** Qed
List.tails_eq_tailsTR ** ⊢ @tails = @tailsTR ** funext α ** case h α : Type u_1 ⊢ tails = tailsTR ** have H (l : List α) : ∀ acc, tailsTR.go l acc = acc.toList ++ tails l := by induction l <;> simp [*, tailsTR.go] ** case h α : Type u_1 H : ∀ (l : List α) (acc : Array (List α)), tailsTR.go l acc = Array.toList acc ++ tails l ⊢ tails = tailsTR ** simp [tailsTR, H] ** α : Type u_1 l : List α ⊢ ∀ (acc : Array (List α)), tailsTR.go l acc = Array.toList acc ++ tails l ** induction l <;> simp [*, tailsTR.go] ** Qed
List.eraseP_eq_erasePTR ** ⊢ @eraseP = @erasePTR ** funext α p l ** case h.h.h α : Type u_1 p : α → Bool l : List α ⊢ eraseP p l = erasePTR p l ** simp [erasePTR] ** case h.h.h α : Type u_1 p : α → Bool l : List α ⊢ eraseP p l = erasePTR.go p l l #[] ** exact (go #[] _ rfl).symm ** α : Type u_1 p : α → Bool l : List α acc : Array α h : l = acc.data ++ [] ⊢ erasePTR.go p l [] acc = acc.data ++ eraseP p [] ** simp [erasePTR.go, eraseP, h] ** α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α ⊢ l = acc.data ++ x :: xs → erasePTR.go p l (x :: xs) acc = acc.data ++ eraseP p (x :: xs) ** simp [erasePTR.go, eraseP] ** α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α ⊢ l = acc.data ++ x :: xs → (bif p x then acc.data ++ xs else erasePTR.go p l xs (Array.push acc x)) = acc.data ++ bif p x then xs else x :: eraseP p xs ** cases p x <;> simp ** case false α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α ⊢ l = acc.data ++ x :: xs → erasePTR.go p l xs (Array.push acc x) = acc.data ++ x :: eraseP p xs ** intro h ** case false α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α h : l = acc.data ++ x :: xs ⊢ erasePTR.go p l xs (Array.push acc x) = acc.data ++ x :: eraseP p xs ** rw [go _ xs] ** case false α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α h : l = acc.data ++ x :: xs ⊢ (Array.push acc x).data ++ eraseP p xs = acc.data ++ x :: eraseP p xs case false α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α h : l = acc.data ++ x :: xs ⊢ l = (Array.push acc x).data ++ xs ** {simp} ** case false α : Type u_1 p : α → Bool l : List α acc : Array α x : α xs : List α h : l = acc.data ++ x :: xs ⊢ l = (Array.push acc x).data ++ xs ** simp [h] ** Qed
List.product_eq_productTR ** ⊢ @product = @productTR ** funext α β l₁ l₂ ** case h.h.h.h α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β ⊢ product l₁ l₂ = productTR l₁ l₂ ** simp [product, productTR] ** case h.h.h.h α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β ⊢ (List.bind l₁ fun a => map (Prod.mk a) l₂) = (foldl (fun acc a => foldl (fun acc b => Array.push acc (a, b)) acc l₂) #[] l₁).data ** rw [Array.foldl_data_eq_bind] ** case h.h.h.h α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β ⊢ (List.bind l₁ fun a => map (Prod.mk a) l₂) = #[].data ++ List.bind l₁ ?h.h.h.h.G case h.h.h.h.G α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β ⊢ α → List (α × β) case h.h.h.h.H α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β ⊢ ∀ (acc : Array (α × β)) (a : α), (foldl (fun acc b => Array.push acc (a, b)) acc l₂).data = acc.data ++ ?h.h.h.h.G a ** rfl ** case h.h.h.h.H α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β ⊢ ∀ (acc : Array (α × β)) (a : α), (foldl (fun acc b => Array.push acc (a, b)) acc l₂).data = acc.data ++ map (Prod.mk a) l₂ ** intros ** case h.h.h.h.H α : Type u_2 β : Type u_1 l₁ : List α l₂ : List β acc✝ : Array (α × β) a✝ : α ⊢ (foldl (fun acc b => Array.push acc (a✝, b)) acc✝ l₂).data = acc✝.data ++ map (Prod.mk a✝) l₂ ** apply Array.foldl_data_eq_map ** Qed
List.sigma_eq_sigmaTR ** ⊢ @List.sigma = @sigmaTR ** funext α β l₁ l₂ ** case h.h.h.h α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) ⊢ List.sigma l₁ l₂ = sigmaTR l₁ l₂ ** simp [List.sigma, sigmaTR] ** case h.h.h.h α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) ⊢ (List.bind l₁ fun a => map (Sigma.mk a) (l₂ a)) = (foldl (fun acc a => foldl (fun acc b => Array.push acc { fst := a, snd := b }) acc (l₂ a)) #[] l₁).data ** rw [Array.foldl_data_eq_bind] ** case h.h.h.h α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) ⊢ (List.bind l₁ fun a => map (Sigma.mk a) (l₂ a)) = #[].data ++ List.bind l₁ ?h.h.h.h.G case h.h.h.h.G α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) ⊢ α → List ((a : α) × β a) case h.h.h.h.H α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) ⊢ ∀ (acc : Array ((a : α) × β a)) (a : α), (foldl (fun acc b => Array.push acc { fst := a, snd := b }) acc (l₂ a)).data = acc.data ++ ?h.h.h.h.G a ** rfl ** case h.h.h.h.H α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) ⊢ ∀ (acc : Array ((a : α) × β a)) (a : α), (foldl (fun acc b => Array.push acc { fst := a, snd := b }) acc (l₂ a)).data = acc.data ++ map (Sigma.mk a) (l₂ a) ** intros ** case h.h.h.h.H α : Type u_2 β : α → Type u_1 l₁ : List α l₂ : (a : α) → List (β a) acc✝ : Array ((a : α) × β a) a✝ : α ⊢ (foldl (fun acc b => Array.push acc { fst := a✝, snd := b }) acc✝ (l₂ a✝)).data = acc✝.data ++ map (Sigma.mk a✝) (l₂ a✝) ** apply Array.foldl_data_eq_map ** Qed
List.takeWhile₂_eq_takeWhile₂TR ** ⊢ @takeWhile₂ = @takeWhile₂TR ** funext α β R as bs ** case h.h.h.h.h α : Type u_2 β : Type u_1 R : α → β → Bool as : List α bs : List β ⊢ takeWhile₂ R as bs = takeWhile₂TR R as bs ** simp [takeWhile₂TR] ** case h.h.h.h.h α : Type u_2 β : Type u_1 R : α → β → Bool as : List α bs : List β ⊢ takeWhile₂ R as bs = takeWhile₂TR.go R as bs [] [] ** exact (go as bs [] []).symm ** α : Type u_2 β : Type u_1 R : α → β → Bool as✝ : List α bs✝ : List β as : List α bs : List β acca : List α accb : List β ⊢ takeWhile₂TR.go R as bs acca accb = (reverse acca ++ (takeWhile₂ R as bs).fst, reverse accb ++ (takeWhile₂ R as bs).snd) ** unfold takeWhile₂TR.go takeWhile₂ ** α : Type u_2 β : Type u_1 R : α → β → Bool as✝ : List α bs✝ : List β as : List α bs : List β acca : List α accb : List β ⊢ (match as, bs, acca, accb with | a :: as, b :: bs, acca, accb => bif R a b then takeWhile₂TR.go R as bs (a :: acca) (b :: accb) else (reverse acca, reverse accb) | x, x_1, acca, accb => (reverse acca, reverse accb)) = (reverse acca ++ (match as, bs with | a :: as, b :: bs => if R a b = true then match takeWhile₂ R as bs with | (as', bs') => (a :: as', b :: bs') else ([], []) | x, x_1 => ([], [])).fst, reverse accb ++ (match as, bs with | a :: as, b :: bs => if R a b = true then match takeWhile₂ R as bs with | (as', bs') => (a :: as', b :: bs') else ([], []) | x, x_1 => ([], [])).snd) ** split <;> simp ** case h_1 α : Type u_2 β : Type u_1 R : α → β → Bool as : List α bs : List β acca : List α accb : List β x✝³ : List α x✝² : List β x✝¹ : List α x✝ : List β a✝ : α as✝ : List α b✝ : β bs✝ : List β ⊢ (bif R a✝ b✝ then takeWhile₂TR.go R as✝ bs✝ (a✝ :: acca) (b✝ :: accb) else (reverse acca, reverse accb)) = (reverse acca ++ (if R a✝ b✝ = true then (a✝ :: (takeWhile₂ R as✝ bs✝).fst, b✝ :: (takeWhile₂ R as✝ bs✝).snd) else ([], [])).fst, reverse accb ++ (if R a✝ b✝ = true then (a✝ :: (takeWhile₂ R as✝ bs✝).fst, b✝ :: (takeWhile₂ R as✝ bs✝).snd) else ([], [])).snd) ** rename_i a as b bs ** case h_1 α : Type u_2 β : Type u_1 R : α → β → Bool as✝ : List α bs✝ : List β acca : List α accb : List β x✝³ : List α x✝² : List β x✝¹ : List α x✝ : List β a : α as : List α b : β bs : List β ⊢ (bif R a b then takeWhile₂TR.go R as bs (a :: acca) (b :: accb) else (reverse acca, reverse accb)) = (reverse acca ++ (if R a b = true then (a :: (takeWhile₂ R as bs).fst, b :: (takeWhile₂ R as bs).snd) else ([], [])).fst, reverse accb ++ (if R a b = true then (a :: (takeWhile₂ R as bs).fst, b :: (takeWhile₂ R as bs).snd) else ([], [])).snd) ** unfold cond ** case h_1 α : Type u_2 β : Type u_1 R : α → β → Bool as✝ : List α bs✝ : List β acca : List α accb : List β x✝³ : List α x✝² : List β x✝¹ : List α x✝ : List β a : α as : List α b : β bs : List β ⊢ (match R a b with | true => takeWhile₂TR.go R as bs (a :: acca) (b :: accb) | false => (reverse acca, reverse accb)) = (reverse acca ++ (if R a b = true then (a :: (takeWhile₂ R as bs).fst, b :: (takeWhile₂ R as bs).snd) else ([], [])).fst, reverse accb ++ (if R a b = true then (a :: (takeWhile₂ R as bs).fst, b :: (takeWhile₂ R as bs).snd) else ([], [])).snd) ** cases R a b <;> simp [go as bs] ** Qed
List.dropSlice_zero₂ ** α : Type u_1 n : Nat x : α xs : List α ⊢ dropSlice (n + 1) 0 (x :: xs) = x :: xs ** simp [dropSlice, dropSlice_zero₂] ** Qed
List.zipWithLeft'_eq_zipWithLeft'TR ** ⊢ @zipWithLeft' = @zipWithLeft'TR ** funext α β γ f as bs ** case h.h.h.h.h.h α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs : List β ⊢ zipWithLeft' f as bs = zipWithLeft'TR f as bs ** simp [zipWithLeft'TR] ** case h.h.h.h.h.h α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs : List β ⊢ zipWithLeft' f as bs = zipWithLeft'TR.go f as bs #[] ** simp [zipWithLeft'TR, go] ** α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs✝ : List β acc : Array γ bs : List β ⊢ zipWithLeft'TR.go f [] bs acc = match zipWithLeft' f [] bs with | (l, r) => (Array.toList acc ++ l, r) ** simp [zipWithLeft'TR.go] ** α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs : List β acc : Array γ head✝ : α tail✝ : List α ⊢ zipWithLeft'TR.go f (head✝ :: tail✝) [] acc = match zipWithLeft' f (head✝ :: tail✝) [] with | (l, r) => (Array.toList acc ++ l, r) ** simp [zipWithLeft'TR.go, Array.foldl_data_eq_map] ** α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as✝ : List α bs✝ : List β acc : Array γ a : α as : List α b : β bs : List β ⊢ zipWithLeft'TR.go f (a :: as) (b :: bs) acc = match zipWithLeft' f (a :: as) (b :: bs) with | (l, r) => (Array.toList acc ++ l, r) ** simp [zipWithLeft'TR.go, go _ as bs] ** Qed
List.zipWithLeft_eq_zipWithLeftTR ** ⊢ @zipWithLeft = @zipWithLeftTR ** funext α β γ f as bs ** case h.h.h.h.h.h α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs : List β ⊢ zipWithLeft f as bs = zipWithLeftTR f as bs ** simp [zipWithLeftTR] ** case h.h.h.h.h.h α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs : List β ⊢ zipWithLeft f as bs = zipWithLeftTR.go f as bs #[] ** simp [zipWithLeftTR, go] ** α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs✝ : List β acc : Array γ bs : List β ⊢ zipWithLeftTR.go f [] bs acc = Array.toList acc ++ zipWithLeft f [] bs ** simp [zipWithLeftTR.go] ** α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as : List α bs : List β acc : Array γ head✝ : α tail✝ : List α ⊢ zipWithLeftTR.go f (head✝ :: tail✝) [] acc = Array.toList acc ++ zipWithLeft f (head✝ :: tail✝) [] ** simp [zipWithLeftTR.go, Array.foldl_data_eq_map] ** α : Type u_3 β : Type u_2 γ : Type u_1 f : α → Option β → γ as✝ : List α bs✝ : List β acc : Array γ a : α as : List α b : β bs : List β ⊢ zipWithLeftTR.go f (a :: as) (b :: bs) acc = Array.toList acc ++ zipWithLeft f (a :: as) (b :: bs) ** simp [zipWithLeftTR.go, go _ as bs] ** Qed
List.zipWithAll_nil_right ** α✝² : Type u_1 α✝¹ : Type u_2 α✝ : Type u_3 f : Option α✝² → Option α✝¹ → α✝ as : List α✝² ⊢ zipWithAll f as [] = map (fun a => f (some a) none) as ** cases as <;> rfl ** Qed
List.zipWithAll_nil_left ** α✝² : Type u_1 α✝¹ : Type u_2 α✝ : Type u_3 f : Option α✝² → Option α✝¹ → α✝ bs : List α✝¹ ⊢ zipWithAll f [] bs = map (fun b => f none (some b)) bs ** rw [zipWithAll] ** Qed
List.takeList_eq_takeListTR ** ⊢ @takeList = @takeListTR ** funext α xs ns ** case h.h.h α : Type u_1 xs : List α ns : List Nat ⊢ takeList xs ns = takeListTR xs ns ** simp [takeListTR] ** case h.h.h α : Type u_1 xs : List α ns : List Nat ⊢ takeList xs ns = takeListTR.go ns xs #[] ** simp [takeListTR, go] ** α : Type u_1 xs✝ : List α ns : List Nat acc : Array (List α) xs : List α ⊢ takeListTR.go [] xs acc = match takeList xs [] with | (l, r) => (Array.toList acc ++ l, r) ** simp [takeListTR.go, takeList] ** α : Type u_1 xs✝ : List α ns✝ : List Nat acc : Array (List α) n : Nat ns : List Nat xs : List α ⊢ takeListTR.go (n :: ns) xs acc = match takeList xs (n :: ns) with | (l, r) => (Array.toList acc ++ l, r) ** simp [takeListTR.go, takeList, go _ ns] ** Qed
Ordering.swap_swap ** o : Ordering ⊢ swap (swap o) = o ** cases o <;> rfl ** Qed
Ordering.swap_inj ** o₁ o₂ : Ordering h : swap o₁ = swap o₂ ⊢ o₁ = o₂ ** simpa using congrArg swap h ** Qed
Std.OrientedCmp.cmp_eq_gt ** α✝ : Sort u_1 cmp : α✝ → α✝ → Ordering x y : α✝ inst✝ : OrientedCmp cmp ⊢ cmp x y = Ordering.gt ↔ cmp y x = Ordering.lt ** rw [← Ordering.swap_inj, symm] ** α✝ : Sort u_1 cmp : α✝ → α✝ → Ordering x y : α✝ inst✝ : OrientedCmp cmp ⊢ cmp y x = Ordering.swap Ordering.gt ↔ cmp y x = Ordering.lt ** exact .rfl ** Qed
Std.OrientedCmp.cmp_eq_eq_symm ** α✝ : Sort u_1 cmp : α✝ → α✝ → Ordering x y : α✝ inst✝ : OrientedCmp cmp ⊢ cmp x y = Ordering.eq ↔ cmp y x = Ordering.eq ** rw [← Ordering.swap_inj, symm] ** α✝ : Sort u_1 cmp : α✝ → α✝ → Ordering x y : α✝ inst✝ : OrientedCmp cmp ⊢ cmp y x = Ordering.swap Ordering.eq ↔ cmp y x = Ordering.eq ** exact .rfl ** Qed
Std.TransCmp.ge_trans ** cmp✝ : ?m.1071 → ?m.1071 → Ordering inst✝¹ : TransCmp cmp✝ x✝ : Sort ?u.1069 cmp : x✝ → x✝ → Ordering inst✝ : TransCmp cmp x y z : x✝ h₁ : cmp x y ≠ Ordering.lt h₂ : cmp y z ≠ Ordering.lt ⊢ cmp x z ≠ Ordering.lt ** have := @TransCmp.le_trans _ cmp _ z y x ** cmp✝ : ?m.1071 → ?m.1071 → Ordering inst✝¹ : TransCmp cmp✝ x✝ : Sort ?u.1069 cmp : x✝ → x✝ → Ordering inst✝ : TransCmp cmp x y z : x✝ h₁ : cmp x y ≠ Ordering.lt h₂ : cmp y z ≠ Ordering.lt this : cmp z y ≠ Ordering.gt → cmp y x ≠ Ordering.gt → cmp z x ≠ Ordering.gt ⊢ cmp x z ≠ Ordering.lt ** simp [cmp_eq_gt] at * ** cmp✝ : ?m.1071 → ?m.1071 → Ordering inst✝¹ : TransCmp cmp✝ x✝ : Sort ?u.1069 cmp : x✝ → x✝ → Ordering inst✝ : TransCmp cmp x y z : x✝ h₁ : ¬cmp x y = Ordering.lt h₂ : ¬cmp y z = Ordering.lt this : ¬cmp y z = Ordering.lt → ¬cmp x y = Ordering.lt → ¬cmp x z = Ordering.lt ⊢ ¬cmp x z = Ordering.lt ** exact this h₂ h₁ ** Qed
Std.TransCmp.gt_trans ** cmp✝ : ?m.2419 → ?m.2419 → Ordering inst✝¹ : TransCmp cmp✝ x✝ : Sort ?u.2417 cmp : x✝ → x✝ → Ordering inst✝ : TransCmp cmp x y z : x✝ h₁ : cmp x y = Ordering.gt h₂ : cmp y z = Ordering.gt ⊢ cmp x z = Ordering.gt ** rw [cmp_eq_gt] at h₁ h₂ ⊢ ** cmp✝ : ?m.2419 → ?m.2419 → Ordering inst✝¹ : TransCmp cmp✝ x✝ : Sort ?u.2417 cmp : x✝ → x✝ → Ordering inst✝ : TransCmp cmp x y z : x✝ h₁ : cmp y x = Ordering.lt h₂ : cmp z y = Ordering.lt ⊢ cmp z x = Ordering.lt ** exact lt_trans h₂ h₁ ** Qed
Std.TransCmp.cmp_congr_right ** cmp✝ : ?m.3801 → ?m.3801 → Ordering inst✝² : TransCmp cmp✝ x✝ : Sort u_1 cmp : x✝ → x✝ → Ordering inst✝¹ : TransCmp cmp y z x : x✝ inst✝ : TransCmp cmp yz : cmp y z = Ordering.eq ⊢ cmp x y = cmp x z ** rw [← Ordering.swap_inj, symm, symm, cmp_congr_left yz] ** Qed
ProbabilityTheory.cond_isProbabilityMeasure ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hcs : ↑↑μ s ≠ 0 ⊢ ↑↑(μ[|s]) Set.univ = 1 ** rw [cond, Measure.smul_apply, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter] ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hcs : ↑↑μ s ≠ 0 ⊢ (↑↑μ s)⁻¹ • ↑↑μ s = 1 ** exact ENNReal.inv_mul_cancel hcs (measure_ne_top _ s) ** Qed
ProbabilityTheory.cond_empty ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω ⊢ μ[|∅] = 0 ** simp [cond] ** Qed
ProbabilityTheory.cond_univ ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsProbabilityMeasure μ ⊢ μ[|Set.univ] = μ ** simp [cond, measure_univ, Measure.restrict_univ] ** Qed
ProbabilityTheory.cond_apply ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t✝ : Set Ω hms : MeasurableSet s t : Set Ω ⊢ ↑↑(μ[|s]) t = (↑↑μ s)⁻¹ * ↑↑μ (s ∩ t) ** rw [cond, Measure.smul_apply, Measure.restrict_apply' hms, Set.inter_comm, smul_eq_mul] ** Qed
ProbabilityTheory.cond_inter_self ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t✝ : Set Ω hms : MeasurableSet s t : Set Ω ⊢ ↑↑(μ[|s]) (s ∩ t) = ↑↑(μ[|s]) t ** rw [cond_apply _ hms, ← Set.inter_assoc, Set.inter_self, ← cond_apply _ hms] ** Qed
ProbabilityTheory.inter_pos_of_cond_ne_zero ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hcst : ↑↑(μ[|s]) t ≠ 0 ⊢ 0 < ↑↑μ (s ∩ t) ** refine' pos_iff_ne_zero.mpr (right_ne_zero_of_mul _) ** case refine'_2 Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hcst : ↑↑(μ[|s]) t ≠ 0 ⊢ (↑↑μ s)⁻¹ * ↑↑μ (s ∩ t) ≠ 0 ** convert hcst ** case h.e'_2 Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hcst : ↑↑(μ[|s]) t ≠ 0 ⊢ (↑↑μ s)⁻¹ * ↑↑μ (s ∩ t) = ↑↑(μ[|s]) t ** simp [hms, Set.inter_comm, cond] ** case refine'_1 Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hcst : ↑↑(μ[|s]) t ≠ 0 ⊢ ℝ≥0∞ ** exact (μ s)⁻¹ ** Qed
ProbabilityTheory.cond_pos_of_inter_ne_zero ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hms : MeasurableSet s hci : ↑↑μ (s ∩ t) ≠ 0 ⊢ 0 < ↑↑(μ[|s]) t ** rw [cond_apply _ hms] ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hms : MeasurableSet s hci : ↑↑μ (s ∩ t) ≠ 0 ⊢ 0 < (↑↑μ s)⁻¹ * ↑↑μ (s ∩ t) ** refine' ENNReal.mul_pos _ hci ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hms : MeasurableSet s hci : ↑↑μ (s ∩ t) ≠ 0 ⊢ (↑↑μ s)⁻¹ ≠ 0 ** exact ENNReal.inv_ne_zero.mpr (measure_ne_top _ _) ** Qed
ProbabilityTheory.cond_cond_eq_cond_inter' ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hmt : MeasurableSet t hcs : ↑↑μ s ≠ ⊤ hci : ↑↑μ (s ∩ t) ≠ 0 ⊢ μ[|s][|t] = μ[|s ∩ t] ** have hcs' : μ s ≠ 0 := (μ.toOuterMeasure.pos_of_subset_ne_zero (Set.inter_subset_left _ _) hci).ne' ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hmt : MeasurableSet t hcs : ↑↑μ s ≠ ⊤ hci : ↑↑μ (s ∩ t) ≠ 0 hcs' : ↑↑μ s ≠ 0 ⊢ μ[|s][|t] = μ[|s ∩ t] ** ext u ** case h Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω hms : MeasurableSet s hmt : MeasurableSet t hcs : ↑↑μ s ≠ ⊤ hci : ↑↑μ (s ∩ t) ≠ 0 hcs' : ↑↑μ s ≠ 0 u : Set Ω a✝ : MeasurableSet u ⊢ ↑↑(μ[|s][|t]) u = ↑↑(μ[|s ∩ t]) u ** simp [*, hms.inter hmt, cond_apply, ← mul_assoc, ← Set.inter_assoc, ENNReal.mul_inv, mul_comm, ← mul_assoc, ENNReal.mul_inv_cancel] ** Qed
ProbabilityTheory.cond_mul_eq_inter' ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t✝ : Set Ω hms : MeasurableSet s hcs : ↑↑μ s ≠ 0 hcs' : ↑↑μ s ≠ ⊤ t : Set Ω ⊢ ↑↑(μ[|s]) t * ↑↑μ s = ↑↑μ (s ∩ t) ** rw [cond_apply μ hms t, mul_comm, ← mul_assoc, ENNReal.mul_inv_cancel hcs hcs', one_mul] ** Qed
ProbabilityTheory.cond_add_cond_compl_eq ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hms : MeasurableSet s hcs : ↑↑μ s ≠ 0 hcs' : ↑↑μ sᶜ ≠ 0 ⊢ ↑↑(μ[|s]) t * ↑↑μ s + ↑↑(μ[|sᶜ]) t * ↑↑μ sᶜ = ↑↑μ t ** rw [cond_mul_eq_inter μ hms hcs, cond_mul_eq_inter μ hms.compl hcs', Set.inter_comm _ t, Set.inter_comm _ t] ** Ω : Type u_1 m : MeasurableSpace Ω μ : Measure Ω s t : Set Ω inst✝ : IsFiniteMeasure μ hms : MeasurableSet s hcs : ↑↑μ s ≠ 0 hcs' : ↑↑μ sᶜ ≠ 0 ⊢ ↑↑μ (t ∩ s) + ↑↑μ (t ∩ sᶜ) = ↑↑μ t ** exact measure_inter_add_diff t hms ** Qed
MeasureTheory.Martingale.condexp_stopping_time_ae_eq_restrict_eq_const ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁹ : NormedAddCommGroup E inst✝⁸ : NormedSpace ℝ E inst✝⁷ : CompleteSpace E ι : Type u_3 inst✝⁶ : LinearOrder ι inst✝⁵ : TopologicalSpace ι inst✝⁴ : OrderTopology ι inst✝³ : FirstCountableTopology ι ℱ : Filtration ι m inst✝² : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι inst✝¹ : Filter.IsCountablyGenerated Filter.atTop h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) hin : i ≤ n ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] f i ** refine' Filter.EventuallyEq.trans _ (ae_restrict_of_ae (h.condexp_ae_eq hin)) ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁹ : NormedAddCommGroup E inst✝⁸ : NormedSpace ℝ E inst✝⁷ : CompleteSpace E ι : Type u_3 inst✝⁶ : LinearOrder ι inst✝⁵ : TopologicalSpace ι inst✝⁴ : OrderTopology ι inst✝³ : FirstCountableTopology ι ℱ : Filtration ι m inst✝² : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι inst✝¹ : Filter.IsCountablyGenerated Filter.atTop h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) hin : i ≤ n ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] fun x => (μ[f n|↑ℱ i]) x ** refine' condexp_ae_eq_restrict_of_measurableSpace_eq_on hτ.measurableSpace_le (ℱ.le i) (hτ.measurableSet_eq' i) fun t => _ ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁹ : NormedAddCommGroup E inst✝⁸ : NormedSpace ℝ E inst✝⁷ : CompleteSpace E ι : Type u_3 inst✝⁶ : LinearOrder ι inst✝⁵ : TopologicalSpace ι inst✝⁴ : OrderTopology ι inst✝³ : FirstCountableTopology ι ℱ : Filtration ι m inst✝² : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι inst✝¹ : Filter.IsCountablyGenerated Filter.atTop h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) hin : i ≤ n t : Set Ω ⊢ MeasurableSet ({x | τ x = i} ∩ t) ↔ MeasurableSet ({x | τ x = i} ∩ t) ** rw [Set.inter_comm _ t, IsStoppingTime.measurableSet_inter_eq_iff] ** Qed
MeasureTheory.Martingale.condexp_stopping_time_ae_eq_restrict_eq_const_of_le_const ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] f i ** by_cases hin : i ≤ n ** case pos Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : i ≤ n ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] f i ** refine' Filter.EventuallyEq.trans _ (ae_restrict_of_ae (h.condexp_ae_eq hin)) ** case pos Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : i ≤ n ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] fun x => (μ[f n|↑ℱ i]) x ** refine' condexp_ae_eq_restrict_of_measurableSpace_eq_on (hτ.measurableSpace_le_of_le hτ_le) (ℱ.le i) (hτ.measurableSet_eq' i) fun t => _ ** case pos Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : i ≤ n t : Set Ω ⊢ MeasurableSet ({x | τ x = i} ∩ t) ↔ MeasurableSet ({x | τ x = i} ∩ t) ** rw [Set.inter_comm _ t, IsStoppingTime.measurableSet_inter_eq_iff] ** case neg Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : ¬i ≤ n ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] f i ** suffices {x : Ω | τ x = i} = ∅ by simp [this]; norm_cast ** case neg Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : ¬i ≤ n ⊢ {x | τ x = i} = ∅ ** ext1 x ** case neg.h Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : ¬i ≤ n x : Ω ⊢ x ∈ {x | τ x = i} ↔ x ∈ ∅ ** simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff] ** case neg.h Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : ¬i ≤ n x : Ω ⊢ ¬τ x = i ** rintro rfl ** case neg.h Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) x : Ω hin : ¬τ x ≤ n ⊢ False ** exact hin (hτ_le x) ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : ¬i ≤ n this : {x | τ x = i} = ∅ ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᵐ[Measure.restrict μ {x | τ x = i}] f i ** simp [this] ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i✝ n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hτ_le : ∀ (x : Ω), τ x ≤ n inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) i : ι hin : ¬i ≤ n this : {x | τ x = i} = ∅ ⊢ μ[f n|IsStoppingTime.measurableSpace hτ] =ᶠ[⊥] f i ** norm_cast ** Qed
MeasureTheory.Martingale.stoppedValue_ae_eq_condexp_of_le_of_countable_range ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hσ : IsStoppingTime ℱ σ hσ_le_τ : σ ≤ τ hτ_le : ∀ (x : Ω), τ x ≤ n hτ_countable_range : Set.Countable (Set.range τ) hσ_countable_range : Set.Countable (Set.range σ) inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hσ ≤ m)) ⊢ stoppedValue f σ =ᵐ[μ] μ[stoppedValue f τ|IsStoppingTime.measurableSpace hσ] ** have : SigmaFinite (μ.trim (hτ.measurableSpace_le_of_le hτ_le)) := sigmaFiniteTrim_mono _ (IsStoppingTime.measurableSpace_mono hσ hτ hσ_le_τ) ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hσ : IsStoppingTime ℱ σ hσ_le_τ : σ ≤ τ hτ_le : ∀ (x : Ω), τ x ≤ n hτ_countable_range : Set.Countable (Set.range τ) hσ_countable_range : Set.Countable (Set.range σ) inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hσ ≤ m)) this : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) ⊢ stoppedValue f σ =ᵐ[μ] μ[stoppedValue f τ|IsStoppingTime.measurableSpace hσ] ** have : μ[stoppedValue f τ|hσ.measurableSpace] =ᵐ[μ] μ[μ[f n|hτ.measurableSpace]|hσ.measurableSpace] := condexp_congr_ae (h.stoppedValue_ae_eq_condexp_of_le_const_of_countable_range hτ hτ_le hτ_countable_range) ** Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hσ : IsStoppingTime ℱ σ hσ_le_τ : σ ≤ τ hτ_le : ∀ (x : Ω), τ x ≤ n hτ_countable_range : Set.Countable (Set.range τ) hσ_countable_range : Set.Countable (Set.range σ) inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hσ ≤ m)) this✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) this : μ[stoppedValue f τ|IsStoppingTime.measurableSpace hσ] =ᵐ[μ] μ[μ[f n|IsStoppingTime.measurableSpace hτ]|IsStoppingTime.measurableSpace hσ] ⊢ stoppedValue f σ =ᵐ[μ] μ[stoppedValue f τ|IsStoppingTime.measurableSpace hσ] ** refine' (Filter.EventuallyEq.trans _ (condexp_condexp_of_le _ (hτ.measurableSpace_le_of_le hτ_le)).symm).trans this.symm ** case refine'_1 Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hσ : IsStoppingTime ℱ σ hσ_le_τ : σ ≤ τ hτ_le : ∀ (x : Ω), τ x ≤ n hτ_countable_range : Set.Countable (Set.range τ) hσ_countable_range : Set.Countable (Set.range σ) inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hσ ≤ m)) this✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) this : μ[stoppedValue f τ|IsStoppingTime.measurableSpace hσ] =ᵐ[μ] μ[μ[f n|IsStoppingTime.measurableSpace hτ]|IsStoppingTime.measurableSpace hσ] ⊢ stoppedValue f σ =ᵐ[μ] μ[f n|IsStoppingTime.measurableSpace hσ] ** exact h.stoppedValue_ae_eq_condexp_of_le_const_of_countable_range hσ (fun x => (hσ_le_τ x).trans (hτ_le x)) hσ_countable_range ** case refine'_2 Ω : Type u_1 E : Type u_2 m : MeasurableSpace Ω μ : Measure Ω inst✝⁸ : NormedAddCommGroup E inst✝⁷ : NormedSpace ℝ E inst✝⁶ : CompleteSpace E ι : Type u_3 inst✝⁵ : LinearOrder ι inst✝⁴ : TopologicalSpace ι inst✝³ : OrderTopology ι inst✝² : FirstCountableTopology ι ℱ : Filtration ι m inst✝¹ : SigmaFiniteFiltration μ ℱ τ σ : Ω → ι f : ι → Ω → E i n : ι h : Martingale f ℱ μ hτ : IsStoppingTime ℱ τ hσ : IsStoppingTime ℱ σ hσ_le_τ : σ ≤ τ hτ_le : ∀ (x : Ω), τ x ≤ n hτ_countable_range : Set.Countable (Set.range τ) hσ_countable_range : Set.Countable (Set.range σ) inst✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hσ ≤ m)) this✝ : SigmaFinite (Measure.trim μ (_ : IsStoppingTime.measurableSpace hτ ≤ m)) this : μ[stoppedValue f τ|IsStoppingTime.measurableSpace hσ] =ᵐ[μ] μ[μ[f n|IsStoppingTime.measurableSpace hτ]|IsStoppingTime.measurableSpace hσ] ⊢ IsStoppingTime.measurableSpace hσ ≤ IsStoppingTime.measurableSpace hτ ** exact hσ.measurableSpace_mono hτ hσ_le_τ ** Qed
ProbabilityTheory.condCount_empty_meas ** Ω : Type u_1 inst✝ : MeasurableSpace Ω ⊢ condCount ∅ = 0 ** simp [condCount] ** Qed
ProbabilityTheory.condCount_empty ** Ω : Type u_1 inst✝ : MeasurableSpace Ω s : Set Ω ⊢ ↑↑(condCount s) ∅ = 0 ** simp ** Qed
ProbabilityTheory.finite_of_condCount_ne_zero ** Ω : Type u_1 inst✝ : MeasurableSpace Ω s t : Set Ω h : ↑↑(condCount s) t ≠ 0 ⊢ Set.Finite s ** by_contra hs' ** Ω : Type u_1 inst✝ : MeasurableSpace Ω s t : Set Ω h : ↑↑(condCount s) t ≠ 0 hs' : ¬Set.Finite s ⊢ False ** simp [condCount, cond, Measure.count_apply_infinite hs'] at h ** Qed
ProbabilityTheory.condCount_univ ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : Fintype Ω s : Set Ω ⊢ ↑↑(condCount Set.univ) s = ↑↑Measure.count s / ↑(Fintype.card Ω) ** rw [condCount, cond_apply _ MeasurableSet.univ, ← ENNReal.div_eq_inv_mul, Set.univ_inter] ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : Fintype Ω s : Set Ω ⊢ ↑↑Measure.count s / ↑↑Measure.count Set.univ = ↑↑Measure.count s / ↑(Fintype.card Ω) ** congr ** case e_a Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : Fintype Ω s : Set Ω ⊢ ↑↑Measure.count Set.univ = ↑(Fintype.card Ω) ** rw [← Finset.coe_univ, Measure.count_apply, Finset.univ.tsum_subtype' fun _ => (1 : ENNReal)] ** case e_a Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : Fintype Ω s : Set Ω ⊢ (Finset.sum Finset.univ fun x => 1) = ↑(Fintype.card Ω) ** simp [Finset.card_univ] ** case e_a Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : Fintype Ω s : Set Ω ⊢ MeasurableSet ↑Finset.univ ** exact (@Finset.coe_univ Ω _).symm ▸ MeasurableSet.univ ** Qed
ProbabilityTheory.condCount_isProbabilityMeasure ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ⊢ ↑↑(condCount s) Set.univ = 1 ** rw [condCount, cond_apply _ hs.measurableSet, Set.inter_univ, ENNReal.inv_mul_cancel] ** case h0 Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ⊢ ↑↑Measure.count s ≠ 0 ** exact fun h => hs'.ne_empty <| Measure.empty_of_count_eq_zero h ** case ht Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ⊢ ↑↑Measure.count s ≠ ⊤ ** exact (Measure.count_apply_lt_top.2 hs).ne ** Qed
ProbabilityTheory.condCount_singleton ** Ω : Type u_1 inst✝² : MeasurableSpace Ω inst✝¹ : MeasurableSingletonClass Ω ω : Ω t : Set Ω inst✝ : Decidable (ω ∈ t) ⊢ ↑↑(condCount {ω}) t = if ω ∈ t then 1 else 0 ** rw [condCount, cond_apply _ (measurableSet_singleton ω), Measure.count_singleton, inv_one, one_mul] ** Ω : Type u_1 inst✝² : MeasurableSpace Ω inst✝¹ : MeasurableSingletonClass Ω ω : Ω t : Set Ω inst✝ : Decidable (ω ∈ t) ⊢ ↑↑Measure.count ({ω} ∩ t) = if ω ∈ t then 1 else 0 ** split_ifs ** case pos Ω : Type u_1 inst✝² : MeasurableSpace Ω inst✝¹ : MeasurableSingletonClass Ω ω : Ω t : Set Ω inst✝ : Decidable (ω ∈ t) h✝ : ω ∈ t ⊢ ↑↑Measure.count ({ω} ∩ t) = 1 ** rw [(by simpa : ({ω} : Set Ω) ∩ t = {ω}), Measure.count_singleton] ** Ω : Type u_1 inst✝² : MeasurableSpace Ω inst✝¹ : MeasurableSingletonClass Ω ω : Ω t : Set Ω inst✝ : Decidable (ω ∈ t) h✝ : ω ∈ t ⊢ {ω} ∩ t = {ω} ** simpa ** case neg Ω : Type u_1 inst✝² : MeasurableSpace Ω inst✝¹ : MeasurableSingletonClass Ω ω : Ω t : Set Ω inst✝ : Decidable (ω ∈ t) h✝ : ¬ω ∈ t ⊢ ↑↑Measure.count ({ω} ∩ t) = 0 ** rw [(by simpa : ({ω} : Set Ω) ∩ t = ∅), Measure.count_empty] ** Ω : Type u_1 inst✝² : MeasurableSpace Ω inst✝¹ : MeasurableSingletonClass Ω ω : Ω t : Set Ω inst✝ : Decidable (ω ∈ t) h✝ : ¬ω ∈ t ⊢ {ω} ∩ t = ∅ ** simpa ** Qed
ProbabilityTheory.condCount_self ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ⊢ ↑↑(condCount s) s = 1 ** rw [condCount, cond_apply _ hs.measurableSet, Set.inter_self, ENNReal.inv_mul_cancel] ** case h0 Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ⊢ ↑↑Measure.count s ≠ 0 ** exact fun h => hs'.ne_empty <| Measure.empty_of_count_eq_zero h ** case ht Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ⊢ ↑↑Measure.count s ≠ ⊤ ** exact (Measure.count_apply_lt_top.2 hs).ne ** Qed
ProbabilityTheory.condCount_eq_one_of ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ht : s ⊆ t ⊢ ↑↑(condCount s) t = 1 ** haveI := condCount_isProbabilityMeasure hs hs' ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ht : s ⊆ t this : IsProbabilityMeasure (condCount s) ⊢ ↑↑(condCount s) t = 1 ** refine' eq_of_le_of_not_lt prob_le_one _ ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ht : s ⊆ t this : IsProbabilityMeasure (condCount s) ⊢ ¬↑↑(condCount s) t < 1 ** rw [not_lt, ← condCount_self hs hs'] ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ht : s ⊆ t this : IsProbabilityMeasure (condCount s) ⊢ ↑↑(condCount s) s ≤ ↑↑(condCount s) t ** exact measure_mono ht ** Qed
ProbabilityTheory.condCount_eq_zero_iff ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ⊢ ↑↑(condCount s) t = 0 ↔ s ∩ t = ∅ ** simp [condCount, cond_apply _ hs.measurableSet, Measure.count_apply_eq_top, Set.not_infinite.2 hs, Measure.count_apply_finite _ (hs.inter_of_left _)] ** Qed
ProbabilityTheory.condCount_union ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s htu : Disjoint t u ⊢ ↑↑(condCount s) (t ∪ u) = ↑↑(condCount s) t + ↑↑(condCount s) u ** rw [condCount, cond_apply _ hs.measurableSet, cond_apply _ hs.measurableSet, cond_apply _ hs.measurableSet, Set.inter_union_distrib_left, measure_union, mul_add] ** case hd Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s htu : Disjoint t u ⊢ Disjoint (s ∩ t) (s ∩ u) case h Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s htu : Disjoint t u ⊢ MeasurableSet (s ∩ u) ** exacts [htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).measurableSet] ** Qed
ProbabilityTheory.condCount_disjoint_union ** Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t ⊢ ↑↑(condCount s) u * ↑↑(condCount (s ∪ t)) s + ↑↑(condCount t) u * ↑↑(condCount (s ∪ t)) t = ↑↑(condCount (s ∪ t)) u ** rcases s.eq_empty_or_nonempty with (rfl | hs') <;> rcases t.eq_empty_or_nonempty with (rfl | ht') ** case inr.inr Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ ↑↑(condCount s) u * ↑↑(condCount (s ∪ t)) s + ↑↑(condCount t) u * ↑↑(condCount (s ∪ t)) t = ↑↑(condCount (s ∪ t)) u ** rw [condCount, condCount, condCount, cond_apply _ hs.measurableSet, cond_apply _ ht.measurableSet, cond_apply _ (hs.union ht).measurableSet, cond_apply _ (hs.union ht).measurableSet, cond_apply _ (hs.union ht).measurableSet] ** case inr.inr Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ (↑↑Measure.count s)⁻¹ * ↑↑Measure.count (s ∩ u) * ((↑↑Measure.count (s ∪ t))⁻¹ * ↑↑Measure.count ((s ∪ t) ∩ s)) + (↑↑Measure.count t)⁻¹ * ↑↑Measure.count (t ∩ u) * ((↑↑Measure.count (s ∪ t))⁻¹ * ↑↑Measure.count ((s ∪ t) ∩ t)) = (↑↑Measure.count (s ∪ t))⁻¹ * ↑↑Measure.count ((s ∪ t) ∩ u) ** conv_lhs => rw [Set.union_inter_cancel_left, Set.union_inter_cancel_right, mul_comm (Measure.count (s ∪ t))⁻¹, mul_comm (Measure.count (s ∪ t))⁻¹, ← mul_assoc, ← mul_assoc, mul_comm _ (Measure.count s), mul_comm _ (Measure.count t), ← mul_assoc, ← mul_assoc] ** case inr.inr Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ ↑↑Measure.count s * (↑↑Measure.count s)⁻¹ * ↑↑Measure.count (s ∩ u) * (↑↑Measure.count (s ∪ t))⁻¹ + ↑↑Measure.count t * (↑↑Measure.count t)⁻¹ * ↑↑Measure.count (t ∩ u) * (↑↑Measure.count (s ∪ t))⁻¹ = (↑↑Measure.count (s ∪ t))⁻¹ * ↑↑Measure.count ((s ∪ t) ∩ u) ** rw [ENNReal.mul_inv_cancel, ENNReal.mul_inv_cancel, one_mul, one_mul, ← add_mul, ← measure_union, Set.union_inter_distrib_right, mul_comm] ** case inr.inr.hd Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ Disjoint (s ∩ u) (t ∩ u) case inr.inr.h Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ MeasurableSet (t ∩ u) case inr.inr.h0 Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ ↑↑Measure.count t ≠ 0 case inr.inr.ht Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ ↑↑Measure.count t ≠ ⊤ case inr.inr.h0 Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ ↑↑Measure.count s ≠ 0 case inr.inr.ht Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s t u : Set Ω hs : Set.Finite s ht : Set.Finite t hst : Disjoint s t hs' : Set.Nonempty s ht' : Set.Nonempty t ⊢ ↑↑Measure.count s ≠ ⊤ ** exacts [hst.mono inf_le_left inf_le_left, (ht.inter_of_left _).measurableSet, Measure.count_ne_zero ht', (Measure.count_apply_lt_top.2 ht).ne, Measure.count_ne_zero hs', (Measure.count_apply_lt_top.2 hs).ne] ** case inl.inl Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω u : Set Ω hs ht : Set.Finite ∅ hst : Disjoint ∅ ∅ ⊢ ↑↑(condCount ∅) u * ↑↑(condCount (∅ ∪ ∅)) ∅ + ↑↑(condCount ∅) u * ↑↑(condCount (∅ ∪ ∅)) ∅ = ↑↑(condCount (∅ ∪ ∅)) u ** simp ** case inl.inr Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω t u : Set Ω ht : Set.Finite t hs : Set.Finite ∅ hst : Disjoint ∅ t ht' : Set.Nonempty t ⊢ ↑↑(condCount ∅) u * ↑↑(condCount (∅ ∪ t)) ∅ + ↑↑(condCount t) u * ↑↑(condCount (∅ ∪ t)) t = ↑↑(condCount (∅ ∪ t)) u ** simp [condCount_self ht ht'] ** case inr.inl Ω : Type u_1 inst✝¹ : MeasurableSpace Ω inst✝ : MeasurableSingletonClass Ω s u : Set Ω hs : Set.Finite s hs' : Set.Nonempty s ht : Set.Finite ∅ hst : Disjoint s ∅ ⊢ ↑↑(condCount s) u * ↑↑(condCount (s ∪ ∅)) s + ↑↑(condCount ∅) u * ↑↑(condCount (s ∪ ∅)) ∅ = ↑↑(condCount (s ∪ ∅)) u ** simp [condCount_self hs hs'] ** Qed
ProbabilityTheory.IdentDistrib.comp_of_aemeasurable ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ u : γ → δ h : IdentDistrib f g hu : AEMeasurable u ⊢ AEMeasurable (u ∘ g) ** exact hu.comp_aemeasurable h.aemeasurable_snd ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ u : γ → δ h : IdentDistrib f g hu : AEMeasurable u ⊢ Measure.map (u ∘ f) μ = Measure.map (u ∘ g) ν ** rw [← AEMeasurable.map_map_of_aemeasurable hu h.aemeasurable_fst, ← AEMeasurable.map_map_of_aemeasurable _ h.aemeasurable_snd, h.map_eq] ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ u : γ → δ h : IdentDistrib f g hu : AEMeasurable u ⊢ AEMeasurable u ** rwa [← h.map_eq] ** Qed
ProbabilityTheory.IdentDistrib.measure_mem_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ h : IdentDistrib f g s : Set γ hs : MeasurableSet s ⊢ ↑↑μ (f ⁻¹' s) = ↑↑ν (g ⁻¹' s) ** rw [← Measure.map_apply_of_aemeasurable h.aemeasurable_fst hs, ← Measure.map_apply_of_aemeasurable h.aemeasurable_snd hs, h.map_eq] ** Qed
ProbabilityTheory.IdentDistrib.ae_snd ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ h : IdentDistrib f g p : γ → Prop pmeas : MeasurableSet {x | p x} hp : ∀ᵐ (x : α) ∂μ, p (f x) ⊢ ∀ᵐ (x : β) ∂ν, p (g x) ** apply (ae_map_iff h.aemeasurable_snd pmeas).1 ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ h : IdentDistrib f g p : γ → Prop pmeas : MeasurableSet {x | p x} hp : ∀ᵐ (x : α) ∂μ, p (f x) ⊢ ∀ᵐ (y : γ) ∂Measure.map g ν, p y ** rw [← h.map_eq] ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ h : IdentDistrib f g p : γ → Prop pmeas : MeasurableSet {x | p x} hp : ∀ᵐ (x : α) ∂μ, p (f x) ⊢ ∀ᵐ (y : γ) ∂Measure.map f μ, p y ** exact (ae_map_iff h.aemeasurable_fst pmeas).2 hp ** Qed
ProbabilityTheory.IdentDistrib.aestronglyMeasurable_snd ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : TopologicalSpace γ inst✝¹ : MetrizableSpace γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ ⊢ AEStronglyMeasurable g ν ** refine' aestronglyMeasurable_iff_aemeasurable_separable.2 ⟨h.aemeasurable_snd, _⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : TopologicalSpace γ inst✝¹ : MetrizableSpace γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ ⊢ ∃ t, IsSeparable t ∧ ∀ᵐ (x : β) ∂ν, g x ∈ t ** rcases (aestronglyMeasurable_iff_aemeasurable_separable.1 hf).2 with ⟨t, t_sep, ht⟩ ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : TopologicalSpace γ inst✝¹ : MetrizableSpace γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ ∃ t, IsSeparable t ∧ ∀ᵐ (x : β) ∂ν, g x ∈ t ** refine' ⟨closure t, t_sep.closure, _⟩ ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : TopologicalSpace γ inst✝¹ : MetrizableSpace γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ ∀ᵐ (x : β) ∂ν, g x ∈ closure t ** apply h.ae_mem_snd isClosed_closure.measurableSet ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : TopologicalSpace γ inst✝¹ : MetrizableSpace γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ ∀ᵐ (x : α) ∂μ, f x ∈ closure t ** filter_upwards [ht] with x hx using subset_closure hx ** Qed
ProbabilityTheory.IdentDistrib.essSup_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁷ : MeasurableSpace α inst✝⁶ : MeasurableSpace β inst✝⁵ : MeasurableSpace γ inst✝⁴ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝³ : ConditionallyCompleteLinearOrder γ inst✝² : TopologicalSpace γ inst✝¹ : OpensMeasurableSpace γ inst✝ : OrderClosedTopology γ h : IdentDistrib f g ⊢ essSup f μ = essSup g ν ** have I : ∀ a, μ {x : α | a < f x} = ν {x : β | a < g x} := fun a => h.measure_mem_eq measurableSet_Ioi ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁷ : MeasurableSpace α inst✝⁶ : MeasurableSpace β inst✝⁵ : MeasurableSpace γ inst✝⁴ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝³ : ConditionallyCompleteLinearOrder γ inst✝² : TopologicalSpace γ inst✝¹ : OpensMeasurableSpace γ inst✝ : OrderClosedTopology γ h : IdentDistrib f g I : ∀ (a : γ), ↑↑μ {x | a < f x} = ↑↑ν {x | a < g x} ⊢ essSup f μ = essSup g ν ** simp_rw [essSup_eq_sInf, I] ** Qed
ProbabilityTheory.IdentDistrib.lintegral_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ≥0∞ g : β → ℝ≥0∞ h : IdentDistrib f g ⊢ ∫⁻ (x : α), f x ∂μ = ∫⁻ (x : β), g x ∂ν ** change ∫⁻ x, id (f x) ∂μ = ∫⁻ x, id (g x) ∂ν ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ≥0∞ g : β → ℝ≥0∞ h : IdentDistrib f g ⊢ ∫⁻ (x : α), id (f x) ∂μ = ∫⁻ (x : β), id (g x) ∂ν ** rw [← lintegral_map' aemeasurable_id h.aemeasurable_fst, ← lintegral_map' aemeasurable_id h.aemeasurable_snd, h.map_eq] ** Qed
ProbabilityTheory.IdentDistrib.integral_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g ⊢ ∫ (x : α), f x ∂μ = ∫ (x : β), g x ∂ν ** by_cases hf : AEStronglyMeasurable f μ ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ A : AEStronglyMeasurable id (Measure.map f μ) ⊢ ∫ (x : α), f x ∂μ = ∫ (x : β), g x ∂ν ** change ∫ x, id (f x) ∂μ = ∫ x, id (g x) ∂ν ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ A : AEStronglyMeasurable id (Measure.map f μ) ⊢ ∫ (x : α), id (f x) ∂μ = ∫ (x : β), id (g x) ∂ν ** rw [← integral_map h.aemeasurable_fst A] ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ A : AEStronglyMeasurable id (Measure.map f μ) ⊢ ∫ (y : γ), id y ∂Measure.map f μ = ∫ (x : β), id (g x) ∂ν ** rw [h.map_eq] at A ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ A : AEStronglyMeasurable id (Measure.map g ν) ⊢ ∫ (y : γ), id y ∂Measure.map f μ = ∫ (x : β), id (g x) ∂ν ** rw [← integral_map h.aemeasurable_snd A, h.map_eq] ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ ⊢ AEStronglyMeasurable id (Measure.map f μ) ** rw [aestronglyMeasurable_iff_aemeasurable_separable] ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ ⊢ AEMeasurable id ∧ ∃ t, IsSeparable t ∧ ∀ᵐ (x : γ) ∂Measure.map f μ, id x ∈ t ** rcases (aestronglyMeasurable_iff_aemeasurable_separable.1 hf).2 with ⟨t, t_sep, ht⟩ ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ AEMeasurable id ∧ ∃ t, IsSeparable t ∧ ∀ᵐ (x : γ) ∂Measure.map f μ, id x ∈ t ** refine' ⟨aemeasurable_id, ⟨closure t, t_sep.closure, _⟩⟩ ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ ∀ᵐ (x : γ) ∂Measure.map f μ, id x ∈ closure t ** rw [ae_map_iff h.aemeasurable_fst] ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ ∀ᵐ (x : α) ∂μ, id (f x) ∈ closure t ** filter_upwards [ht] with x hx using subset_closure hx ** case intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : AEStronglyMeasurable f μ t : Set γ t_sep : IsSeparable t ht : ∀ᵐ (x : α) ∂μ, f x ∈ t ⊢ MeasurableSet {x | id x ∈ closure t} ** exact isClosed_closure.measurableSet ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : ¬AEStronglyMeasurable f μ ⊢ ∫ (x : α), f x ∂μ = ∫ (x : β), g x ∂ν ** rw [integral_non_aestronglyMeasurable hf] ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : ¬AEStronglyMeasurable f μ ⊢ 0 = ∫ (x : β), g x ∂ν ** rw [h.aestronglyMeasurable_iff] at hf ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁶ : MeasurableSpace α inst✝⁵ : MeasurableSpace β inst✝⁴ : MeasurableSpace γ inst✝³ : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝² : NormedAddCommGroup γ inst✝¹ : NormedSpace ℝ γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : ¬AEStronglyMeasurable g ν ⊢ 0 = ∫ (x : β), g x ∂ν ** rw [integral_non_aestronglyMeasurable hf] ** Qed
ProbabilityTheory.IdentDistrib.memℒp_snd ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁵ : MeasurableSpace α inst✝⁴ : MeasurableSpace β inst✝³ : MeasurableSpace γ inst✝² : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝¹ : NormedAddCommGroup γ inst✝ : BorelSpace γ p : ℝ≥0∞ h : IdentDistrib f g hf : Memℒp f p ⊢ Memℒp g p ** refine' ⟨h.aestronglyMeasurable_snd hf.aestronglyMeasurable, _⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁵ : MeasurableSpace α inst✝⁴ : MeasurableSpace β inst✝³ : MeasurableSpace γ inst✝² : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝¹ : NormedAddCommGroup γ inst✝ : BorelSpace γ p : ℝ≥0∞ h : IdentDistrib f g hf : Memℒp f p ⊢ snorm g p ν < ⊤ ** rw [← h.snorm_eq] ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁵ : MeasurableSpace α inst✝⁴ : MeasurableSpace β inst✝³ : MeasurableSpace γ inst✝² : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝¹ : NormedAddCommGroup γ inst✝ : BorelSpace γ p : ℝ≥0∞ h : IdentDistrib f g hf : Memℒp f p ⊢ snorm f p μ < ⊤ ** exact hf.2 ** Qed
ProbabilityTheory.IdentDistrib.integrable_snd ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁵ : MeasurableSpace α inst✝⁴ : MeasurableSpace β inst✝³ : MeasurableSpace γ inst✝² : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝¹ : NormedAddCommGroup γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : Integrable f ⊢ Integrable g ** rw [← memℒp_one_iff_integrable] at hf ⊢ ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝⁵ : MeasurableSpace α inst✝⁴ : MeasurableSpace β inst✝³ : MeasurableSpace γ inst✝² : MeasurableSpace δ μ : Measure α ν : Measure β f : α → γ g : β → γ inst✝¹ : NormedAddCommGroup γ inst✝ : BorelSpace γ h : IdentDistrib f g hf : Memℒp f 1 ⊢ Memℒp g 1 ** exact h.memℒp_snd hf ** Qed
ProbabilityTheory.IdentDistrib.evariance_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ g : β → ℝ h : IdentDistrib f g ⊢ evariance f μ = evariance g ν ** convert (h.sub_const (∫ x, f x ∂μ)).nnnorm.coe_nnreal_ennreal.sq.lintegral_eq ** case h.e'_3 α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ g : β → ℝ h : IdentDistrib f g ⊢ evariance g ν = ∫⁻ (x : β), ↑‖g x - ∫ (x : α), f x ∂μ‖₊ ^ 2 ∂ν ** rw [h.integral_eq] ** case h.e'_3 α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ g : β → ℝ h : IdentDistrib f g ⊢ evariance g ν = ∫⁻ (x : β), ↑‖g x - ∫ (x : β), g x ∂ν‖₊ ^ 2 ∂ν ** rfl ** Qed
ProbabilityTheory.IdentDistrib.variance_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ g : β → ℝ h : IdentDistrib f g ⊢ variance f μ = variance g ν ** rw [variance, h.evariance_eq] ** α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝³ : MeasurableSpace α inst✝² : MeasurableSpace β inst✝¹ : MeasurableSpace γ inst✝ : MeasurableSpace δ μ : Measure α ν : Measure β f✝ : α → γ g✝ : β → γ f : α → ℝ g : β → ℝ h : IdentDistrib f g ⊢ ENNReal.toReal (evariance g ν) = variance g ν ** rfl ** Qed
ProbabilityTheory.IndepFun.integrable_mul ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y ⊢ Integrable (X * Y) ** let nX : Ω → ENNReal := fun a => ‖X a‖₊ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ ⊢ Integrable (X * Y) ** let nY : Ω → ENNReal := fun a => ‖Y a‖₊ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ ⊢ Integrable (X * Y) ** have hXY' : IndepFun (fun a => ‖X a‖₊) (fun a => ‖Y a‖₊) μ := hXY.comp measurable_nnnorm measurable_nnnorm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ ⊢ Integrable (X * Y) ** have hXY'' : IndepFun nX nY μ := hXY'.comp measurable_coe_nnreal_ennreal measurable_coe_nnreal_ennreal ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ hXY'' : IndepFun nX nY ⊢ Integrable (X * Y) ** have hnX : AEMeasurable nX μ := hX.1.aemeasurable.nnnorm.coe_nnreal_ennreal ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ hXY'' : IndepFun nX nY hnX : AEMeasurable nX ⊢ Integrable (X * Y) ** have hnY : AEMeasurable nY μ := hY.1.aemeasurable.nnnorm.coe_nnreal_ennreal ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ hXY'' : IndepFun nX nY hnX : AEMeasurable nX hnY : AEMeasurable nY ⊢ Integrable (X * Y) ** have hmul : ∫⁻ a, nX a * nY a ∂μ = (∫⁻ a, nX a ∂μ) * ∫⁻ a, nY a ∂μ := lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun' hnX hnY hXY'' ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ hXY'' : IndepFun nX nY hnX : AEMeasurable nX hnY : AEMeasurable nY hmul : ∫⁻ (a : Ω), nX a * nY a ∂μ = (∫⁻ (a : Ω), nX a ∂μ) * ∫⁻ (a : Ω), nY a ∂μ ⊢ Integrable (X * Y) ** refine' ⟨hX.1.mul hY.1, _⟩ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ hXY'' : IndepFun nX nY hnX : AEMeasurable nX hnY : AEMeasurable nY hmul : ∫⁻ (a : Ω), nX a * nY a ∂μ = (∫⁻ (a : Ω), nX a ∂μ) * ∫⁻ (a : Ω), nY a ∂μ ⊢ HasFiniteIntegral (X * Y) ** simp_rw [HasFiniteIntegral, Pi.mul_apply, nnnorm_mul, ENNReal.coe_mul, hmul] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y hX : Integrable X hY : Integrable Y nX : Ω → ℝ≥0∞ := fun a => ↑‖X a‖₊ nY : Ω → ℝ≥0∞ := fun a => ↑‖Y a‖₊ hXY' : IndepFun (fun a => ‖X a‖₊) fun a => ‖Y a‖₊ hXY'' : IndepFun nX nY hnX : AEMeasurable nX hnY : AEMeasurable nY hmul : ∫⁻ (a : Ω), nX a * nY a ∂μ = (∫⁻ (a : Ω), nX a ∂μ) * ∫⁻ (a : Ω), nY a ∂μ ⊢ (∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ) * ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ < ⊤ ** exact ENNReal.mul_lt_top hX.2.ne hY.2.ne ** Qed
ProbabilityTheory.IndepFun.integrable_left_of_integrable_mul ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 ⊢ Integrable X ** refine' ⟨hX, _⟩ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 ⊢ HasFiniteIntegral X ** have I : (∫⁻ ω, ‖Y ω‖₊ ∂μ) ≠ 0 := fun H ↦ by have I : (fun ω => ‖Y ω‖₊ : Ω → ℝ≥0∞) =ᵐ[μ] 0 := (lintegral_eq_zero_iff' hY.ennnorm).1 H apply h'Y filter_upwards [I] with ω hω simpa using hω ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 ⊢ HasFiniteIntegral X ** refine lt_top_iff_ne_top.2 fun H => ?_ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ ⊢ False ** have J : IndepFun (fun ω => ‖X ω‖₊ : Ω → ℝ≥0∞) (fun ω => ‖Y ω‖₊ : Ω → ℝ≥0∞) μ := by have M : Measurable fun x : β => (‖x‖₊ : ℝ≥0∞) := measurable_nnnorm.coe_nnreal_ennreal apply IndepFun.comp hXY M M ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ ⊢ False ** have A : (∫⁻ ω, ‖X ω * Y ω‖₊ ∂μ) < ∞ := h'XY.2 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ A : ∫⁻ (ω : Ω), ↑‖X ω * Y ω‖₊ ∂μ < ⊤ ⊢ False ** simp only [nnnorm_mul, ENNReal.coe_mul] at A ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ A : ∫⁻ (ω : Ω), ↑‖X ω‖₊ * ↑‖Y ω‖₊ ∂μ < ⊤ ⊢ False ** rw [lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun'' hX.ennnorm hY.ennnorm J, H] at A ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ A : ⊤ * ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ < ⊤ ⊢ False ** simp only [ENNReal.top_mul I] at A ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ = 0 ⊢ False ** have I : (fun ω => ‖Y ω‖₊ : Ω → ℝ≥0∞) =ᵐ[μ] 0 := (lintegral_eq_zero_iff' hY.ennnorm).1 H ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ = 0 I : (fun ω => ↑‖Y ω‖₊) =ᵐ[μ] 0 ⊢ False ** apply h'Y ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ = 0 I : (fun ω => ↑‖Y ω‖₊) =ᵐ[μ] 0 ⊢ Y =ᵐ[μ] 0 ** filter_upwards [I] with ω hω ** case h Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ = 0 I : (fun ω => ↑‖Y ω‖₊) =ᵐ[μ] 0 ω : Ω hω : ↑‖Y ω‖₊ = OfNat.ofNat 0 ω ⊢ Y ω = OfNat.ofNat 0 ω ** simpa using hω ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ ⊢ IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ ** have M : Measurable fun x : β => (‖x‖₊ : ℝ≥0∞) := measurable_nnnorm.coe_nnreal_ennreal ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'Y : ¬Y =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖Y ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖X a‖₊ ∂μ = ⊤ M : Measurable fun x => ↑‖x‖₊ ⊢ IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ ** apply IndepFun.comp hXY M M ** Qed
ProbabilityTheory.IndepFun.integrable_right_of_integrable_mul ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 ⊢ Integrable Y ** refine' ⟨hY, _⟩ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 ⊢ HasFiniteIntegral Y ** have I : (∫⁻ ω, ‖X ω‖₊ ∂μ) ≠ 0 := fun H ↦ by have I : (fun ω => ‖X ω‖₊ : Ω → ℝ≥0∞) =ᵐ[μ] 0 := (lintegral_eq_zero_iff' hX.ennnorm).1 H apply h'X filter_upwards [I] with ω hω simpa using hω ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 ⊢ HasFiniteIntegral Y ** refine lt_top_iff_ne_top.2 fun H => ?_ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ ⊢ False ** have J : IndepFun (fun ω => ‖X ω‖₊ : Ω → ℝ≥0∞) (fun ω => ‖Y ω‖₊ : Ω → ℝ≥0∞) μ := by have M : Measurable fun x : β => (‖x‖₊ : ℝ≥0∞) := measurable_nnnorm.coe_nnreal_ennreal apply IndepFun.comp hXY M M ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ ⊢ False ** have A : (∫⁻ ω, ‖X ω * Y ω‖₊ ∂μ) < ∞ := h'XY.2 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ A : ∫⁻ (ω : Ω), ↑‖X ω * Y ω‖₊ ∂μ < ⊤ ⊢ False ** simp only [nnnorm_mul, ENNReal.coe_mul] at A ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ A : ∫⁻ (ω : Ω), ↑‖X ω‖₊ * ↑‖Y ω‖₊ ∂μ < ⊤ ⊢ False ** rw [lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun'' hX.ennnorm hY.ennnorm J, H] at A ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ J : IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ A : (∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ) * ⊤ < ⊤ ⊢ False ** simp only [ENNReal.mul_top I] at A ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ = 0 ⊢ False ** have I : (fun ω => ‖X ω‖₊ : Ω → ℝ≥0∞) =ᵐ[μ] 0 := (lintegral_eq_zero_iff' hX.ennnorm).1 H ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ = 0 I : (fun ω => ↑‖X ω‖₊) =ᵐ[μ] 0 ⊢ False ** apply h'X ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ = 0 I : (fun ω => ↑‖X ω‖₊) =ᵐ[μ] 0 ⊢ X =ᵐ[μ] 0 ** filter_upwards [I] with ω hω ** case h Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 H : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ = 0 I : (fun ω => ↑‖X ω‖₊) =ᵐ[μ] 0 ω : Ω hω : ↑‖X ω‖₊ = OfNat.ofNat 0 ω ⊢ X ω = OfNat.ofNat 0 ω ** simpa using hω ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ ⊢ IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ ** have M : Measurable fun x : β => (‖x‖₊ : ℝ≥0∞) := measurable_nnnorm.coe_nnreal_ennreal ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X✝ Y✝ : Ω → ℝ β : Type u_2 inst✝² : MeasurableSpace β X Y : Ω → β inst✝¹ : NormedDivisionRing β inst✝ : BorelSpace β hXY : IndepFun X Y h'XY : Integrable (X * Y) hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 I : ∫⁻ (ω : Ω), ↑‖X ω‖₊ ∂μ ≠ 0 H : ∫⁻ (a : Ω), ↑‖Y a‖₊ ∂μ = ⊤ M : Measurable fun x => ↑‖x‖₊ ⊢ IndepFun (fun ω => ↑‖X ω‖₊) fun ω => ↑‖Y ω‖₊ ** apply IndepFun.comp hXY M M ** Qed
ProbabilityTheory.IndepFun.integral_mul_of_nonneg ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have h1 : AEMeasurable (fun a => ENNReal.ofReal (X a)) μ := ENNReal.measurable_ofReal.comp_aemeasurable hXm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have h2 : AEMeasurable (fun a => ENNReal.ofReal (Y a)) μ := ENNReal.measurable_ofReal.comp_aemeasurable hYm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have h3 : AEMeasurable (X * Y) μ := hXm.mul hYm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) h3 : AEMeasurable (X * Y) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have h4 : 0 ≤ᵐ[μ] X * Y := ae_of_all _ fun ω => mul_nonneg (hXp ω) (hYp ω) ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) h3 : AEMeasurable (X * Y) h4 : 0 ≤ᵐ[μ] X * Y ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ hXp) hXm.aestronglyMeasurable, integral_eq_lintegral_of_nonneg_ae (ae_of_all _ hYp) hYm.aestronglyMeasurable, integral_eq_lintegral_of_nonneg_ae h4 h3.aestronglyMeasurable] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) h3 : AEMeasurable (X * Y) h4 : 0 ≤ᵐ[μ] X * Y ⊢ ENNReal.toReal (∫⁻ (a : Ω), ENNReal.ofReal ((X * Y) a) ∂μ) = ENNReal.toReal (∫⁻ (a : Ω), ENNReal.ofReal (X a) ∂μ) * ENNReal.toReal (∫⁻ (a : Ω), ENNReal.ofReal (Y a) ∂μ) ** simp_rw [← ENNReal.toReal_mul, Pi.mul_apply, ENNReal.ofReal_mul (hXp _)] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) h3 : AEMeasurable (X * Y) h4 : 0 ≤ᵐ[μ] X * Y ⊢ ENNReal.toReal (∫⁻ (a : Ω), ENNReal.ofReal (X a) * ENNReal.ofReal (Y a) ∂μ) = ENNReal.toReal ((∫⁻ (a : Ω), ENNReal.ofReal (X a) ∂μ) * ∫⁻ (a : Ω), ENNReal.ofReal (Y a) ∂μ) ** congr ** case e_a Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) h3 : AEMeasurable (X * Y) h4 : 0 ≤ᵐ[μ] X * Y ⊢ ∫⁻ (a : Ω), ENNReal.ofReal (X a) * ENNReal.ofReal (Y a) ∂μ = (∫⁻ (a : Ω), ENNReal.ofReal (X a) ∂μ) * ∫⁻ (a : Ω), ENNReal.ofReal (Y a) ∂μ ** apply lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun' h1 h2 ** case e_a Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hXp : 0 ≤ X hYp : 0 ≤ Y hXm : AEMeasurable X hYm : AEMeasurable Y h1 : AEMeasurable fun a => ENNReal.ofReal (X a) h2 : AEMeasurable fun a => ENNReal.ofReal (Y a) h3 : AEMeasurable (X * Y) h4 : 0 ≤ᵐ[μ] X * Y ⊢ IndepFun (fun a => ENNReal.ofReal (X a)) fun a => ENNReal.ofReal (Y a) ** exact hXY.comp ENNReal.measurable_ofReal ENNReal.measurable_ofReal ** Qed
ProbabilityTheory.IndepFun.integral_mul_of_integrable ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** let pos : ℝ → ℝ := fun x => max x 0 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** let neg : ℝ → ℝ := fun x => max (-x) 0 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have posm : Measurable pos := measurable_id'.max measurable_const ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have negm : Measurable neg := measurable_id'.neg.max measurable_const ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** let Xp := pos ∘ X ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** let Xm := neg ∘ X ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** let Yp := pos ∘ Y ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** let Ym := neg ∘ Y ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hXpm : X = Xp - Xm := funext fun ω => (max_zero_sub_max_neg_zero_eq_self (X ω)).symm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hYpm : Y = Yp - Ym := funext fun ω => (max_zero_sub_max_neg_zero_eq_self (Y ω)).symm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hp1 : 0 ≤ Xm := fun ω => le_max_right _ _ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hp2 : 0 ≤ Xp := fun ω => le_max_right _ _ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hp3 : 0 ≤ Ym := fun ω => le_max_right _ _ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hp4 : 0 ≤ Yp := fun ω => le_max_right _ _ ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hm1 : AEMeasurable Xm μ := hX.1.aemeasurable.neg.max aemeasurable_const ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hm2 : AEMeasurable Xp μ := hX.1.aemeasurable.max aemeasurable_const ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hm3 : AEMeasurable Ym μ := hY.1.aemeasurable.neg.max aemeasurable_const ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hm4 : AEMeasurable Yp μ := hY.1.aemeasurable.max aemeasurable_const ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hv1 : Integrable Xm μ := hX.neg_part ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hv2 : Integrable Xp μ := hX.pos_part ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hv3 : Integrable Ym μ := hY.neg_part ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hv4 : Integrable Yp μ := hY.pos_part ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hi1 : IndepFun Xm Ym μ := hXY.comp negm negm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hi2 : IndepFun Xp Ym μ := hXY.comp posm negm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hi3 : IndepFun Xm Yp μ := hXY.comp negm posm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hi4 : IndepFun Xp Yp μ := hXY.comp posm posm ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hl1 : Integrable (Xm * Ym) μ := hi1.integrable_mul hv1 hv3 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hl2 : Integrable (Xp * Ym) μ := hi2.integrable_mul hv2 hv3 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hl3 : Integrable (Xm * Yp) μ := hi3.integrable_mul hv1 hv4 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) hl3 : Integrable (Xm * Yp) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hl4 : Integrable (Xp * Yp) μ := hi4.integrable_mul hv2 hv4 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) hl3 : Integrable (Xm * Yp) hl4 : Integrable (Xp * Yp) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hl5 : Integrable (Xp * Yp - Xm * Yp) μ := hl4.sub hl3 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) hl3 : Integrable (Xm * Yp) hl4 : Integrable (Xp * Yp) hl5 : Integrable (Xp * Yp - Xm * Yp) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have hl6 : Integrable (Xp * Ym - Xm * Ym) μ := hl2.sub hl1 ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) hl3 : Integrable (Xm * Yp) hl4 : Integrable (Xp * Yp) hl5 : Integrable (Xp * Yp - Xm * Yp) hl6 : Integrable (Xp * Ym - Xm * Ym) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** rw [hXpm, hYpm, mul_sub, sub_mul, sub_mul] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) hl3 : Integrable (Xm * Yp) hl4 : Integrable (Xp * Yp) hl5 : Integrable (Xp * Yp - Xm * Yp) hl6 : Integrable (Xp * Ym - Xm * Ym) ⊢ integral μ (Xp * Yp - Xm * Yp - (Xp * Ym - Xm * Ym)) = integral μ (Xp - Xm) * integral μ (Yp - Ym) ** rw [integral_sub' hl5 hl6, integral_sub' hl4 hl3, integral_sub' hl2 hl1, integral_sub' hv2 hv1, integral_sub' hv4 hv3, hi1.integral_mul_of_nonneg hp1 hp3 hm1 hm3, hi2.integral_mul_of_nonneg hp2 hp3 hm2 hm3, hi3.integral_mul_of_nonneg hp1 hp4 hm1 hm4, hi4.integral_mul_of_nonneg hp2 hp4 hm2 hm4] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : Integrable X hY : Integrable Y pos : ℝ → ℝ := fun x => max x 0 neg : ℝ → ℝ := fun x => max (-x) 0 posm : Measurable pos negm : Measurable neg Xp : Ω → ℝ := pos ∘ X Xm : Ω → ℝ := neg ∘ X Yp : Ω → ℝ := pos ∘ Y Ym : Ω → ℝ := neg ∘ Y hXpm : X = Xp - Xm hYpm : Y = Yp - Ym hp1 : 0 ≤ Xm hp2 : 0 ≤ Xp hp3 : 0 ≤ Ym hp4 : 0 ≤ Yp hm1 : AEMeasurable Xm hm2 : AEMeasurable Xp hm3 : AEMeasurable Ym hm4 : AEMeasurable Yp hv1 : Integrable Xm hv2 : Integrable Xp hv3 : Integrable Ym hv4 : Integrable Yp hi1 : IndepFun Xm Ym hi2 : IndepFun Xp Ym hi3 : IndepFun Xm Yp hi4 : IndepFun Xp Yp hl1 : Integrable (Xm * Ym) hl2 : Integrable (Xp * Ym) hl3 : Integrable (Xm * Yp) hl4 : Integrable (Xp * Yp) hl5 : Integrable (Xp * Yp - Xm * Yp) hl6 : Integrable (Xp * Ym - Xm * Ym) ⊢ integral μ Xp * integral μ Yp - integral μ Xm * integral μ Yp - (integral μ Xp * integral μ Ym - integral μ Xm * integral μ Ym) = (∫ (a : Ω), Xp a ∂μ - ∫ (a : Ω), Xm a ∂μ) * (∫ (a : Ω), Yp a ∂μ - ∫ (a : Ω), Ym a ∂μ) ** ring ** Qed
ProbabilityTheory.IndepFun.integral_mul ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** by_cases h'X : X =ᵐ[μ] 0 ** case neg Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** by_cases h'Y : Y =ᵐ[μ] 0 ** case neg Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** by_cases h : Integrable (X * Y) μ ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : X =ᵐ[μ] 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have h' : X * Y =ᵐ[μ] 0 := by filter_upwards [h'X] with ω hω simp [hω] ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : X =ᵐ[μ] 0 h' : X * Y =ᵐ[μ] 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** simp only [integral_congr_ae h'X, integral_congr_ae h', Pi.zero_apply, integral_const, Algebra.id.smul_eq_mul, mul_zero, zero_mul] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : X =ᵐ[μ] 0 ⊢ X * Y =ᵐ[μ] 0 ** filter_upwards [h'X] with ω hω ** case h Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : X =ᵐ[μ] 0 ω : Ω hω : X ω = OfNat.ofNat 0 ω ⊢ (X * Y) ω = OfNat.ofNat 0 ω ** simp [hω] ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : Y =ᵐ[μ] 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have h' : X * Y =ᵐ[μ] 0 := by filter_upwards [h'Y] with ω hω simp [hω] ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : Y =ᵐ[μ] 0 h' : X * Y =ᵐ[μ] 0 ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** simp only [integral_congr_ae h'Y, integral_congr_ae h', Pi.zero_apply, integral_const, Algebra.id.smul_eq_mul, mul_zero, zero_mul] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : Y =ᵐ[μ] 0 ⊢ X * Y =ᵐ[μ] 0 ** filter_upwards [h'Y] with ω hω ** case h Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : Y =ᵐ[μ] 0 ω : Ω hω : Y ω = OfNat.ofNat 0 ω ⊢ (X * Y) ω = OfNat.ofNat 0 ω ** simp [hω] ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : Integrable (X * Y) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have HX : Integrable X μ := hXY.integrable_left_of_integrable_mul h hX hY h'Y ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : Integrable (X * Y) HX : Integrable X ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** have HY : Integrable Y μ := hXY.integrable_right_of_integrable_mul h hX hY h'X ** case pos Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : Integrable (X * Y) HX : Integrable X HY : Integrable Y ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** exact hXY.integral_mul_of_integrable HX HY ** case neg Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : ¬Integrable (X * Y) ⊢ integral μ (X * Y) = integral μ X * integral μ Y ** rw [integral_undef h] ** case neg Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : ¬Integrable (X * Y) ⊢ 0 = integral μ X * integral μ Y ** have I : ¬(Integrable X μ ∧ Integrable Y μ) := by rintro ⟨HX, HY⟩ exact h (hXY.integrable_mul HX HY) ** case neg Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : ¬Integrable (X * Y) I : ¬(Integrable X ∧ Integrable Y) ⊢ 0 = integral μ X * integral μ Y ** rw [not_and_or] at I ** case neg Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : ¬Integrable (X * Y) I : ¬Integrable X ∨ ¬Integrable Y ⊢ 0 = integral μ X * integral μ Y ** cases' I with I I <;> simp [integral_undef I] ** Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : ¬Integrable (X * Y) ⊢ ¬(Integrable X ∧ Integrable Y) ** rintro ⟨HX, HY⟩ ** case intro Ω : Type u_1 mΩ : MeasurableSpace Ω μ : Measure Ω f g : Ω → ℝ≥0∞ X Y : Ω → ℝ hXY : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ h'X : ¬X =ᵐ[μ] 0 h'Y : ¬Y =ᵐ[μ] 0 h : ¬Integrable (X * Y) HX : Integrable X HY : Integrable Y ⊢ False ** exact h (hXY.integrable_mul HX HY) ** Qed
ProbabilityTheory.moment_zero ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω hp : p ≠ 0 ⊢ moment 0 p μ = 0 ** simp only [moment, hp, zero_pow', Ne.def, not_false_iff, Pi.zero_apply, integral_const, smul_eq_mul, mul_zero] ** Qed
ProbabilityTheory.centralMoment_zero ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω hp : p ≠ 0 ⊢ centralMoment 0 p μ = 0 ** simp only [centralMoment, hp, Pi.zero_apply, integral_const, smul_eq_mul, mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def, not_false_iff] ** Qed
ProbabilityTheory.centralMoment_one' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω inst✝ : IsFiniteMeasure μ h_int : Integrable X ⊢ centralMoment X 1 μ = (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ ** simp only [centralMoment, Pi.sub_apply, pow_one] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω inst✝ : IsFiniteMeasure μ h_int : Integrable X ⊢ ∫ (x : Ω), X x - ∫ (x : Ω), X x ∂μ ∂μ = (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ ** rw [integral_sub h_int (integrable_const _)] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω inst✝ : IsFiniteMeasure μ h_int : Integrable X ⊢ ∫ (a : Ω), X a ∂μ - ∫ (a : Ω), ∫ (x : Ω), X x ∂μ ∂μ = (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ ** simp only [sub_mul, integral_const, smul_eq_mul, one_mul] ** Qed
ProbabilityTheory.centralMoment_two_eq_variance ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω inst✝ : IsFiniteMeasure μ hX : Memℒp X 2 ⊢ centralMoment X 2 μ = variance X μ ** rw [hX.variance_eq] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω inst✝ : IsFiniteMeasure μ hX : Memℒp X 2 ⊢ centralMoment X 2 μ = ∫ (x : Ω), ((X - fun x => ∫ (x : Ω), X x ∂μ) ^ 2) x ∂μ ** rfl ** Qed
ProbabilityTheory.mgf_zero_fun ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ mgf 0 μ t = ENNReal.toReal (↑↑μ Set.univ) ** simp only [mgf, Pi.zero_apply, mul_zero, exp_zero, integral_const, smul_eq_mul, mul_one] ** Qed
ProbabilityTheory.cgf_zero_fun ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ cgf 0 μ t = log (ENNReal.toReal (↑↑μ Set.univ)) ** simp only [cgf, mgf_zero_fun] ** Qed
ProbabilityTheory.mgf_zero_measure ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ mgf X 0 t = 0 ** simp only [mgf, integral_zero_measure] ** Qed
ProbabilityTheory.mgf_const' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t c : ℝ ⊢ mgf (fun x => c) μ t = ENNReal.toReal (↑↑μ Set.univ) * rexp (t * c) ** simp only [mgf, integral_const, smul_eq_mul] ** Qed
ProbabilityTheory.mgf_const ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t c : ℝ inst✝ : IsProbabilityMeasure μ ⊢ mgf (fun x => c) μ t = rexp (t * c) ** simp only [mgf_const', measure_univ, ENNReal.one_toReal, one_mul] ** Qed
ProbabilityTheory.cgf_const' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ hμ : μ ≠ 0 c : ℝ ⊢ cgf (fun x => c) μ t = log (ENNReal.toReal (↑↑μ Set.univ)) + t * c ** simp only [cgf, mgf_const'] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ hμ : μ ≠ 0 c : ℝ ⊢ log (ENNReal.toReal (↑↑μ Set.univ) * rexp (t * c)) = log (ENNReal.toReal (↑↑μ Set.univ)) + t * c ** rw [log_mul _ (exp_pos _).ne'] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ hμ : μ ≠ 0 c : ℝ ⊢ log (ENNReal.toReal (↑↑μ Set.univ)) + log (rexp (t * c)) = log (ENNReal.toReal (↑↑μ Set.univ)) + t * c ** rw [log_exp _] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ hμ : μ ≠ 0 c : ℝ ⊢ ENNReal.toReal (↑↑μ Set.univ) ≠ 0 ** rw [Ne.def, ENNReal.toReal_eq_zero_iff, Measure.measure_univ_eq_zero] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ hμ : μ ≠ 0 c : ℝ ⊢ ¬(μ = 0 ∨ ↑↑μ Set.univ = ⊤) ** simp only [hμ, measure_ne_top μ Set.univ, or_self_iff, not_false_iff] ** Qed
ProbabilityTheory.mgf_zero' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ mgf X μ 0 = ENNReal.toReal (↑↑μ Set.univ) ** simp only [mgf, zero_mul, exp_zero, integral_const, smul_eq_mul, mul_one] ** Qed
ProbabilityTheory.mgf_zero ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsProbabilityMeasure μ ⊢ mgf X μ 0 = 1 ** simp only [mgf_zero', measure_univ, ENNReal.one_toReal] ** Qed
ProbabilityTheory.cgf_zero' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ cgf X μ 0 = log (ENNReal.toReal (↑↑μ Set.univ)) ** simp only [cgf, mgf_zero'] ** Qed
ProbabilityTheory.mgf_undef ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hX : ¬Integrable fun ω => rexp (t * X ω) ⊢ mgf X μ t = 0 ** simp only [mgf, integral_undef hX] ** Qed
ProbabilityTheory.mgf_nonneg ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ 0 ≤ mgf X μ t ** refine' integral_nonneg _ ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ 0 ≤ fun x => (fun ω => rexp (t * X ω)) x ** intro ω ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ω : Ω ⊢ OfNat.ofNat 0 ω ≤ (fun x => (fun ω => rexp (t * X ω)) x) ω ** simp only [Pi.zero_apply] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ω : Ω ⊢ 0 ≤ rexp (t * X ω) ** exact (exp_pos _).le ** Qed
ProbabilityTheory.mgf_pos' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) ⊢ 0 < mgf X μ t ** simp_rw [mgf] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) ⊢ 0 < ∫ (x : Ω), rexp (t * X x) ∂μ ** have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by simp only [Measure.restrict_univ] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ ⊢ 0 < ∫ (x : Ω), rexp (t * X x) ∂μ ** rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) ⊢ ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ ** simp only [Measure.restrict_univ] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ ⊢ 0 < ↑↑μ ((Function.support fun x => rexp (t * X x)) ∩ Set.univ) ** have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by ext1 x simp only [Function.mem_support, Set.mem_univ, iff_true_iff] exact (exp_pos _).ne' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ h_eq_univ : (Function.support fun x => rexp (t * X x)) = Set.univ ⊢ 0 < ↑↑μ ((Function.support fun x => rexp (t * X x)) ∩ Set.univ) ** rw [h_eq_univ, Set.inter_univ _] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ h_eq_univ : (Function.support fun x => rexp (t * X x)) = Set.univ ⊢ 0 < ↑↑μ Set.univ ** refine' Ne.bot_lt _ ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ h_eq_univ : (Function.support fun x => rexp (t * X x)) = Set.univ ⊢ ↑↑μ Set.univ ≠ ⊥ ** simp only [hμ, ENNReal.bot_eq_zero, Ne.def, Measure.measure_univ_eq_zero, not_false_iff] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ ⊢ (Function.support fun x => rexp (t * X x)) = Set.univ ** ext1 x ** case h Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ x : Ω ⊢ (x ∈ Function.support fun x => rexp (t * X x)) ↔ x ∈ Set.univ ** simp only [Function.mem_support, Set.mem_univ, iff_true_iff] ** case h Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ x : Ω ⊢ rexp (t * X x) ≠ 0 ** exact (exp_pos _).ne' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ ⊢ 0 ≤ᵐ[Measure.restrict μ Set.univ] fun x => rexp (t * X x) ** refine' eventually_of_forall fun x => _ ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ x : Ω ⊢ OfNat.ofNat 0 x ≤ (fun x => rexp (t * X x)) x ** rw [Pi.zero_apply] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ x : Ω ⊢ 0 ≤ (fun x => rexp (t * X x)) x ** exact (exp_pos _).le ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ hμ : μ ≠ 0 h_int_X : Integrable fun ω => rexp (t * X ω) this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ ⊢ IntegrableOn (fun x => rexp (t * X x)) Set.univ ** rwa [integrableOn_univ] ** Qed
ProbabilityTheory.mgf_neg ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ mgf (-X) μ t = mgf X μ (-t) ** simp_rw [mgf, Pi.neg_apply, mul_neg, neg_mul] ** Qed
ProbabilityTheory.cgf_neg ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ ⊢ cgf (-X) μ t = cgf X μ (-t) ** simp_rw [cgf, mgf_neg] ** Qed
ProbabilityTheory.IndepFun.exp_mul ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t✝ : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y s t : ℝ ⊢ IndepFun (fun ω => rexp (s * X ω)) fun ω => rexp (t * Y ω) ** have h_meas : ∀ t, Measurable fun x => exp (t * x) := fun t => (measurable_id'.const_mul t).exp ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t✝ : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y s t : ℝ h_meas : ∀ (t : ℝ), Measurable fun x => rexp (t * x) ⊢ IndepFun (fun ω => rexp (s * X ω)) fun ω => rexp (t * Y ω) ** change IndepFun ((fun x => exp (s * x)) ∘ X) ((fun x => exp (t * x)) ∘ Y) μ ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t✝ : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y s t : ℝ h_meas : ∀ (t : ℝ), Measurable fun x => rexp (t * x) ⊢ IndepFun ((fun x => rexp (s * x)) ∘ X) ((fun x => rexp (t * x)) ∘ Y) ** exact IndepFun.comp h_indep (h_meas s) (h_meas t) ** Qed
ProbabilityTheory.IndepFun.mgf_add' ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ ⊢ mgf (X + Y) μ t = mgf X μ t * mgf Y μ t ** have A : Continuous fun x : ℝ => exp (t * x) := by continuity ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ A : Continuous fun x => rexp (t * x) ⊢ mgf (X + Y) μ t = mgf X μ t * mgf Y μ t ** have h'X : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ := A.aestronglyMeasurable.comp_aemeasurable hX.aemeasurable ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ A : Continuous fun x => rexp (t * x) h'X : AEStronglyMeasurable (fun ω => rexp (t * X ω)) μ ⊢ mgf (X + Y) μ t = mgf X μ t * mgf Y μ t ** have h'Y : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ := A.aestronglyMeasurable.comp_aemeasurable hY.aemeasurable ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ A : Continuous fun x => rexp (t * x) h'X : AEStronglyMeasurable (fun ω => rexp (t * X ω)) μ h'Y : AEStronglyMeasurable (fun ω => rexp (t * Y ω)) μ ⊢ mgf (X + Y) μ t = mgf X μ t * mgf Y μ t ** exact h_indep.mgf_add h'X h'Y ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y hX : AEStronglyMeasurable X μ hY : AEStronglyMeasurable Y μ ⊢ Continuous fun x => rexp (t * x) ** continuity ** Qed
ProbabilityTheory.IndepFun.cgf_add ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y h_int_X : Integrable fun ω => rexp (t * X ω) h_int_Y : Integrable fun ω => rexp (t * Y ω) ⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t ** by_cases hμ : μ = 0 ** case neg Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y h_int_X : Integrable fun ω => rexp (t * X ω) h_int_Y : Integrable fun ω => rexp (t * Y ω) hμ : ¬μ = 0 ⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t ** simp only [cgf, h_indep.mgf_add h_int_X.aestronglyMeasurable h_int_Y.aestronglyMeasurable] ** case neg Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y h_int_X : Integrable fun ω => rexp (t * X ω) h_int_Y : Integrable fun ω => rexp (t * Y ω) hμ : ¬μ = 0 ⊢ log (mgf X μ t * mgf Y μ t) = log (mgf X μ t) + log (mgf Y μ t) ** exact log_mul (mgf_pos' hμ h_int_X).ne' (mgf_pos' hμ h_int_Y).ne' ** case pos Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y h_int_X : Integrable fun ω => rexp (t * X ω) h_int_Y : Integrable fun ω => rexp (t * Y ω) hμ : μ = 0 ⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t ** simp [hμ] ** Qed
ProbabilityTheory.aestronglyMeasurable_exp_mul_add ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_int_X : AEStronglyMeasurable (fun ω => rexp (t * X ω)) μ h_int_Y : AEStronglyMeasurable (fun ω => rexp (t * Y ω)) μ ⊢ AEStronglyMeasurable (fun ω => rexp (t * (X + Y) ω)) μ ** simp_rw [Pi.add_apply, mul_add, exp_add] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_int_X : AEStronglyMeasurable (fun ω => rexp (t * X ω)) μ h_int_Y : AEStronglyMeasurable (fun ω => rexp (t * Y ω)) μ ⊢ AEStronglyMeasurable (fun ω => rexp (t * X ω) * rexp (t * Y ω)) μ ** exact AEStronglyMeasurable.mul h_int_X h_int_Y ** Qed
ProbabilityTheory.IndepFun.integrable_exp_mul_add ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y h_int_X : Integrable fun ω => rexp (t * X ω) h_int_Y : Integrable fun ω => rexp (t * Y ω) ⊢ Integrable fun ω => rexp (t * (X + Y) ω) ** simp_rw [Pi.add_apply, mul_add, exp_add] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X✝ : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ X Y : Ω → ℝ h_indep : IndepFun X Y h_int_X : Integrable fun ω => rexp (t * X ω) h_int_Y : Integrable fun ω => rexp (t * Y ω) ⊢ Integrable fun ω => rexp (t * X ω) * rexp (t * Y ω) ** exact (h_indep.exp_mul t t).integrable_mul h_int_X h_int_Y ** Qed
ProbabilityTheory.measure_le_le_exp_mul_mgf ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ ε : ℝ ht : t ≤ 0 h_int : Integrable fun ω => rexp (t * X ω) ⊢ ENNReal.toReal (↑↑μ {ω | X ω ≤ ε}) ≤ rexp (-t * ε) * mgf X μ t ** rw [← neg_neg t, ← mgf_neg, neg_neg, ← neg_mul_neg (-t)] ** Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ ε : ℝ ht : t ≤ 0 h_int : Integrable fun ω => rexp (t * X ω) ⊢ ENNReal.toReal (↑↑μ {ω | X ω ≤ ε}) ≤ rexp (- -t * -ε) * mgf (-X) μ (-t) ** refine' Eq.trans_le _ (measure_ge_le_exp_mul_mgf (-ε) (neg_nonneg.mpr ht) _) ** case refine'_1 Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ ε : ℝ ht : t ≤ 0 h_int : Integrable fun ω => rexp (t * X ω) ⊢ ENNReal.toReal (↑↑μ {ω | X ω ≤ ε}) = ENNReal.toReal (↑↑μ {ω | -ε ≤ (-X) ω}) ** congr with ω ** case refine'_1.e_a.e_a.h Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ ε : ℝ ht : t ≤ 0 h_int : Integrable fun ω => rexp (t * X ω) ω : Ω ⊢ ω ∈ {ω | X ω ≤ ε} ↔ ω ∈ {ω | -ε ≤ (-X) ω} ** simp only [Pi.neg_apply, neg_le_neg_iff] ** case refine'_2 Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ ε : ℝ ht : t ≤ 0 h_int : Integrable fun ω => rexp (t * X ω) ⊢ Integrable fun ω => rexp (-t * (-X) ω) ** simp_rw [Pi.neg_apply, neg_mul_neg] ** case refine'_2 Ω : Type u_1 ι : Type u_2 m : MeasurableSpace Ω X : Ω → ℝ p : ℕ μ : Measure Ω t : ℝ inst✝ : IsFiniteMeasure μ ε : ℝ ht : t ≤ 0 h_int : Integrable fun ω => rexp (t * X ω) ⊢ Integrable fun ω => rexp (t * X ω) ** exact h_int ** Qed