formal
stringlengths
41
427k
informal
stringclasses
1 value
MeasureTheory.stoppedValue_hitting_mem ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m✝ : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrder ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β n m : ι ω : Ω h : ∃ j, j ∈ Set.Icc n m ∧ u j ω ∈ s ⊢ stoppedValue u (hitting u s n m) ω ∈ s ** simp only [stoppedValue, hitting, if_pos h] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m✝ : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrder ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β n m : ι ω : Ω h : ∃ j, j ∈ Set.Icc n m ∧ u j ω ∈ s ⊢ u (sInf (Set.Icc n m ∩ {i | u i ω ∈ s})) ω ∈ s ** obtain ⟨j, hj₁, hj₂⟩ := h ** case intro.intro Ω : Type u_1 β : Type u_2 ι : Type u_3 m✝ : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrder ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β n m : ι ω : Ω j : ι hj₁ : j ∈ Set.Icc n m hj₂ : u j ω ∈ s ⊢ u (sInf (Set.Icc n m ∩ {i | u i ω ∈ s})) ω ∈ s ** have : sInf (Set.Icc n m ∩ {i | u i ω ∈ s}) ∈ Set.Icc n m ∩ {i | u i ω ∈ s} := csInf_mem (Set.nonempty_of_mem ⟨hj₁, hj₂⟩) ** case intro.intro Ω : Type u_1 β : Type u_2 ι : Type u_3 m✝ : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrder ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β n m : ι ω : Ω j : ι hj₁ : j ∈ Set.Icc n m hj₂ : u j ω ∈ s this : sInf (Set.Icc n m ∩ {i | u i ω ∈ s}) ∈ Set.Icc n m ∩ {i | u i ω ∈ s} ⊢ u (sInf (Set.Icc n m ∩ {i | u i ω ∈ s})) ω ∈ s ** exact this.2 ** Qed
MeasureTheory.isStoppingTime_hitting_isStoppingTime ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u ⊢ IsStoppingTime f fun x => hitting u s (τ x) N x ** intro n ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι ⊢ MeasurableSet {ω | (fun x => hitting u s (τ x) N x) ω ≤ n} ** have h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i ≤ n, {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i > n, {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} := by ext x simp [← exists_or, ← or_and_right, le_or_lt] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} ⊢ MeasurableSet {ω | (fun x => hitting u s (τ x) N x) ω ≤ n} ** have h₂ : ⋃ i > n, {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} = ∅ := by ext x simp only [gt_iff_lt, Set.mem_iUnion, Set.mem_inter_iff, Set.mem_setOf_eq, exists_prop, Set.mem_empty_iff_false, iff_false_iff, not_exists, not_and, not_le] rintro m hm rfl exact lt_of_lt_of_le hm (le_hitting (hτbdd _) _) ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} h₂ : ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} = ∅ ⊢ MeasurableSet {ω | (fun x => hitting u s (τ x) N x) ω ≤ n} ** rw [h₁, h₂, Set.union_empty] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} h₂ : ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} = ∅ ⊢ MeasurableSet (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ** exact MeasurableSet.iUnion fun i => MeasurableSet.iUnion fun hi => (f.mono hi _ (hτ.measurableSet_eq i)).inter (hitting_isStoppingTime hf hs n) ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι ⊢ {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} ** ext x ** case h Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι x : Ω ⊢ x ∈ {x | hitting u s (τ x) N x ≤ n} ↔ x ∈ (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} ** simp [← exists_or, ← or_and_right, le_or_lt] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} ⊢ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} = ∅ ** ext x ** case h Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} x : Ω ⊢ x ∈ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} ↔ x ∈ ∅ ** simp only [gt_iff_lt, Set.mem_iUnion, Set.mem_inter_iff, Set.mem_setOf_eq, exists_prop, Set.mem_empty_iff_false, iff_false_iff, not_exists, not_and, not_le] ** case h Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} x : Ω ⊢ ∀ (x_1 : ι), n < x_1 → τ x = x_1 → n < hitting u s x_1 N x ** rintro m hm rfl ** case h Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁹ : ConditionallyCompleteLinearOrder ι inst✝⁸ : IsWellOrder ι fun x x_1 => x < x_1 inst✝⁷ : Countable ι inst✝⁶ : TopologicalSpace ι inst✝⁵ : OrderTopology ι inst✝⁴ : FirstCountableTopology ι inst✝³ : TopologicalSpace β inst✝² : PseudoMetrizableSpace β inst✝¹ : MeasurableSpace β inst✝ : BorelSpace β f : Filtration ι m u : ι → Ω → β τ : Ω → ι hτ : IsStoppingTime f τ N : ι hτbdd : ∀ (x : Ω), τ x ≤ N s : Set β hs : MeasurableSet s hf : Adapted f u n : ι h₁ : {x | hitting u s (τ x) N x ≤ n} = (⋃ i, ⋃ (_ : i ≤ n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n}) ∪ ⋃ i, ⋃ (_ : i > n), {x | τ x = i} ∩ {x | hitting u s i N x ≤ n} x : Ω hm : n < τ x ⊢ n < hitting u s (τ x) N x ** exact lt_of_lt_of_le hm (le_hitting (hτbdd _) _) ** Qed
MeasureTheory.hitting_eq_sInf ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝ : CompleteLattice ι u : ι → Ω → β s : Set β f : Filtration ι m ω : Ω ⊢ hitting u s ⊥ ⊤ ω = sInf {i | u i ω ∈ s} ** simp only [hitting, Set.mem_Icc, bot_le, le_top, and_self_iff, exists_true_left, Set.Icc_bot, Set.Iic_top, Set.univ_inter, ite_eq_left_iff, not_exists] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝ : CompleteLattice ι u : ι → Ω → β s : Set β f : Filtration ι m ω : Ω ⊢ (∀ (x : ι), ¬(x ∈ Set.univ ∧ u x ω ∈ s)) → ⊤ = sInf {i | u i ω ∈ s} ** intro h_nmem_s ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝ : CompleteLattice ι u : ι → Ω → β s : Set β f : Filtration ι m ω : Ω h_nmem_s : ∀ (x : ι), ¬(x ∈ Set.univ ∧ u x ω ∈ s) ⊢ ⊤ = sInf {i | u i ω ∈ s} ** symm ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝ : CompleteLattice ι u : ι → Ω → β s : Set β f : Filtration ι m ω : Ω h_nmem_s : ∀ (x : ι), ¬(x ∈ Set.univ ∧ u x ω ∈ s) ⊢ sInf {i | u i ω ∈ s} = ⊤ ** rw [sInf_eq_top] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝ : CompleteLattice ι u : ι → Ω → β s : Set β f : Filtration ι m ω : Ω h_nmem_s : ∀ (x : ι), ¬(x ∈ Set.univ ∧ u x ω ∈ s) ⊢ ∀ (a : ι), a ∈ {i | u i ω ∈ s} → a = ⊤ ** simp only [Set.mem_univ, true_and] at h_nmem_s ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝ : CompleteLattice ι u : ι → Ω → β s : Set β f : Filtration ι m ω : Ω h_nmem_s : ∀ (x : ι), ¬u x ω ∈ s ⊢ ∀ (a : ι), a ∈ {i | u i ω ∈ s} → a = ⊤ ** exact fun i hi_mem_s => absurd hi_mem_s (h_nmem_s i) ** Qed
MeasureTheory.hitting_bot_le_iff ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β f : Filtration ℕ m i n : ι ω : Ω hx : ∃ j, j ≤ n ∧ u j ω ∈ s ⊢ hitting u s ⊥ n ω ≤ i ↔ ∃ j, j ≤ i ∧ u j ω ∈ s ** cases' lt_or_le i n with hi hi ** case inl Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β f : Filtration ℕ m i n : ι ω : Ω hx : ∃ j, j ≤ n ∧ u j ω ∈ s hi : i < n ⊢ hitting u s ⊥ n ω ≤ i ↔ ∃ j, j ≤ i ∧ u j ω ∈ s ** rw [hitting_le_iff_of_lt _ hi] ** case inl Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β f : Filtration ℕ m i n : ι ω : Ω hx : ∃ j, j ≤ n ∧ u j ω ∈ s hi : i < n ⊢ (∃ j, j ∈ Set.Icc ⊥ i ∧ u j ω ∈ s) ↔ ∃ j, j ≤ i ∧ u j ω ∈ s ** simp ** case inr Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β f : Filtration ℕ m i n : ι ω : Ω hx : ∃ j, j ≤ n ∧ u j ω ∈ s hi : n ≤ i ⊢ hitting u s ⊥ n ω ≤ i ↔ ∃ j, j ≤ i ∧ u j ω ∈ s ** simp only [(hitting_le ω).trans hi, true_iff_iff] ** case inr Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β f : Filtration ℕ m i n : ι ω : Ω hx : ∃ j, j ≤ n ∧ u j ω ∈ s hi : n ≤ i ⊢ ∃ j, j ≤ i ∧ u j ω ∈ s ** obtain ⟨j, hj₁, hj₂⟩ := hx ** case inr.intro.intro Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝¹ : ConditionallyCompleteLinearOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 u : ι → Ω → β s : Set β f : Filtration ℕ m i n : ι ω : Ω hi : n ≤ i j : ι hj₁ : j ≤ n hj₂ : u j ω ∈ s ⊢ ∃ j, j ≤ i ∧ u j ω ∈ s ** exact ⟨j, hj₁.trans hi, hj₂⟩ ** Qed
PMF.support_pure ** α : Type u_1 β : Type u_2 γ : Type u_3 a a'✝ a' : α ⊢ a' ∈ support (pure a) ↔ a' ∈ {a} ** simp [mem_support_iff] ** Qed
PMF.mem_support_pure_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α ⊢ a' ∈ support (pure a) ↔ a' = a ** simp ** Qed
PMF.toOuterMeasure_pure_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α s : Set α ⊢ ↑(toOuterMeasure (pure a)) s = if a ∈ s then 1 else 0 ** refine' (toOuterMeasure_apply (pure a) s).trans _ ** α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α s : Set α ⊢ ∑' (x : α), Set.indicator s (↑(pure a)) x = if a ∈ s then 1 else 0 ** split_ifs with ha ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α s : Set α ha : a ∈ s ⊢ ∑' (x : α), Set.indicator s (↑(pure a)) x = 1 ** refine' (tsum_congr fun b => _).trans (tsum_ite_eq a 1) ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α s : Set α ha : a ∈ s b : α ⊢ Set.indicator s (↑(pure a)) b = if b = a then 1 else 0 ** exact ite_eq_left_iff.2 fun hb => symm (ite_eq_right_iff.2 fun h => (hb <| h.symm ▸ ha).elim) ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α s : Set α ha : ¬a ∈ s ⊢ ∑' (x : α), Set.indicator s (↑(pure a)) x = 0 ** refine' (tsum_congr fun b => _).trans tsum_zero ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 a a' : α s : Set α ha : ¬a ∈ s b : α ⊢ Set.indicator s (↑(pure a)) b = 0 ** exact ite_eq_right_iff.2 fun hb => ite_eq_right_iff.2 fun h => (ha <| h ▸ hb).elim ** Qed
PMF.support_bind ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : α → PMF β g : β → PMF γ b : β ⊢ b ∈ support (bind p f) ↔ b ∈ ⋃ a ∈ support p, support (f a) ** simp [mem_support_iff, ENNReal.tsum_eq_zero, not_or] ** Qed
PMF.pure_bind ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f✝ : α → PMF β g : β → PMF γ a : α f : α → PMF β ⊢ bind (pure a) f = f a ** have : ∀ b a', ite (a' = a) (f a' b) 0 = ite (a' = a) (f a b) 0 := fun b a' => by split_ifs with h <;> simp; subst h; simp ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f✝ : α → PMF β g : β → PMF γ a : α f : α → PMF β this : ∀ (b : β) (a' : α), (if a' = a then ↑(f a') b else 0) = if a' = a then ↑(f a) b else 0 ⊢ bind (pure a) f = f a ** ext b ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f✝ : α → PMF β g : β → PMF γ a : α f : α → PMF β this : ∀ (b : β) (a' : α), (if a' = a then ↑(f a') b else 0) = if a' = a then ↑(f a) b else 0 b : β ⊢ ↑(bind (pure a) f) b = ↑(f a) b ** simp [this] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f✝ : α → PMF β g : β → PMF γ a : α f : α → PMF β b : β a' : α ⊢ (if a' = a then ↑(f a') b else 0) = if a' = a then ↑(f a) b else 0 ** split_ifs with h <;> simp ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f✝ : α → PMF β g : β → PMF γ a : α f : α → PMF β b : β a' : α h : a' = a ⊢ ↑(f a') b = ↑(f a) b ** subst h ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f✝ : α → PMF β g : β → PMF γ f : α → PMF β b : β a' : α ⊢ ↑(f a') b = ↑(f a') b ** simp ** Qed
PMF.bind_bind ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : α → PMF β g : β → PMF γ b : γ ⊢ ↑(bind (bind p f) g) b = ↑(bind p fun a => bind (f a) g) b ** simpa only [ENNReal.coe_eq_coe.symm, bind_apply, ENNReal.tsum_mul_left.symm, ENNReal.tsum_mul_right.symm, mul_assoc, mul_left_comm, mul_comm] using ENNReal.tsum_comm ** Qed
PMF.bind_comm ** α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : α → PMF β g : β → PMF γ p : PMF α q : PMF β f : α → β → PMF γ b : γ ⊢ ↑(bind p fun a => bind q (f a)) b = ↑(bind q fun b => bind p fun a => f a b) b ** simpa only [ENNReal.coe_eq_coe.symm, bind_apply, ENNReal.tsum_mul_left.symm, ENNReal.tsum_mul_right.symm, mul_assoc, mul_left_comm, mul_comm] using ENNReal.tsum_comm ** Qed
PMF.toOuterMeasure_bind_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : α → PMF β g : β → PMF γ s : Set β ⊢ ↑(toOuterMeasure (bind p f)) s = ∑' (b : β), if b ∈ s then ∑' (a : α), ↑p a * ↑(f a) b else 0 ** simp [toOuterMeasure_apply, Set.indicator_apply] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : α → PMF β g : β → PMF γ s : Set β b : β ⊢ (if b ∈ s then ∑' (a : α), ↑p a * ↑(f a) b else 0) = ∑' (a : α), ↑p a * if b ∈ s then ↑(f a) b else 0 ** split_ifs <;> simp ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : α → PMF β g : β → PMF γ s : Set β a : α b : β ⊢ (if b ∈ s then ↑(f a) b else 0) = if b ∈ s then ↑(f a) b else 0 ** split_ifs <;> rfl ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : α → PMF β g : β → PMF γ s : Set β a : α ⊢ (↑p a * ∑' (b : β), if b ∈ s then ↑(f a) b else 0) = ↑p a * ↑(toOuterMeasure (f a)) s ** simp only [toOuterMeasure_apply, Set.indicator_apply] ** Qed
PMF.support_bindOnSupport ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β ⊢ support (bindOnSupport p f) = ⋃ a, ⋃ (h : a ∈ support p), support (f a h) ** refine' Set.ext fun b => _ ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β b : β ⊢ b ∈ support (bindOnSupport p f) ↔ b ∈ ⋃ a, ⋃ (h : a ∈ support p), support (f a h) ** simp only [ENNReal.tsum_eq_zero, not_or, mem_support_iff, bindOnSupport_apply, Ne.def, not_forall, mul_eq_zero, Set.mem_iUnion] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β b : β ⊢ (∃ x, ¬↑p x = 0 ∧ ¬(if h : ↑p x = 0 then 0 else ↑(f x (_ : ¬↑p x = 0)) b) = 0) ↔ ∃ i h, ¬↑(f i (_ : i ∈ support p)) b = 0 ** exact ⟨fun hb => let ⟨a, ⟨ha, ha'⟩⟩ := hb ⟨a, ha, by simpa [ha] using ha'⟩, fun hb => let ⟨a, ha, ha'⟩ := hb ⟨a, ⟨ha, by simpa [(mem_support_iff _ a).1 ha] using ha'⟩⟩⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β b : β hb : ∃ x, ¬↑p x = 0 ∧ ¬(if h : ↑p x = 0 then 0 else ↑(f x (_ : ¬↑p x = 0)) b) = 0 a : α ha : ¬↑p a = 0 ha' : ¬(if h : ↑p a = 0 then 0 else ↑(f a (_ : ¬↑p a = 0)) b) = 0 ⊢ ¬↑(f a (_ : a ∈ support p)) b = 0 ** simpa [ha] using ha' ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β b : β hb : ∃ i h, ¬↑(f i (_ : i ∈ support p)) b = 0 a : α ha : ¬↑p a = 0 ha' : ¬↑(f a (_ : a ∈ support p)) b = 0 ⊢ ¬(if h : ↑p a = 0 then 0 else ↑(f a (_ : ¬↑p a = 0)) b) = 0 ** simpa [(mem_support_iff _ a).1 ha] using ha' ** Qed
PMF.bindOnSupport_eq_bind ** α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α f : α → PMF β ⊢ (bindOnSupport p fun a x => f a) = bind p f ** ext b ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α f : α → PMF β b : β ⊢ ↑(bindOnSupport p fun a x => f a) b = ↑(bind p f) b ** have : ∀ a, ite (p a = 0) 0 (p a * f a b) = p a * f a b := fun a => ite_eq_right_iff.2 fun h => h.symm ▸ symm (zero_mul <| f a b) ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α f : α → PMF β b : β this : ∀ (a : α), (if ↑p a = 0 then 0 else ↑p a * ↑(f a) b) = ↑p a * ↑(f a) b ⊢ ↑(bindOnSupport p fun a x => f a) b = ↑(bind p f) b ** simp only [bindOnSupport_apply fun a _ => f a, p.bind_apply f, dite_eq_ite, mul_ite, mul_zero, this] ** Qed
PMF.bindOnSupport_eq_zero_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β b : β ⊢ ↑(bindOnSupport p f) b = 0 ↔ ∀ (a : α) (ha : ↑p a ≠ 0), ↑(f a ha) b = 0 ** simp only [bindOnSupport_apply, ENNReal.tsum_eq_zero, mul_eq_zero, or_iff_not_imp_left] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β b : β ⊢ (∀ (i : α), ¬↑p i = 0 → (if h : ↑p i = 0 then 0 else ↑(f i (_ : ¬↑p i = 0)) b) = 0) ↔ ∀ (a : α) (ha : ↑p a ≠ 0), ↑(f a ha) b = 0 ** exact ⟨fun h a ha => Trans.trans (dif_neg ha).symm (h a ha), fun h a ha => Trans.trans (dif_neg ha) (h a ha)⟩ ** Qed
PMF.bindOnSupport_comm ** α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α q : PMF β f : (a : α) → a ∈ support p → (b : β) → b ∈ support q → PMF γ ⊢ (bindOnSupport p fun a ha => bindOnSupport q (f a ha)) = bindOnSupport q fun b hb => bindOnSupport p fun a ha => f a ha b hb ** apply PMF.ext ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α q : PMF β f : (a : α) → a ∈ support p → (b : β) → b ∈ support q → PMF γ ⊢ ∀ (x : γ), ↑(bindOnSupport p fun a ha => bindOnSupport q (f a ha)) x = ↑(bindOnSupport q fun b hb => bindOnSupport p fun a ha => f a ha b hb) x ** rintro c ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α q : PMF β f : (a : α) → a ∈ support p → (b : β) → b ∈ support q → PMF γ c : γ ⊢ ↑(bindOnSupport p fun a ha => bindOnSupport q (f a ha)) c = ↑(bindOnSupport q fun b hb => bindOnSupport p fun a ha => f a ha b hb) c ** simp only [ENNReal.coe_eq_coe.symm, bindOnSupport_apply, ← tsum_dite_right, ENNReal.tsum_mul_left.symm, ENNReal.tsum_mul_right.symm] ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α q : PMF β f : (a : α) → a ∈ support p → (b : β) → b ∈ support q → PMF γ c : γ ⊢ (∑' (a : α) (i : β), ↑p a * if h : ↑p a = 0 then 0 else ↑q i * if h : ↑q i = 0 then 0 else ↑(f a (_ : ¬↑p a = 0) i (_ : ¬↑q i = 0)) c) = ∑' (a : β) (i : α), ↑q a * if h : ↑q a = 0 then 0 else ↑p i * if h : ↑p i = 0 then 0 else ↑(f i (_ : ¬↑p i = 0) a (_ : ¬↑q a = 0)) c ** refine' _root_.trans ENNReal.tsum_comm (tsum_congr fun b => tsum_congr fun a => _) ** case h α : Type u_1 β : Type u_2 γ : Type u_3 p✝ : PMF α f✝ : (a : α) → a ∈ support p✝ → PMF β p : PMF α q : PMF β f : (a : α) → a ∈ support p → (b : β) → b ∈ support q → PMF γ c : γ b : β a : α ⊢ (↑p a * if h : ↑p a = 0 then 0 else ↑q b * if h : ↑q b = 0 then 0 else ↑(f a (_ : ¬↑p a = 0) b (_ : ¬↑q b = 0)) c) = ↑q b * if h : ↑q b = 0 then 0 else ↑p a * if h : ↑p a = 0 then 0 else ↑(f a (_ : ¬↑p a = 0) b (_ : ¬↑q b = 0)) c ** split_ifs with h1 h2 h2 <;> ring ** Qed
PMF.toOuterMeasure_bindOnSupport_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β s : Set β ⊢ ↑(toOuterMeasure (bindOnSupport p f)) s = ∑' (a : α), ↑p a * if h : ↑p a = 0 then 0 else ↑(toOuterMeasure (f a h)) s ** simp only [toOuterMeasure_apply, Set.indicator_apply, bindOnSupport_apply] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β s : Set β ⊢ (∑' (x : β), if x ∈ s then ∑' (a : α), ↑p a * if h : ↑p a = 0 then 0 else ↑(f a (_ : ¬↑p a = 0)) x else 0) = ∑' (a : α), ↑p a * if h : ↑p a = 0 then 0 else ∑' (x : β), if x ∈ s then ↑(f a (_ : ¬↑p a = 0)) x else 0 ** calc (∑' b, ite (b ∈ s) (∑' a, p a * dite (p a = 0) (fun h => 0) fun h => f a h b) 0) = ∑' (b) (a), ite (b ∈ s) (p a * dite (p a = 0) (fun h => 0) fun h => f a h b) 0 := tsum_congr fun b => by split_ifs with hbs <;> simp only [eq_self_iff_true, tsum_zero] _ = ∑' (a) (b), ite (b ∈ s) (p a * dite (p a = 0) (fun h => 0) fun h => f a h b) 0 := ENNReal.tsum_comm _ = ∑' a, p a * ∑' b, ite (b ∈ s) (dite (p a = 0) (fun h => 0) fun h => f a h b) 0 := (tsum_congr fun a => by simp only [← ENNReal.tsum_mul_left, mul_ite, mul_zero]) _ = ∑' a, p a * dite (p a = 0) (fun h => 0) fun h => ∑' b, ite (b ∈ s) (f a h b) 0 := tsum_congr fun a => by split_ifs with ha <;> simp only [ite_self, tsum_zero, eq_self_iff_true] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β s : Set β b : β ⊢ (if b ∈ s then ∑' (a : α), ↑p a * if h : ↑p a = 0 then 0 else ↑(f a h) b else 0) = ∑' (a : α), if b ∈ s then ↑p a * if h : ↑p a = 0 then 0 else ↑(f a h) b else 0 ** split_ifs with hbs <;> simp only [eq_self_iff_true, tsum_zero] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β s : Set β a : α ⊢ (∑' (b : β), if b ∈ s then ↑p a * if h : ↑p a = 0 then 0 else ↑(f a h) b else 0) = ↑p a * ∑' (b : β), if b ∈ s then if h : ↑p a = 0 then 0 else ↑(f a h) b else 0 ** simp only [← ENNReal.tsum_mul_left, mul_ite, mul_zero] ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α f : (a : α) → a ∈ support p → PMF β s : Set β a : α ⊢ (↑p a * ∑' (b : β), if b ∈ s then if h : ↑p a = 0 then 0 else ↑(f a h) b else 0) = ↑p a * if h : ↑p a = 0 then 0 else ∑' (b : β), if b ∈ s then ↑(f a h) b else 0 ** split_ifs with ha <;> simp only [ite_self, tsum_zero, eq_self_iff_true] ** Qed
PMF.uniformOfFinset_apply_of_mem ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α ha : a ∈ s ⊢ ↑(uniformOfFinset s hs) a = (↑(Finset.card s))⁻¹ ** simp [ha] ** Qed
PMF.uniformOfFinset_apply_of_not_mem ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α ha : ¬a ∈ s ⊢ ↑(uniformOfFinset s hs) a = 0 ** simp [ha] ** Qed
PMF.support_uniformOfFinset ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α ⊢ ∀ (x : α), x ∈ support (uniformOfFinset s hs) ↔ x ∈ ↑s ** let ⟨a, ha⟩ := hs ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a✝ a : α ha : a ∈ s ⊢ ∀ (x : α), x ∈ support (uniformOfFinset s (_ : ∃ x, x ∈ s)) ↔ x ∈ ↑s ** simp [mem_support_iff, Finset.ne_empty_of_mem ha] ** Qed
PMF.mem_support_uniformOfFinset_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a✝ a : α ⊢ a ∈ support (uniformOfFinset s hs) ↔ a ∈ s ** simp ** Qed
PMF.toOuterMeasure_uniformOfFinset_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α t : Set α x : α ⊢ (if x ∈ t then ↑(uniformOfFinset s hs) x else 0) = if x ∈ s ∧ x ∈ t then (↑(Finset.card s))⁻¹ else 0 ** simp_rw [uniformOfFinset_apply, ← ite_and, and_comm] ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α t : Set α x : α hx : x ∈ Finset.filter (fun x => x ∈ t) s ⊢ (if x ∈ s ∧ x ∈ t then (↑(Finset.card s))⁻¹ else 0) = (↑(Finset.card s))⁻¹ ** let this : x ∈ s ∧ x ∈ t := by simpa using hx ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α t : Set α x : α hx : x ∈ Finset.filter (fun x => x ∈ t) s this : x ∈ s ∧ x ∈ t := Eq.mp Mathlib.Data.Finset.Basic._auxLemma.135 hx ⊢ (if x ∈ s ∧ x ∈ t then (↑(Finset.card s))⁻¹ else 0) = (↑(Finset.card s))⁻¹ ** simp only [this, and_self_iff, if_true] ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α t : Set α x : α hx : x ∈ Finset.filter (fun x => x ∈ t) s ⊢ x ∈ s ∧ x ∈ t ** simpa using hx ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Finset α hs : Finset.Nonempty s a : α t : Set α ⊢ ∑ _x in Finset.filter (fun x => x ∈ t) s, (↑(Finset.card s))⁻¹ = ↑(Finset.card (Finset.filter (fun x => x ∈ t) s)) / ↑(Finset.card s) ** simp only [div_eq_mul_inv, Finset.sum_const, nsmul_eq_mul] ** Qed
PMF.uniformOfFintype_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : Fintype α inst✝ : Nonempty α a : α ⊢ ↑(uniformOfFintype α) a = (↑(Fintype.card α))⁻¹ ** simp [uniformOfFintype, Finset.mem_univ, if_true, uniformOfFinset_apply] ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : Fintype α inst✝ : Nonempty α a : α ⊢ Finset.card Finset.univ = Fintype.card α ** rfl ** Qed
PMF.support_uniformOfFintype ** α✝ : Type u_1 β : Type u_2 γ : Type u_3 inst✝³ : Fintype α✝ inst✝² : Nonempty α✝ α : Type u_4 inst✝¹ : Fintype α inst✝ : Nonempty α x : α ⊢ x ∈ support (uniformOfFintype α) ↔ x ∈ ⊤ ** simp [mem_support_iff] ** Qed
PMF.mem_support_uniformOfFintype ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : Fintype α inst✝ : Nonempty α a : α ⊢ a ∈ support (uniformOfFintype α) ** simp ** Qed
PMF.toOuterMeasure_uniformOfFintype_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : Fintype α inst✝ : Nonempty α s : Set α ⊢ ↑(toOuterMeasure (uniformOfFintype α)) s = ↑(Fintype.card ↑s) / ↑(Fintype.card α) ** rw [uniformOfFintype, toOuterMeasure_uniformOfFinset_apply,Fintype.card_ofFinset] ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : Fintype α inst✝ : Nonempty α s : Set α ⊢ ↑(Finset.card (Finset.filter (fun x => x ∈ s) Finset.univ)) / ↑(Finset.card Finset.univ) = ↑(Finset.card (Finset.filter (fun x => x ∈ s) Finset.univ)) / ↑(Fintype.card α) ** rfl ** Qed
PMF.toMeasure_uniformOfFintype_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝² : Fintype α inst✝¹ : Nonempty α s : Set α inst✝ : MeasurableSpace α hs : MeasurableSet s ⊢ ↑↑(toMeasure (uniformOfFintype α)) s = ↑(Fintype.card ↑s) / ↑(Fintype.card α) ** simp [uniformOfFintype, hs] ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝² : Fintype α inst✝¹ : Nonempty α s : Set α inst✝ : MeasurableSpace α hs : MeasurableSet s ⊢ ↑(Finset.card (Finset.filter (fun x => x ∈ s) Finset.univ)) / ↑(Finset.card Finset.univ) = ↑(Finset.card (Finset.filter (fun x => x ∈ s) Finset.univ)) / ↑(Fintype.card α) ** rfl ** Qed
PMF.support_ofMultiset ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Multiset α hs : s ≠ 0 ⊢ ∀ (x : α), x ∈ support (ofMultiset s hs) ↔ x ∈ ↑(Multiset.toFinset s) ** simp [mem_support_iff, hs] ** Qed
PMF.mem_support_ofMultiset_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Multiset α hs : s ≠ 0 a : α ⊢ a ∈ support (ofMultiset s hs) ↔ a ∈ Multiset.toFinset s ** simp ** Qed
PMF.toOuterMeasure_ofMultiset_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Multiset α hs : s ≠ 0 t : Set α ⊢ ↑(toOuterMeasure (ofMultiset s hs)) t = (∑' (x : α), ↑(Multiset.count x (Multiset.filter (fun x => x ∈ t) s))) / ↑(↑Multiset.card s) ** simp_rw [div_eq_mul_inv, ← ENNReal.tsum_mul_right, toOuterMeasure_apply] ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Multiset α hs : s ≠ 0 t : Set α ⊢ ∑' (x : α), Set.indicator t (↑(ofMultiset s hs)) x = ∑' (i : α), ↑(Multiset.count i (Multiset.filter (fun x => x ∈ t) s)) * (↑(↑Multiset.card s))⁻¹ ** refine' tsum_congr fun x => _ ** α : Type u_1 β : Type u_2 γ : Type u_3 s : Multiset α hs : s ≠ 0 t : Set α x : α ⊢ Set.indicator t (↑(ofMultiset s hs)) x = ↑(Multiset.count x (Multiset.filter (fun x => x ∈ t) s)) * (↑(↑Multiset.card s))⁻¹ ** by_cases hx : x ∈ t <;> simp [Set.indicator, hx, div_eq_mul_inv] ** Qed
MeasureTheory.Filtration.adapted_natural ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝³ : TopologicalSpace β inst✝² : Preorder ι u✝ v : ι → Ω → β f : Filtration ι m inst✝¹ : MetrizableSpace β mβ : MeasurableSpace β inst✝ : BorelSpace β u : ι → Ω → β hum : ∀ (i : ι), StronglyMeasurable (u i) ⊢ Adapted (natural u hum) u ** intro i ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝³ : TopologicalSpace β inst✝² : Preorder ι u✝ v : ι → Ω → β f : Filtration ι m inst✝¹ : MetrizableSpace β mβ : MeasurableSpace β inst✝ : BorelSpace β u : ι → Ω → β hum : ∀ (i : ι), StronglyMeasurable (u i) i : ι ⊢ StronglyMeasurable (u i) ** rw [stronglyMeasurable_iff_measurable_separable] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝³ : TopologicalSpace β inst✝² : Preorder ι u✝ v : ι → Ω → β f : Filtration ι m inst✝¹ : MetrizableSpace β mβ : MeasurableSpace β inst✝ : BorelSpace β u : ι → Ω → β hum : ∀ (i : ι), StronglyMeasurable (u i) i : ι ⊢ Measurable (u i) ∧ IsSeparable (Set.range (u i)) ** exact ⟨measurable_iff_comap_le.2 le_rfl, (hum i).isSeparable_range⟩ ** Qed
MeasureTheory.ProgMeasurable.adapted ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝² : TopologicalSpace β inst✝¹ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝ : MeasurableSpace ι h : ProgMeasurable f u ⊢ Adapted f u ** intro i ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝² : TopologicalSpace β inst✝¹ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝ : MeasurableSpace ι h : ProgMeasurable f u i : ι ⊢ StronglyMeasurable (u i) ** have : u i = (fun p : Set.Iic i × Ω => u p.1 p.2) ∘ fun x => (⟨i, Set.mem_Iic.mpr le_rfl⟩, x) := rfl ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝² : TopologicalSpace β inst✝¹ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝ : MeasurableSpace ι h : ProgMeasurable f u i : ι this : u i = (fun p => u (↑p.1) p.2) ∘ fun x => ({ val := i, property := (_ : i ∈ Set.Iic i) }, x) ⊢ StronglyMeasurable (u i) ** rw [this] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝² : TopologicalSpace β inst✝¹ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝ : MeasurableSpace ι h : ProgMeasurable f u i : ι this : u i = (fun p => u (↑p.1) p.2) ∘ fun x => ({ val := i, property := (_ : i ∈ Set.Iic i) }, x) ⊢ StronglyMeasurable ((fun p => u (↑p.1) p.2) ∘ fun x => ({ val := i, property := (_ : i ∈ Set.Iic i) }, x)) ** exact (h i).comp_measurable measurable_prod_mk_left ** Qed
MeasureTheory.ProgMeasurable.comp ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁵ : TopologicalSpace β inst✝⁴ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝³ : MeasurableSpace ι t : ι → Ω → ι inst✝² : TopologicalSpace ι inst✝¹ : BorelSpace ι inst✝ : MetrizableSpace ι h : ProgMeasurable f u ht : ProgMeasurable f t ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i ⊢ ProgMeasurable f fun i ω => u (t i ω) ω ** intro i ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁵ : TopologicalSpace β inst✝⁴ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝³ : MeasurableSpace ι t : ι → Ω → ι inst✝² : TopologicalSpace ι inst✝¹ : BorelSpace ι inst✝ : MetrizableSpace ι h : ProgMeasurable f u ht : ProgMeasurable f t ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i i : ι ⊢ StronglyMeasurable fun p => (fun i ω => u (t i ω) ω) (↑p.1) p.2 ** have : (fun p : ↥(Set.Iic i) × Ω => u (t (p.fst : ι) p.snd) p.snd) = (fun p : ↥(Set.Iic i) × Ω => u (p.fst : ι) p.snd) ∘ fun p : ↥(Set.Iic i) × Ω => (⟨t (p.fst : ι) p.snd, Set.mem_Iic.mpr ((ht_le _ _).trans p.fst.prop)⟩, p.snd) := rfl ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁵ : TopologicalSpace β inst✝⁴ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝³ : MeasurableSpace ι t : ι → Ω → ι inst✝² : TopologicalSpace ι inst✝¹ : BorelSpace ι inst✝ : MetrizableSpace ι h : ProgMeasurable f u ht : ProgMeasurable f t ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i i : ι this : (fun p => u (t (↑p.1) p.2) p.2) = (fun p => u (↑p.1) p.2) ∘ fun p => ({ val := t (↑p.1) p.2, property := (_ : t (↑p.1) p.2 ∈ Set.Iic i) }, p.2) ⊢ StronglyMeasurable fun p => (fun i ω => u (t i ω) ω) (↑p.1) p.2 ** rw [this] ** Ω : Type u_1 β : Type u_2 ι : Type u_3 m : MeasurableSpace Ω inst✝⁵ : TopologicalSpace β inst✝⁴ : Preorder ι u v : ι → Ω → β f : Filtration ι m inst✝³ : MeasurableSpace ι t : ι → Ω → ι inst✝² : TopologicalSpace ι inst✝¹ : BorelSpace ι inst✝ : MetrizableSpace ι h : ProgMeasurable f u ht : ProgMeasurable f t ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i i : ι this : (fun p => u (t (↑p.1) p.2) p.2) = (fun p => u (↑p.1) p.2) ∘ fun p => ({ val := t (↑p.1) p.2, property := (_ : t (↑p.1) p.2 ∈ Set.Iic i) }, p.2) ⊢ StronglyMeasurable ((fun p => u (↑p.1) p.2) ∘ fun p => ({ val := t (↑p.1) p.2, property := (_ : t (↑p.1) p.2 ∈ Set.Iic i) }, p.2)) ** exact (h i).comp_measurable ((ht i).measurable.subtype_mk.prod_mk measurable_snd) ** Qed
PMF.apply_eq_zero_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α a : α ⊢ ↑p a = 0 ↔ ¬a ∈ support p ** rw [mem_support_iff, Classical.not_not] ** Qed
PMF.toOuterMeasure_apply_finset ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α s✝ t : Set α s : Finset α ⊢ ↑(toOuterMeasure p) ↑s = ∑ x in s, ↑p x ** refine' (toOuterMeasure_apply p s).trans ((tsum_eq_sum (s := s) _).trans _) ** case refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α s✝ t : Set α s : Finset α ⊢ ∀ (b : α), ¬b ∈ s → Set.indicator (↑s) (↑p) b = 0 ** exact fun x hx => Set.indicator_of_not_mem (Finset.mem_coe.not.2 hx) _ ** case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α s✝ t : Set α s : Finset α ⊢ ∑ b in s, Set.indicator (↑s) (↑p) b = ∑ x in s, ↑p x ** exact Finset.sum_congr rfl fun x hx => Set.indicator_of_mem (Finset.mem_coe.2 hx) _ ** Qed
PMF.toOuterMeasure_apply_singleton ** α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α s t : Set α a : α ⊢ ↑(toOuterMeasure p) {a} = ↑p a ** refine' (p.toOuterMeasure_apply {a}).trans ((tsum_eq_single a fun b hb => _).trans _) ** case refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α s t : Set α a b : α hb : b ≠ a ⊢ Set.indicator {a} (↑p) b = 0 ** exact ite_eq_right_iff.2 fun hb' => False.elim <| hb hb' ** case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 p : PMF α s t : Set α a : α ⊢ Set.indicator {a} (↑p) a = ↑p a ** exact ite_eq_left_iff.2 fun ha' => False.elim <| ha' rfl ** Qed
PMF.toMeasure_apply_inter_support ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝ : MeasurableSpace α p : PMF α s t : Set α hs : MeasurableSet s hp : MeasurableSet (support p) ⊢ ↑↑(toMeasure p) (s ∩ support p) = ↑↑(toMeasure p) s ** simp [p.toMeasure_apply_eq_toOuterMeasure_apply s hs, p.toMeasure_apply_eq_toOuterMeasure_apply _ (hs.inter hp)] ** Qed
PMF.toMeasure_injective ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : MeasurableSpace α p : PMF α s t : Set α inst✝ : MeasurableSingletonClass α ⊢ Function.Injective toMeasure ** intro p q h ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : MeasurableSpace α p✝ : PMF α s t : Set α inst✝ : MeasurableSingletonClass α p q : PMF α h : toMeasure p = toMeasure q ⊢ p = q ** ext x ** case h α : Type u_1 β : Type u_2 γ : Type u_3 inst✝¹ : MeasurableSpace α p✝ : PMF α s t : Set α inst✝ : MeasurableSingletonClass α p q : PMF α h : toMeasure p = toMeasure q x : α ⊢ ↑p x = ↑q x ** rw [← p.toMeasure_apply_singleton x <| measurableSet_singleton x, ← q.toMeasure_apply_singleton x <| measurableSet_singleton x, h] ** Qed
MeasureTheory.Measure.toPMF_toMeasure ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝³ : Countable α inst✝² : MeasurableSpace α inst✝¹ : MeasurableSingletonClass α μ : Measure α inst✝ : IsProbabilityMeasure μ s : Set α hs : MeasurableSet s ⊢ ↑↑(toMeasure (toPMF μ)) s = ↑↑μ s ** rw [μ.toPMF.toMeasure_apply s hs, ← μ.tsum_indicator_apply_singleton s hs] ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝³ : Countable α inst✝² : MeasurableSpace α inst✝¹ : MeasurableSingletonClass α μ : Measure α inst✝ : IsProbabilityMeasure μ s : Set α hs : MeasurableSet s ⊢ ∑' (x : α), Set.indicator s (↑(toPMF μ)) x = ∑' (x : α), Set.indicator s (fun x => ↑↑μ {x}) x ** rfl ** Qed
PMF.toMeasure_toPMF ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝³ : Countable α inst✝² : MeasurableSpace α inst✝¹ : MeasurableSingletonClass α p : PMF α μ : Measure α inst✝ : IsProbabilityMeasure μ x : α ⊢ ↑(Measure.toPMF (toMeasure p)) x = ↑p x ** rw [← p.toMeasure_apply_singleton x (measurableSet_singleton x), p.toMeasure.toPMF_apply] ** Qed
PMF.toMeasure_eq_iff_eq_toPMF ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝⁴ : Countable α inst✝³ : MeasurableSpace α inst✝² : MeasurableSingletonClass α p : PMF α μ✝ : Measure α inst✝¹ : IsProbabilityMeasure μ✝ μ : Measure α inst✝ : IsProbabilityMeasure μ ⊢ toMeasure p = μ ↔ p = Measure.toPMF μ ** rw [← toMeasure_inj, Measure.toPMF_toMeasure] ** Qed
PMF.toPMF_eq_iff_toMeasure_eq ** α : Type u_1 β : Type u_2 γ : Type u_3 inst✝⁴ : Countable α inst✝³ : MeasurableSpace α inst✝² : MeasurableSingletonClass α p : PMF α μ✝ : Measure α inst✝¹ : IsProbabilityMeasure μ✝ μ : Measure α inst✝ : IsProbabilityMeasure μ ⊢ Measure.toPMF μ = p ↔ μ = toMeasure p ** rw [← toMeasure_inj, Measure.toPMF_toMeasure] ** Qed
ProbabilityTheory.indepSets_singleton_iff ** Ω : Type u_1 ι : Type u_2 inst✝ : MeasurableSpace Ω s t : Set Ω μ : Measure Ω ⊢ IndepSets {s} {t} ↔ ↑↑μ (s ∩ t) = ↑↑μ s * ↑↑μ t ** simp only [IndepSets, kernel.indepSets_singleton_iff, ae_dirac_eq, Filter.eventually_pure, kernel.const_apply] ** Qed
ProbabilityTheory.iIndepFun_iff_measure_inter_preimage_eq_mul ** Ω : Type u_1 ι✝ : Type u_2 β✝ : Type u_3 β' : Type u_4 γ : Type u_5 γ' : Type u_6 mΩ : MeasurableSpace Ω μ : Measure Ω f✝ : Ω → β✝ g : Ω → β' ι : Type u_7 β : ι → Type u_8 m : (x : ι) → MeasurableSpace (β x) f : (i : ι) → Ω → β i ⊢ iIndepFun m f ↔ ∀ (S : Finset ι) {sets : (i : ι) → Set (β i)}, (∀ (i : ι), i ∈ S → MeasurableSet (sets i)) → ↑↑μ (⋂ i ∈ S, f i ⁻¹' sets i) = ∏ i in S, ↑↑μ (f i ⁻¹' sets i) ** simp only [iIndepFun, kernel.iIndepFun_iff_measure_inter_preimage_eq_mul, ae_dirac_eq, Filter.eventually_pure, kernel.const_apply] ** Qed
PMF.integral_eq_tsum ** α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f ⊢ ∫ (a : α), f a ∂toMeasure p = ∫ (a : α) in support p, f a ∂toMeasure p ** rw [restrict_toMeasure_support p] ** α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f ⊢ ∫ (a : α) in support p, f a ∂toMeasure p = ∑' (a : ↑(support p)), ENNReal.toReal (↑↑(toMeasure p) {↑a}) • f ↑a ** apply integral_countable f p.support_countable ** α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f ⊢ Integrable f ** rwa [restrict_toMeasure_support p] ** α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f ⊢ ∑' (a : ↑(support p)), ENNReal.toReal (↑↑(toMeasure p) {↑a}) • f ↑a = ∑' (a : ↑(support p)), ENNReal.toReal (↑p ↑a) • f ↑a ** congr with x ** case e_f.h α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f x : ↑(support p) ⊢ ENNReal.toReal (↑↑(toMeasure p) {↑x}) • f ↑x = ENNReal.toReal (↑p ↑x) • f ↑x ** congr ** case e_f.h.e_a.e_a α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f x : ↑(support p) ⊢ ↑↑(toMeasure p) {↑x} = ↑p ↑x ** apply PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _) ** α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f ⊢ Function.support ?m.4772 ⊆ ?m.4773 ** calc (fun a ↦ (p a).toReal • f a).support ⊆ (fun a ↦ (p a).toReal).support := Function.support_smul_subset_left _ _ _ ⊆ support p := fun x h1 h2 => h1 (by simp [h2]) ** α : Type u_1 inst✝⁴ : MeasurableSpace α inst✝³ : MeasurableSingletonClass α E : Type u_2 inst✝² : NormedAddCommGroup E inst✝¹ : NormedSpace ℝ E inst✝ : CompleteSpace E p : PMF α f : α → E hf : Integrable f x : α h1 : x ∈ Function.support fun a => ENNReal.toReal (↑p a) h2 : ↑p x = 0 ⊢ (fun a => ENNReal.toReal (↑p a)) x = 0 ** simp [h2] ** Qed
MeasureTheory.AEStronglyMeasurable.ae_integrable_condDistrib_map_iff ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hY : AEMeasurable Y hf : AEStronglyMeasurable f (Measure.map (fun a => (X a, Y a)) μ) ⊢ ((∀ᵐ (a : β) ∂Measure.map X μ, Integrable fun ω => f (a, ω)) ∧ Integrable fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂↑(condDistrib Y X μ) a) ↔ Integrable f ** rw [condDistrib, ← hf.ae_integrable_condKernel_iff, Measure.fst_map_prod_mk₀ hY] ** Qed
MeasureTheory.AEStronglyMeasurable.integral_condDistrib_map ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁸ : TopologicalSpace Ω inst✝⁷ : MeasurableSpace Ω inst✝⁶ : PolishSpace Ω inst✝⁵ : BorelSpace Ω inst✝⁴ : Nonempty Ω inst✝³ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝² : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F inst✝¹ : NormedSpace ℝ F inst✝ : CompleteSpace F hY : AEMeasurable Y hf : AEStronglyMeasurable f (Measure.map (fun a => (X a, Y a)) μ) ⊢ AEStronglyMeasurable (fun x => ∫ (y : Ω), f (x, y) ∂↑(condDistrib Y X μ) x) (Measure.map X μ) ** rw [← Measure.fst_map_prod_mk₀ hY, condDistrib] ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁸ : TopologicalSpace Ω inst✝⁷ : MeasurableSpace Ω inst✝⁶ : PolishSpace Ω inst✝⁵ : BorelSpace Ω inst✝⁴ : Nonempty Ω inst✝³ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝² : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F inst✝¹ : NormedSpace ℝ F inst✝ : CompleteSpace F hY : AEMeasurable Y hf : AEStronglyMeasurable f (Measure.map (fun a => (X a, Y a)) μ) ⊢ AEStronglyMeasurable (fun x => ∫ (y : Ω), f (x, y) ∂↑(Measure.condKernel (Measure.map (fun a => (X a, Y a)) μ)) x) (Measure.fst (Measure.map (fun a => (X a, Y a)) μ)) ** exact hf.integral_condKernel ** Qed
ProbabilityTheory.integrable_toReal_condDistrib ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hX : AEMeasurable X hs : MeasurableSet s ⊢ Integrable fun a => ENNReal.toReal (↑↑(↑(condDistrib Y X μ) (X a)) s) ** refine' integrable_toReal_of_lintegral_ne_top _ _ ** case refine'_1 α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hX : AEMeasurable X hs : MeasurableSet s ⊢ AEMeasurable fun a => ↑↑(↑(condDistrib Y X μ) (X a)) s ** exact Measurable.comp_aemeasurable (kernel.measurable_coe _ hs) hX ** case refine'_2 α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hX : AEMeasurable X hs : MeasurableSet s ⊢ ∫⁻ (x : α), ↑↑(↑(condDistrib Y X μ) (X x)) s ∂μ ≠ ⊤ ** refine' ne_of_lt _ ** case refine'_2 α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hX : AEMeasurable X hs : MeasurableSet s ⊢ ∫⁻ (x : α), ↑↑(↑(condDistrib Y X μ) (X x)) s ∂μ < ⊤ ** calc ∫⁻ a, condDistrib Y X μ (X a) s ∂μ ≤ ∫⁻ _, 1 ∂μ := lintegral_mono fun a => prob_le_one _ = μ univ := lintegral_one _ < ∞ := measure_lt_top _ _ ** Qed
MeasureTheory.Integrable.condDistrib_ae_map ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hY : AEMeasurable Y hf_int : Integrable f ⊢ ∀ᵐ (b : β) ∂Measure.map X μ, Integrable fun ω => f (b, ω) ** rw [condDistrib, ← Measure.fst_map_prod_mk₀ (X := X) hY] ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hY : AEMeasurable Y hf_int : Integrable f ⊢ ∀ᵐ (b : β) ∂Measure.fst (Measure.map (fun a => (X a, Y a)) μ), Integrable fun ω => f (b, ω) ** exact hf_int.condKernel_ae ** Qed
MeasureTheory.Integrable.integral_norm_condDistrib_map ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hY : AEMeasurable Y hf_int : Integrable f ⊢ Integrable fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂↑(condDistrib Y X μ) x ** rw [condDistrib, ← Measure.fst_map_prod_mk₀ (X := X) hY] ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hY : AEMeasurable Y hf_int : Integrable f ⊢ Integrable fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂↑(Measure.condKernel (Measure.map (fun a => (X a, Y a)) μ)) x ** exact hf_int.integral_norm_condKernel ** Qed
MeasureTheory.Integrable.norm_integral_condDistrib_map ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁸ : TopologicalSpace Ω inst✝⁷ : MeasurableSpace Ω inst✝⁶ : PolishSpace Ω inst✝⁵ : BorelSpace Ω inst✝⁴ : Nonempty Ω inst✝³ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝² : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F inst✝¹ : NormedSpace ℝ F inst✝ : CompleteSpace F hY : AEMeasurable Y hf_int : Integrable f ⊢ Integrable fun x => ‖∫ (y : Ω), f (x, y) ∂↑(condDistrib Y X μ) x‖ ** rw [condDistrib, ← Measure.fst_map_prod_mk₀ (X := X) hY] ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁸ : TopologicalSpace Ω inst✝⁷ : MeasurableSpace Ω inst✝⁶ : PolishSpace Ω inst✝⁵ : BorelSpace Ω inst✝⁴ : Nonempty Ω inst✝³ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝² : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F inst✝¹ : NormedSpace ℝ F inst✝ : CompleteSpace F hY : AEMeasurable Y hf_int : Integrable f ⊢ Integrable fun x => ‖∫ (y : Ω), f (x, y) ∂↑(Measure.condKernel (Measure.map (fun a => (X a, Y a)) μ)) x‖ ** exact hf_int.norm_integral_condKernel ** Qed
ProbabilityTheory.set_lintegral_preimage_condDistrib ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hX : Measurable X hY : AEMeasurable Y hs : MeasurableSet s ht : MeasurableSet t ⊢ ∫⁻ (a : α) in X ⁻¹' t, ↑↑(↑(condDistrib Y X μ) (X a)) s ∂μ = ↑↑μ (X ⁻¹' t ∩ Y ⁻¹' s) ** conv_lhs => arg 2; change (fun a => ((condDistrib Y X μ) a) s) ∘ X ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁶ : TopologicalSpace Ω inst✝⁵ : MeasurableSpace Ω inst✝⁴ : PolishSpace Ω inst✝³ : BorelSpace Ω inst✝² : Nonempty Ω inst✝¹ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝ : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F hX : Measurable X hY : AEMeasurable Y hs : MeasurableSet s ht : MeasurableSet t ⊢ lintegral (Measure.restrict μ (X ⁻¹' t)) ((fun a => ↑↑(↑(condDistrib Y X μ) a) s) ∘ X) = ↑↑μ (X ⁻¹' t ∩ Y ⁻¹' s) ** rw [lintegral_comp (kernel.measurable_coe _ hs) hX, condDistrib, ← Measure.restrict_map hX ht, ← Measure.fst_map_prod_mk₀ hY, set_lintegral_condKernel_eq_measure_prod _ ht hs, Measure.map_apply_of_aemeasurable (hX.aemeasurable.prod_mk hY) (ht.prod hs), mk_preimage_prod] ** Qed
ProbabilityTheory.condexp_prod_ae_eq_integral_condDistrib₀ ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁸ : TopologicalSpace Ω inst✝⁷ : MeasurableSpace Ω inst✝⁶ : PolishSpace Ω inst✝⁵ : BorelSpace Ω inst✝⁴ : Nonempty Ω inst✝³ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝² : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F inst✝¹ : NormedSpace ℝ F inst✝ : CompleteSpace F hX : Measurable X hY : AEMeasurable Y hf : AEStronglyMeasurable f (Measure.map (fun a => (X a, Y a)) μ) hf_int : Integrable fun a => f (X a, Y a) ⊢ Integrable f ** rwa [integrable_map_measure hf (hX.aemeasurable.prod_mk hY)] ** Qed
ProbabilityTheory.condexp_prod_ae_eq_integral_condDistrib ** α : Type u_1 β : Type u_2 Ω : Type u_3 F : Type u_4 inst✝⁸ : TopologicalSpace Ω inst✝⁷ : MeasurableSpace Ω inst✝⁶ : PolishSpace Ω inst✝⁵ : BorelSpace Ω inst✝⁴ : Nonempty Ω inst✝³ : NormedAddCommGroup F mα : MeasurableSpace α μ : Measure α inst✝² : IsFiniteMeasure μ X : α → β Y : α → Ω mβ : MeasurableSpace β s : Set Ω t : Set β f : β × Ω → F inst✝¹ : NormedSpace ℝ F inst✝ : CompleteSpace F hX : Measurable X hY : AEMeasurable Y hf : StronglyMeasurable f hf_int : Integrable fun a => f (X a, Y a) ⊢ Integrable f ** rwa [integrable_map_measure hf.aestronglyMeasurable (hX.aemeasurable.prod_mk hY)] ** Qed
ProbabilityTheory.kernel.measurable_kernel_prod_mk_left_of_finite ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t) ** refine' MeasurableSpace.induction_on_inter (C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t)) generateFrom_prod.symm isPiSystem_prod _ _ _ _ ht ** case refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) ⊢ (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) ∅ ** simp only [preimage_empty, measure_empty, measurable_const] ** case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) ⊢ ∀ (t : Set (α × β)), t ∈ image2 (fun x x_1 => x ×ˢ x_1) {s | MeasurableSet s} {t | MeasurableSet t} → (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) t ** intro t' ht' ** case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : t' ∈ image2 (fun x x_1 => x ×ˢ x_1) {s | MeasurableSet s} {t | MeasurableSet t} ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ** simp only [Set.mem_image2, Set.mem_setOf_eq, exists_and_left] at ht' ** case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : ∃ a, MeasurableSet a ∧ ∃ x, MeasurableSet x ∧ a ×ˢ x = t' ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ** obtain ⟨t₁, ht₁, t₂, ht₂, rfl⟩ := ht' ** case refine'_2.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t₁ ×ˢ t₂) ** classical simp_rw [mk_preimage_prod_right_eq_if] have h_eq_ite : (fun a => κ a (ite (a ∈ t₁) t₂ ∅)) = fun a => ite (a ∈ t₁) (κ a t₂) 0 := by ext1 a split_ifs exacts [rfl, measure_empty] rw [h_eq_ite] exact Measurable.ite ht₁ (kernel.measurable_coe κ ht₂) measurable_const ** case refine'_2.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t₁ ×ˢ t₂) ** simp_rw [mk_preimage_prod_right_eq_if] ** case refine'_2.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ ⊢ Measurable fun a => ↑↑(↑κ a) (if a ∈ t₁ then t₂ else ∅) ** have h_eq_ite : (fun a => κ a (ite (a ∈ t₁) t₂ ∅)) = fun a => ite (a ∈ t₁) (κ a t₂) 0 := by ext1 a split_ifs exacts [rfl, measure_empty] ** case refine'_2.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ h_eq_ite : (fun a => ↑↑(↑κ a) (if a ∈ t₁ then t₂ else ∅)) = fun a => if a ∈ t₁ then ↑↑(↑κ a) t₂ else 0 ⊢ Measurable fun a => ↑↑(↑κ a) (if a ∈ t₁ then t₂ else ∅) ** rw [h_eq_ite] ** case refine'_2.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ h_eq_ite : (fun a => ↑↑(↑κ a) (if a ∈ t₁ then t₂ else ∅)) = fun a => if a ∈ t₁ then ↑↑(↑κ a) t₂ else 0 ⊢ Measurable fun a => if a ∈ t₁ then ↑↑(↑κ a) t₂ else 0 ** exact Measurable.ite ht₁ (kernel.measurable_coe κ ht₂) measurable_const ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ ⊢ (fun a => ↑↑(↑κ a) (if a ∈ t₁ then t₂ else ∅)) = fun a => if a ∈ t₁ then ↑↑(↑κ a) t₂ else 0 ** ext1 a ** case h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ a : α ⊢ ↑↑(↑κ a) (if a ∈ t₁ then t₂ else ∅) = if a ∈ t₁ then ↑↑(↑κ a) t₂ else 0 ** split_ifs ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ a : α h✝ : a ∈ t₁ ⊢ ↑↑(↑κ a) t₂ = ↑↑(↑κ a) t₂ case neg α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t₁ : Set α ht₁ : MeasurableSet t₁ t₂ : Set β ht₂ : MeasurableSet t₂ a : α h✝ : ¬a ∈ t₁ ⊢ ↑↑(↑κ a) ∅ = 0 ** exacts [rfl, measure_empty] ** case refine'_3 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) ⊢ ∀ (t : Set (α × β)), MeasurableSet t → (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) t → (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) tᶜ ** intro t' ht' h_meas ** case refine'_3 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t'ᶜ) ** have h_eq_sdiff : ∀ a, Prod.mk a ⁻¹' t'ᶜ = Set.univ \ Prod.mk a ⁻¹' t' := by intro a ext1 b simp only [mem_compl_iff, mem_preimage, mem_diff, mem_univ, true_and_iff] ** case refine'_3 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t'ᶜ) ** simp_rw [h_eq_sdiff] ** case refine'_3 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' this : (fun a => ↑↑(↑κ a) (univ \ Prod.mk a ⁻¹' t')) = fun a => ↑↑(↑κ a) univ - ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ⊢ Measurable fun a => ↑↑(↑κ a) (univ \ Prod.mk a ⁻¹' t') ** rw [this] ** case refine'_3 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' this : (fun a => ↑↑(↑κ a) (univ \ Prod.mk a ⁻¹' t')) = fun a => ↑↑(↑κ a) univ - ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ⊢ Measurable fun a => ↑↑(↑κ a) univ - ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ** exact Measurable.sub (kernel.measurable_coe κ MeasurableSet.univ) h_meas ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ⊢ ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' ** intro a ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') a : α ⊢ Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' ** ext1 b ** case h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') a : α b : β ⊢ b ∈ Prod.mk a ⁻¹' t'ᶜ ↔ b ∈ univ \ Prod.mk a ⁻¹' t' ** simp only [mem_compl_iff, mem_preimage, mem_diff, mem_univ, true_and_iff] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' ⊢ (fun a => ↑↑(↑κ a) (univ \ Prod.mk a ⁻¹' t')) = fun a => ↑↑(↑κ a) univ - ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ** ext1 a ** case h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' a : α ⊢ ↑↑(↑κ a) (univ \ Prod.mk a ⁻¹' t') = ↑↑(↑κ a) univ - ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ** rw [← Set.diff_inter_self_eq_diff, Set.inter_univ, measure_diff (Set.subset_univ _)] ** case h.h₂ α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' a : α ⊢ MeasurableSet (Prod.mk a ⁻¹' t') ** exact (@measurable_prod_mk_left α β _ _ a) ht' ** case h.h_fin α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) t' : Set (α × β) ht' : MeasurableSet t' h_meas : Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t') h_eq_sdiff : ∀ (a : α), Prod.mk a ⁻¹' t'ᶜ = univ \ Prod.mk a ⁻¹' t' a : α ⊢ ↑↑(↑κ a) (Prod.mk a ⁻¹' t') ≠ ⊤ ** exact measure_ne_top _ _ ** case refine'_4 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) ⊢ ∀ (f : ℕ → Set (α × β)), Pairwise (Disjoint on f) → (∀ (i : ℕ), MeasurableSet (f i)) → (∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i)) → (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (⋃ i, f i) ** intro f h_disj hf_meas hf ** case refine'_4 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i) ** have h_Union : (fun a => κ a (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => κ a (⋃ i, Prod.mk a ⁻¹' f i) := by ext1 a congr with b simp only [mem_iUnion, mem_preimage] ** case refine'_4 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) ⊢ Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i) ** rw [h_Union] ** case refine'_4 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) h_tsum : (fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i)) = fun a => ∑' (i : ℕ), ↑↑(↑κ a) (Prod.mk a ⁻¹' f i) ⊢ Measurable fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) ** rw [h_tsum] ** case refine'_4 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) h_tsum : (fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i)) = fun a => ∑' (i : ℕ), ↑↑(↑κ a) (Prod.mk a ⁻¹' f i) ⊢ Measurable fun a => ∑' (i : ℕ), ↑↑(↑κ a) (Prod.mk a ⁻¹' f i) ** exact Measurable.ennreal_tsum hf ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) ⊢ (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) ** ext1 a ** case h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) a : α ⊢ ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i) = ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) ** congr with b ** case h.e_a.h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) a : α b : β ⊢ b ∈ Prod.mk a ⁻¹' ⋃ i, f i ↔ b ∈ ⋃ i, Prod.mk a ⁻¹' f i ** simp only [mem_iUnion, mem_preimage] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) ⊢ (fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i)) = fun a => ∑' (i : ℕ), ↑↑(↑κ a) (Prod.mk a ⁻¹' f i) ** ext1 a ** case h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α ⊢ ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) = ∑' (i : ℕ), ↑↑(↑κ a) (Prod.mk a ⁻¹' f i) ** rw [measure_iUnion] ** case h.hn α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α ⊢ Pairwise (Disjoint on fun i => Prod.mk a ⁻¹' f i) ** intro i j hij s hsi hsj b hbs ** case h.hn α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s ⊢ b ∈ ⊥ ** have habi : {(a, b)} ⊆ f i := by rw [Set.singleton_subset_iff]; exact hsi hbs ** case h.hn α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s habi : {(a, b)} ⊆ f i ⊢ b ∈ ⊥ ** have habj : {(a, b)} ⊆ f j := by rw [Set.singleton_subset_iff]; exact hsj hbs ** case h.hn α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s habi : {(a, b)} ⊆ f i habj : {(a, b)} ⊆ f j ⊢ b ∈ ⊥ ** simpa only [Set.bot_eq_empty, Set.le_eq_subset, Set.singleton_subset_iff, Set.mem_empty_iff_false] using h_disj hij habi habj ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s ⊢ {(a, b)} ⊆ f i ** rw [Set.singleton_subset_iff] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s ⊢ (a, b) ∈ f i ** exact hsi hbs ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s habi : {(a, b)} ⊆ f i ⊢ {(a, b)} ⊆ f j ** rw [Set.singleton_subset_iff] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α i j : ℕ hij : i ≠ j s : Set β hsi : s ≤ (fun i => Prod.mk a ⁻¹' f i) i hsj : s ≤ (fun i => Prod.mk a ⁻¹' f i) j b : β hbs : b ∈ s habi : {(a, b)} ⊆ f i ⊢ (a, b) ∈ f j ** exact hsj hbs ** case h.h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α t : Set (α × β) ht : MeasurableSet t hκs : ∀ (a : α), IsFiniteMeasure (↑κ a) f : ℕ → Set (α × β) h_disj : Pairwise (Disjoint on f) hf_meas : ∀ (i : ℕ), MeasurableSet (f i) hf : ∀ (i : ℕ), (fun t => Measurable fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' t)) (f i) h_Union : (fun a => ↑↑(↑κ a) (Prod.mk a ⁻¹' ⋃ i, f i)) = fun a => ↑↑(↑κ a) (⋃ i, Prod.mk a ⁻¹' f i) a : α ⊢ ∀ (i : ℕ), MeasurableSet (Prod.mk a ⁻¹' f i) ** exact fun i => (@measurable_prod_mk_left α β _ _ a) (hf_meas i) ** Qed
ProbabilityTheory.kernel.measurable_kernel_prod_mk_left' ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α inst✝ : IsSFiniteKernel η s : Set (β × γ) hs : MeasurableSet s a : α ⊢ Measurable fun b => ↑↑(↑η (a, b)) (Prod.mk b ⁻¹' s) ** have : ∀ b, Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p : (α × β) × γ | (p.1.2, p.2) ∈ s}} := by intro b; rfl ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α inst✝ : IsSFiniteKernel η s : Set (β × γ) hs : MeasurableSet s a : α this : ∀ (b : β), Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p | (p.1.2, p.2) ∈ s}} ⊢ Measurable fun b => ↑↑(↑η (a, b)) (Prod.mk b ⁻¹' s) ** simp_rw [this] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α inst✝ : IsSFiniteKernel η s : Set (β × γ) hs : MeasurableSet s a : α this : ∀ (b : β), Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p | (p.1.2, p.2) ∈ s}} ⊢ Measurable fun b => ↑↑(↑η (a, b)) {c | ((a, b), c) ∈ {p | (p.1.2, p.2) ∈ s}} ** refine' (measurable_kernel_prod_mk_left _).comp measurable_prod_mk_left ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α inst✝ : IsSFiniteKernel η s : Set (β × γ) hs : MeasurableSet s a : α this : ∀ (b : β), Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p | (p.1.2, p.2) ∈ s}} ⊢ MeasurableSet {p | (p.1.2, p.2) ∈ s} ** exact (measurable_fst.snd.prod_mk measurable_snd) hs ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α inst✝ : IsSFiniteKernel η s : Set (β × γ) hs : MeasurableSet s a : α ⊢ ∀ (b : β), Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p | (p.1.2, p.2) ∈ s}} ** intro b ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a✝ : α inst✝ : IsSFiniteKernel η s : Set (β × γ) hs : MeasurableSet s a : α b : β ⊢ Prod.mk b ⁻¹' s = {c | ((a, b), c) ∈ {p | (p.1.2, p.2) ∈ s}} ** rfl ** Qed
ProbabilityTheory.kernel.measurable_lintegral_indicator_const ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η t : Set (α × β) ht : MeasurableSet t c : ℝ≥0∞ ⊢ Measurable fun a => ∫⁻ (b : β), indicator t (Function.const (α × β) c) (a, b) ∂↑κ a ** conv => congr ext erw [lintegral_indicator_const_comp measurable_prod_mk_left ht _] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η t : Set (α × β) ht : MeasurableSet t c : ℝ≥0∞ ⊢ Measurable fun x => c * ↑↑(↑κ x) (Prod.mk x ⁻¹' t) ** exact Measurable.const_mul (measurable_kernel_prod_mk_left ht) c ** Qed
Measurable.lintegral_kernel_prod_right' ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → ℝ≥0∞ hf : Measurable f ⊢ Measurable fun a => ∫⁻ (b : β), f (a, b) ∂↑κ a ** refine' Measurable.lintegral_kernel_prod_right _ ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → ℝ≥0∞ hf : Measurable f ⊢ Measurable (uncurry fun a b => f (a, b)) ** have : (uncurry fun (a : α) (b : β) => f (a, b)) = f := by ext x; rw [uncurry_apply_pair] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → ℝ≥0∞ hf : Measurable f this : (uncurry fun a b => f (a, b)) = f ⊢ Measurable (uncurry fun a b => f (a, b)) ** rwa [this] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → ℝ≥0∞ hf : Measurable f ⊢ (uncurry fun a b => f (a, b)) = f ** ext x ** case h α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → ℝ≥0∞ hf : Measurable f x : α × β ⊢ uncurry (fun a b => f (a, b)) x = f x ** rw [uncurry_apply_pair] ** Qed
Measurable.lintegral_kernel_prod_right'' ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → ℝ≥0∞ hf : Measurable f ⊢ Measurable fun x => ∫⁻ (y : γ), f (x, y) ∂↑η (a, x) ** change Measurable ((fun x => ∫⁻ y, (fun u : (α × β) × γ => f (u.1.2, u.2)) (x, y) ∂η x) ∘ Prod.mk a) ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → ℝ≥0∞ hf : Measurable f ⊢ Measurable ((fun x => ∫⁻ (y : γ), (fun u => f (u.1.2, u.2)) (x, y) ∂↑η x) ∘ Prod.mk a) ** refine' (Measurable.lintegral_kernel_prod_right' (κ := η) (f := (fun u ↦ f (u.fst.snd, u.snd))) _).comp measurable_prod_mk_left ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → ℝ≥0∞ hf : Measurable f ⊢ Measurable fun u => f (u.1.2, u.2) ** exact hf.comp (measurable_fst.snd.prod_mk measurable_snd) ** Qed
Measurable.set_lintegral_kernel_prod_right ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α → β → ℝ≥0∞ hf : Measurable (uncurry f) s : Set β hs : MeasurableSet s ⊢ Measurable fun a => ∫⁻ (b : β) in s, f a b ∂↑κ a ** simp_rw [← lintegral_restrict κ hs] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α → β → ℝ≥0∞ hf : Measurable (uncurry f) s : Set β hs : MeasurableSet s ⊢ Measurable fun a => ∫⁻ (b : β), f a b ∂↑(kernel.restrict κ hs) a ** exact hf.lintegral_kernel_prod_right ** Qed
Measurable.set_lintegral_kernel_prod_left ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β → α → ℝ≥0∞ hf : Measurable (uncurry f) s : Set β hs : MeasurableSet s ⊢ Measurable fun b => ∫⁻ (a : β) in s, f a b ∂↑κ b ** simp_rw [← lintegral_restrict κ hs] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β → α → ℝ≥0∞ hf : Measurable (uncurry f) s : Set β hs : MeasurableSet s ⊢ Measurable fun b => ∫⁻ (a : β), f a b ∂↑(kernel.restrict κ hs) b ** exact hf.lintegral_kernel_prod_left ** Qed
ProbabilityTheory.measurableSet_kernel_integrable ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝² : NormedAddCommGroup E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α → β → E hf : StronglyMeasurable (uncurry f) ⊢ MeasurableSet {x | Integrable (f x)} ** simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and_iff] ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝² : NormedAddCommGroup E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α → β → E hf : StronglyMeasurable (uncurry f) ⊢ MeasurableSet {x | HasFiniteIntegral (f x)} ** exact measurableSet_lt (Measurable.lintegral_kernel_prod_right hf.ennnorm) measurable_const ** Qed
MeasureTheory.StronglyMeasurable.integral_kernel_prod_right' ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → E hf : StronglyMeasurable f ⊢ StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂↑κ x ** rw [← uncurry_curry f] at hf ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : α × β → E hf : StronglyMeasurable (uncurry (curry f)) ⊢ StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂↑κ x ** exact hf.integral_kernel_prod_right ** Qed
MeasureTheory.StronglyMeasurable.integral_kernel_prod_right'' ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → E hf : StronglyMeasurable f ⊢ StronglyMeasurable fun x => ∫ (y : γ), f (x, y) ∂↑η (a, x) ** change StronglyMeasurable ((fun x => ∫ y, (fun u : (α × β) × γ => f (u.1.2, u.2)) (x, y) ∂η x) ∘ fun x => (a, x)) ** α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → E hf : StronglyMeasurable f ⊢ StronglyMeasurable ((fun x => ∫ (y : γ), (fun u => f (u.1.2, u.2)) (x, y) ∂↑η x) ∘ fun x => (a, x)) ** refine' StronglyMeasurable.comp_measurable _ measurable_prod_mk_left ** case refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → E hf : StronglyMeasurable f ⊢ StronglyMeasurable fun x => ∫ (y : γ), (fun u => f (u.1.2, u.2)) (x, y) ∂↑η x case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → E hf : StronglyMeasurable f ⊢ MeasurableSpace α ** have := MeasureTheory.StronglyMeasurable.integral_kernel_prod_right' (κ := η) (hf.comp_measurable (measurable_fst.snd.prod_mk measurable_snd)) ** case refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → E hf : StronglyMeasurable f this : StronglyMeasurable fun x => ∫ (y : γ), (f ∘ fun a => (a.1.2, a.2)) (x, y) ∂↑η x ⊢ StronglyMeasurable fun x => ∫ (y : γ), (fun u => f (u.1.2, u.2)) (x, y) ∂↑η x case refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 mα : MeasurableSpace α mβ : MeasurableSpace β mγ : MeasurableSpace γ κ : { x // x ∈ kernel α β } η : { x // x ∈ kernel (α × β) γ } a : α E : Type u_4 inst✝⁴ : NormedAddCommGroup E inst✝³ : NormedSpace ℝ E inst✝² : CompleteSpace E inst✝¹ : IsSFiniteKernel κ inst✝ : IsSFiniteKernel η f : β × γ → E hf : StronglyMeasurable f ⊢ MeasurableSpace α ** simpa using this ** Qed
Thunk.ext ** α : Type u a b : Thunk α eq : Thunk.get a = Thunk.get b ⊢ a = b ** have ⟨_⟩ := a ** α : Type u a b : Thunk α fn✝ : Unit → α eq : Thunk.get { fn := fn✝ } = Thunk.get b ⊢ { fn := fn✝ } = b ** have ⟨_⟩ := b ** α : Type u a b : Thunk α fn✝¹ fn✝ : Unit → α eq : Thunk.get { fn := fn✝¹ } = Thunk.get { fn := fn✝ } ⊢ { fn := fn✝¹ } = { fn := fn✝ } ** congr ** case e_fn α : Type u a b : Thunk α fn✝¹ fn✝ : Unit → α eq : Thunk.get { fn := fn✝¹ } = Thunk.get { fn := fn✝ } ⊢ fn✝¹ = fn✝ ** exact funext fun _ ↦ eq ** Qed
PMF.map_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β p : PMF α b : β ⊢ ↑(map f p) b = ∑' (a : α), if b = f a then ↑p a else 0 ** simp [map] ** Qed
PMF.support_map ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β p : PMF α b✝ b : β ⊢ b ∈ support (map f p) ↔ b ∈ f '' support p ** simp [map, @eq_comm β b] ** Qed
PMF.mem_support_map_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β p : PMF α b : β ⊢ b ∈ support (map f p) ↔ ∃ a, a ∈ support p ∧ f a = b ** simp ** Qed
PMF.map_comp ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β p : PMF α b : β g : β → γ ⊢ map g (map f p) = map (g ∘ f) p ** simp [map, Function.comp] ** Qed
PMF.toOuterMeasure_map_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β p : PMF α b : β s : Set β ⊢ ↑(toOuterMeasure (map f p)) s = ↑(toOuterMeasure p) (f ⁻¹' s) ** simp [map, Set.indicator, toOuterMeasure_apply p (f ⁻¹' s)] ** Qed
PMF.seq_apply ** α : Type u_1 β : Type u_2 γ : Type u_3 q : PMF (α → β) p : PMF α b : β ⊢ ↑(seq q p) b = ∑' (f : α → β) (a : α), if b = f a then ↑q f * ↑p a else 0 ** simp only [seq, mul_boole, bind_apply, pure_apply] ** α : Type u_1 β : Type u_2 γ : Type u_3 q : PMF (α → β) p : PMF α b : β ⊢ (∑' (a : α → β), ↑q a * ∑' (a_1 : α), if b = a a_1 then ↑p a_1 else 0) = ∑' (f : α → β) (a : α), if b = f a then ↑q f * ↑p a else 0 ** refine' tsum_congr fun f => ENNReal.tsum_mul_left.symm.trans (tsum_congr fun a => _) ** α : Type u_1 β : Type u_2 γ : Type u_3 q : PMF (α → β) p : PMF α b : β f : α → β a : α ⊢ (↑q f * if b = f a then ↑p a else 0) = if b = f a then ↑q f * ↑p a else 0 ** simpa only [mul_zero] using mul_ite (b = f a) (q f) (p a) 0 ** Qed
PMF.support_seq ** α : Type u_1 β : Type u_2 γ : Type u_3 q : PMF (α → β) p : PMF α b✝ b : β ⊢ b ∈ support (seq q p) ↔ b ∈ ⋃ f ∈ support q, f '' support p ** simp [-mem_support_iff, seq, @eq_comm β b] ** Qed
PMF.mem_support_seq_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 q : PMF (α → β) p : PMF α b : β ⊢ b ∈ support (seq q p) ↔ ∃ f, f ∈ support q ∧ b ∈ f '' support p ** simp ** Qed
PMF.support_ofFinset ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → ℝ≥0∞ s : Finset α h : ∑ a in s, f a = 1 h' : ∀ (a : α), ¬a ∈ s → f a = 0 a : α ⊢ a ∈ support (ofFinset f s h h') ↔ a ∈ ↑s ∩ Function.support f ** simpa [mem_support_iff] using mt (h' a) ** Qed
PMF.mem_support_ofFinset_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → ℝ≥0∞ s : Finset α h : ∑ a in s, f a = 1 h' : ∀ (a : α), ¬a ∈ s → f a = 0 a : α ⊢ a ∈ support (ofFinset f s h h') ↔ a ∈ s ∧ f a ≠ 0 ** simp ** Qed
PMF.support_normalize ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → ℝ≥0∞ hf0 : tsum f ≠ 0 hf : tsum f ≠ ⊤ a : α ⊢ a ∈ support (normalize f hf0 hf) ↔ a ∈ Function.support f ** simp [hf, mem_support_iff] ** Qed
PMF.mem_support_normalize_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → ℝ≥0∞ hf0 : tsum f ≠ 0 hf : tsum f ≠ ⊤ a : α ⊢ a ∈ support (normalize f hf0 hf) ↔ f a ≠ 0 ** simp ** Qed
PMF.support_bernoulli ** α : Type u_1 β : Type u_2 γ : Type u_3 p : ℝ≥0∞ h : p ≤ 1 b : Bool ⊢ support (bernoulli p h) = {b | bif b then p ≠ 0 else p ≠ 1} ** refine' Set.ext fun b => _ ** α : Type u_1 β : Type u_2 γ : Type u_3 p : ℝ≥0∞ h : p ≤ 1 b✝ b : Bool ⊢ b ∈ support (bernoulli p h) ↔ b ∈ {b | bif b then p ≠ 0 else p ≠ 1} ** induction b ** case false α : Type u_1 β : Type u_2 γ : Type u_3 p : ℝ≥0∞ h : p ≤ 1 b : Bool ⊢ false ∈ support (bernoulli p h) ↔ false ∈ {b | bif b then p ≠ 0 else p ≠ 1} ** simp_rw [mem_support_iff, bernoulli_apply, Bool.cond_false, Ne.def, tsub_eq_zero_iff_le, not_le] ** case false α : Type u_1 β : Type u_2 γ : Type u_3 p : ℝ≥0∞ h : p ≤ 1 b : Bool ⊢ p < 1 ↔ false ∈ {b | bif b then ¬p = 0 else ¬p = 1} ** exact ⟨ne_of_lt, lt_of_le_of_ne h⟩ ** case true α : Type u_1 β : Type u_2 γ : Type u_3 p : ℝ≥0∞ h : p ≤ 1 b : Bool ⊢ true ∈ support (bernoulli p h) ↔ true ∈ {b | bif b then p ≠ 0 else p ≠ 1} ** simp only [mem_support_iff, bernoulli_apply, Bool.cond_true, Set.mem_setOf_eq] ** Qed
PMF.mem_support_bernoulli_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 p : ℝ≥0∞ h : p ≤ 1 b : Bool ⊢ b ∈ support (bernoulli p h) ↔ bif b then p ≠ 0 else p ≠ 1 ** simp ** Qed
MeasurableSpace.inf_le_invariants_comp ** α : Type u_1 inst✝ : MeasurableSpace α f g : α → α s : Set α hs : MeasurableSet s ⊢ f ∘ g ⁻¹' s = s ** rw [preimage_comp, hs.1.2, hs.2.2] ** Qed
MeasurableSpace.measurable_invariants_dom ** α : Type u_1 inst✝¹ : MeasurableSpace α β : Type u_2 inst✝ : MeasurableSpace β f : α → α g : α → β ⊢ Measurable g ↔ Measurable g ∧ ∀ (s : Set β), MeasurableSet s → g ∘ f ⁻¹' s = g ⁻¹' s ** simp only [Measurable, ← forall_and] ** α : Type u_1 inst✝¹ : MeasurableSpace α β : Type u_2 inst✝ : MeasurableSpace β f : α → α g : α → β ⊢ (∀ ⦃t : Set β⦄, MeasurableSet t → MeasurableSet (g ⁻¹' t)) ↔ ∀ (x : Set β), MeasurableSet x → MeasurableSet (g ⁻¹' x) ∧ g ∘ f ⁻¹' x = g ⁻¹' x ** rfl ** Qed
MeasurableSpace.measurable_invariants_of_semiconj ** α : Type u_1 inst✝¹ : MeasurableSpace α β : Type u_2 inst✝ : MeasurableSpace β fa : α → α fb : β → β g : α → β hg : Measurable g hfg : Semiconj g fa fb s : Set β hs : MeasurableSet s ⊢ fa ⁻¹' (g ⁻¹' s) = g ⁻¹' s ** rw [← preimage_comp, hfg.comp_eq, preimage_comp, hs.2] ** Qed
Language.mem_one ** α : Type u_1 β : Type u_2 γ : Type u_3 l m : Language α a b x✝ x : List α ⊢ x ∈ 1 ↔ x = [] ** rfl ** Qed
Language.nil_mem_kstar ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α x✝ : List α h : x✝ ∈ [] ⊢ x✝ ∈ l ** contradiction ** Qed
Language.map_id ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α ⊢ ↑(map id) l = l ** simp [map] ** Qed
Language.map_map ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α g : β → γ f : α → β l : Language α ⊢ ↑(map g) (↑(map f) l) = ↑(map (g ∘ f)) l ** simp [map, image_image] ** Qed
Language.kstar_def_nonempty ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α ⊢ l∗ = {x | ∃ S, x = join S ∧ ∀ (y : List α), y ∈ S → y ∈ l ∧ y ≠ []} ** ext x ** case h α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x✝ : List α l : Language α x : List α ⊢ x ∈ l∗ ↔ x ∈ {x | ∃ S, x = join S ∧ ∀ (y : List α), y ∈ S → y ∈ l ∧ y ≠ []} ** constructor ** case h.mp α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x✝ : List α l : Language α x : List α ⊢ x ∈ l∗ → x ∈ {x | ∃ S, x = join S ∧ ∀ (y : List α), y ∈ S → y ∈ l ∧ y ≠ []} ** rintro ⟨S, rfl, h⟩ ** case h.mp.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α S : List (List α) h : ∀ (y : List α), y ∈ S → y ∈ l ⊢ join S ∈ {x | ∃ S, x = join S ∧ ∀ (y : List α), y ∈ S → y ∈ l ∧ y ≠ []} ** refine' ⟨S.filter fun l ↦ ¬List.isEmpty l, by simp, fun y hy ↦ _⟩ ** case h.mp.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α S : List (List α) h : ∀ (y : List α), y ∈ S → y ∈ l y : List α hy : y ∈ filter (fun l => decide ¬isEmpty l = true) S ⊢ y ∈ l ∧ y ≠ [] ** rw [mem_filter, decide_not, Bool.decide_coe, Bool.not_eq_true', ← Bool.bool_iff_false, isEmpty_iff_eq_nil] at hy ** case h.mp.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α S : List (List α) h : ∀ (y : List α), y ∈ S → y ∈ l y : List α hy : y ∈ S ∧ ¬y = [] ⊢ y ∈ l ∧ y ≠ [] ** exact ⟨h y hy.1, hy.2⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α S : List (List α) h : ∀ (y : List α), y ∈ S → y ∈ l ⊢ join S = join (filter (fun l => decide ¬isEmpty l = true) S) ** simp ** case h.mpr α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x✝ : List α l : Language α x : List α ⊢ x ∈ {x | ∃ S, x = join S ∧ ∀ (y : List α), y ∈ S → y ∈ l ∧ y ≠ []} → x ∈ l∗ ** rintro ⟨S, hx, h⟩ ** case h.mpr.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x✝ : List α l : Language α x : List α S : List (List α) hx : x = join S h : ∀ (y : List α), y ∈ S → y ∈ l ∧ y ≠ [] ⊢ x ∈ l∗ ** exact ⟨S, hx, fun y hy ↦ (h y hy).1⟩ ** Qed
Language.le_mul_congr ** α : Type u_1 β : Type u_2 γ : Type u_3 l m : Language α a b x : List α l₁ l₂ m₁ m₂ : Language α ⊢ l₁ ≤ m₁ → l₂ ≤ m₂ → l₁ * l₂ ≤ m₁ * m₂ ** intro h₁ h₂ x hx ** α : Type u_1 β : Type u_2 γ : Type u_3 l m : Language α a b x✝ : List α l₁ l₂ m₁ m₂ : Language α h₁ : l₁ ≤ m₁ h₂ : l₂ ≤ m₂ x : List α hx : x ∈ l₁ * l₂ ⊢ x ∈ m₁ * m₂ ** simp only [mul_def, exists_and_left, mem_image2, image_prod] at hx ⊢ ** α : Type u_1 β : Type u_2 γ : Type u_3 l m : Language α a b x✝ : List α l₁ l₂ m₁ m₂ : Language α h₁ : l₁ ≤ m₁ h₂ : l₂ ≤ m₂ x : List α hx : ∃ a, a ∈ l₁ ∧ ∃ x_1, x_1 ∈ l₂ ∧ a ++ x_1 = x ⊢ ∃ a, a ∈ m₁ ∧ ∃ x_1, x_1 ∈ m₂ ∧ a ++ x_1 = x ** tauto ** Qed
Language.map_kstar ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α f : α → β l : Language α ⊢ ↑(map f) l∗ = (↑(map f) l)∗ ** rw [kstar_eq_iSup_pow, kstar_eq_iSup_pow] ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α f : α → β l : Language α ⊢ ↑(map f) (⨆ i, l ^ i) = ⨆ i, ↑(map f) l ^ i ** simp_rw [← map_pow] ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α f : α → β l : Language α ⊢ ↑(map f) (⨆ i, l ^ i) = ⨆ i, ↑(map f) (l ^ i) ** exact image_iUnion ** Qed
Language.one_add_self_mul_kstar_eq_kstar ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α ⊢ 1 + l * l∗ = l∗ ** simp only [kstar_eq_iSup_pow, mul_iSup, ← pow_succ, ← pow_zero l] ** α : Type u_1 β : Type u_2 γ : Type u_3 l✝ m : Language α a b x : List α l : Language α ⊢ l ^ 0 + ⨆ i, l ^ (i + 1) = ⨆ i, l ^ i ** exact sup_iSup_nat_succ _ ** Qed
RegularExpression.zero_rmatch ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α x : List α ⊢ rmatch 0 x = false ** induction x <;> simp [rmatch, matchEpsilon, *] ** Qed
RegularExpression.one_rmatch_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α x : List α ⊢ rmatch 1 x = true ↔ x = [] ** induction x <;> simp [rmatch, matchEpsilon, *] ** Qed
RegularExpression.mul_rmatch_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P Q : RegularExpression α x : List α ⊢ rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** induction' x with a x ih generalizing P Q ** case nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α ⊢ rmatch (P * Q) [] = true ↔ ∃ t u, [] = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** rw [rmatch] ** case nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α ⊢ matchEpsilon (P * Q) = true ↔ ∃ t u, [] = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** simp only [matchEpsilon] ** case nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α ⊢ (matchEpsilon P && matchEpsilon Q) = true ↔ ∃ t u, [] = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** constructor ** case nil.mp α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α ⊢ (matchEpsilon P && matchEpsilon Q) = true → ∃ t u, [] = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** intro h ** case nil.mp α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α h : (matchEpsilon P && matchEpsilon Q) = true ⊢ ∃ t u, [] = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** refine' ⟨[], [], rfl, _⟩ ** case nil.mp α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α h : (matchEpsilon P && matchEpsilon Q) = true ⊢ rmatch P [] = true ∧ rmatch Q [] = true ** rw [rmatch, rmatch] ** case nil.mp α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α h : (matchEpsilon P && matchEpsilon Q) = true ⊢ matchEpsilon P = true ∧ matchEpsilon Q = true ** rwa [Bool.and_coe_iff] at h ** case nil.mpr α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α ⊢ (∃ t u, [] = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true) → (matchEpsilon P && matchEpsilon Q) = true ** rintro ⟨t, u, h₁, h₂⟩ ** case nil.mpr.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α t u : List α h₁ : [] = t ++ u h₂ : rmatch P t = true ∧ rmatch Q u = true ⊢ (matchEpsilon P && matchEpsilon Q) = true ** cases' List.append_eq_nil.1 h₁.symm with ht hu ** case nil.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α t u : List α h₁ : [] = t ++ u h₂ : rmatch P t = true ∧ rmatch Q u = true ht : t = [] hu : u = [] ⊢ (matchEpsilon P && matchEpsilon Q) = true ** subst ht ** case nil.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α u : List α hu : u = [] h₁ : [] = [] ++ u h₂ : rmatch P [] = true ∧ rmatch Q u = true ⊢ (matchEpsilon P && matchEpsilon Q) = true ** subst hu ** case nil.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α h₁ : [] = [] ++ [] h₂ : rmatch P [] = true ∧ rmatch Q [] = true ⊢ (matchEpsilon P && matchEpsilon Q) = true ** repeat' rw [rmatch] at h₂ ** case nil.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α h₁ : [] = [] ++ [] h₂ : matchEpsilon P = true ∧ matchEpsilon Q = true ⊢ (matchEpsilon P && matchEpsilon Q) = true ** simp [h₂] ** case nil.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P✝ Q✝ P Q : RegularExpression α h₁ : [] = [] ++ [] h₂ : matchEpsilon P = true ∧ rmatch Q [] = true ⊢ (matchEpsilon P && matchEpsilon Q) = true ** rw [rmatch] at h₂ ** case cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α ⊢ rmatch (P * Q) (a :: x) = true ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** rw [rmatch] ** case cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α ⊢ rmatch (deriv (P * Q) a) x = true ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** simp [deriv] ** case cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α ⊢ rmatch (if matchEpsilon P = true then deriv P a * Q + deriv Q a else deriv P a * Q) x = true ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** split_ifs with hepsilon ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true ⊢ rmatch (deriv P a * Q + deriv Q a) x = true ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** rw [add_rmatch_iff, ih] ** case pos α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ∨ rmatch (deriv Q a) x = true ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** constructor ** case pos.mp α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ∨ rmatch (deriv Q a) x = true → ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** rintro (⟨t, u, _⟩ | h) ** case pos.mp.inl.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true t u : List α h✝ : x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ⊢ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** exact ⟨a :: t, u, by tauto⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true t u : List α h✝ : x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ⊢ a :: x = a :: t ++ u ∧ rmatch P (a :: t) = true ∧ rmatch Q u = true ** tauto ** case pos.mp.inr α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true h : rmatch (deriv Q a) x = true ⊢ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** exact ⟨[], a :: x, rfl, hepsilon, h⟩ ** case pos.mpr α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true ⊢ (∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true) → (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ∨ rmatch (deriv Q a) x = true ** rintro ⟨t, u, h, hP, hQ⟩ ** case pos.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true t u : List α h : a :: x = t ++ u hP : rmatch P t = true hQ : rmatch Q u = true ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ∨ rmatch (deriv Q a) x = true ** cases' t with b t ** case pos.mpr.intro.intro.intro.intro.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true h : a :: x = [] ++ u hP : rmatch P [] = true ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ∨ rmatch (deriv Q a) x = true ** right ** case pos.mpr.intro.intro.intro.intro.nil.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true h : a :: x = [] ++ u hP : rmatch P [] = true ⊢ rmatch (deriv Q a) x = true ** rw [List.nil_append] at h ** case pos.mpr.intro.intro.intro.intro.nil.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true h : a :: x = u hP : rmatch P [] = true ⊢ rmatch (deriv Q a) x = true ** rw [← h] at hQ ** case pos.mpr.intro.intro.intro.intro.nil.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q (a :: x) = true h : a :: x = u hP : rmatch P [] = true ⊢ rmatch (deriv Q a) x = true ** exact hQ ** case pos.mpr.intro.intro.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a :: x = b :: t ++ u hP : rmatch P (b :: t) = true ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ∨ rmatch (deriv Q a) x = true ** left ** case pos.mpr.intro.intro.intro.intro.cons.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a :: x = b :: t ++ u hP : rmatch P (b :: t) = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ** rw [List.cons_append, List.cons_eq_cons] at h ** case pos.mpr.intro.intro.intro.intro.cons.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch P (b :: t) = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ** refine' ⟨t, u, h.2, _, hQ⟩ ** case pos.mpr.intro.intro.intro.intro.cons.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch P (b :: t) = true ⊢ rmatch (deriv P a) t = true ** rw [rmatch] at hP ** case pos.mpr.intro.intro.intro.intro.cons.h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch (deriv P b) t = true ⊢ rmatch (deriv P a) t = true ** convert hP ** case h.e'_2.h.e'_3.h.e'_4 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch (deriv P b) t = true ⊢ a = b ** exact h.1 ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true ⊢ rmatch (deriv P a * Q) x = true ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** rw [ih] ** case neg α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true) ↔ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** constructor <;> rintro ⟨t, u, h, hP, hQ⟩ ** case neg.mp.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true t u : List α h : x = t ++ u hP : rmatch (deriv P a) t = true hQ : rmatch Q u = true ⊢ ∃ t u, a :: x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true ** exact ⟨a :: t, u, by tauto⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true t u : List α h : x = t ++ u hP : rmatch (deriv P a) t = true hQ : rmatch Q u = true ⊢ a :: x = a :: t ++ u ∧ rmatch P (a :: t) = true ∧ rmatch Q u = true ** tauto ** case neg.mpr.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true t u : List α h : a :: x = t ++ u hP : rmatch P t = true hQ : rmatch Q u = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ** cases' t with b t ** case neg.mpr.intro.intro.intro.intro.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true u : List α hQ : rmatch Q u = true h : a :: x = [] ++ u hP : rmatch P [] = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ** contradiction ** case neg.mpr.intro.intro.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a :: x = b :: t ++ u hP : rmatch P (b :: t) = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ** rw [List.cons_append, List.cons_eq_cons] at h ** case neg.mpr.intro.intro.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch P (b :: t) = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch Q u = true ** refine' ⟨t, u, h.2, _, hQ⟩ ** case neg.mpr.intro.intro.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch P (b :: t) = true ⊢ rmatch (deriv P a) t = true ** rw [rmatch] at hP ** case neg.mpr.intro.intro.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch (deriv P b) t = true ⊢ rmatch (deriv P a) t = true ** convert hP ** case h.e'_2.h.e'_3.h.e'_4 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P✝ Q✝ : RegularExpression α a : α x : List α ih : ∀ (P Q : RegularExpression α), rmatch (P * Q) x = true ↔ ∃ t u, x = t ++ u ∧ rmatch P t = true ∧ rmatch Q u = true P Q : RegularExpression α hepsilon : ¬matchEpsilon P = true u : List α hQ : rmatch Q u = true b : α t : List α h : a = b ∧ x = t ++ u hP : rmatch (deriv P b) t = true ⊢ a = b ** exact h.1 ** Qed
RegularExpression.star_rmatch_iff ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α ⊢ rmatch (star P) x = true ↔ ∃ S, x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** have A : ∀ m n : ℕ, n < m + n + 1 := by intro m n convert add_lt_add_of_le_of_lt (add_le_add (zero_le m) (le_refl n)) zero_lt_one simp ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α A : ∀ (m n : ℕ), n < m + n + 1 ⊢ rmatch (star P) x = true ↔ ∃ S, x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** have IH := fun t (_h : List.length t < List.length x) => star_rmatch_iff P t ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length x → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) ⊢ rmatch (star P) x = true ↔ ∃ S, x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** constructor ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α ⊢ ∀ (m n : ℕ), n < m + n + 1 ** intro m n ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α m n : ℕ ⊢ n < m + n + 1 ** convert add_lt_add_of_le_of_lt (add_le_add (zero_le m) (le_refl n)) zero_lt_one ** case h.e'_3 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α m n : ℕ ⊢ n = 0 + n + 0 ** simp ** case mp α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length x → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) ⊢ rmatch (star P) x = true → ∃ S, x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** cases' x with a x ** case mp.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length [] → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) ⊢ rmatch (star P) [] = true → ∃ S, [] = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** intro _h ** case mp.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length [] → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) _h : rmatch (star P) [] = true ⊢ ∃ S, [] = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** use [] ** case h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length [] → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) _h : rmatch (star P) [] = true ⊢ [] = join [] ∧ ∀ (t : List α), t ∈ [] → t ≠ [] ∧ rmatch P t = true ** dsimp ** case h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length [] → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) _h : rmatch (star P) [] = true ⊢ [] = [] ∧ ∀ (t : List α), t ∈ [] → ¬t = [] ∧ rmatch P t = true ** tauto ** case mp.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) ⊢ rmatch (star P) (a :: x) = true → ∃ S, a :: x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** rw [rmatch, deriv, mul_rmatch_iff] ** case mp.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) ⊢ (∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true) → ∃ S, a :: x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** rintro ⟨t, u, hs, ht, hu⟩ ** case mp.cons.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hu : rmatch (star P) u = true ⊢ ∃ S, a :: x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** have hwf : u.length < (List.cons a x).length := by rw [hs, List.length_cons, List.length_append] apply A ** case mp.cons.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hu : rmatch (star P) u = true hwf : length u < length (a :: x) ⊢ ∃ S, a :: x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** rw [IH _ hwf] at hu ** case mp.cons.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hu : ∃ S, u = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true hwf : length u < length (a :: x) ⊢ ∃ S, a :: x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** rcases hu with ⟨S', hsum, helem⟩ ** case mp.cons.intro.intro.intro.intro.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ ∃ S, a :: x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** use (a :: t) :: S' ** case h α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ a :: x = join ((a :: t) :: S') ∧ ∀ (t_1 : List α), t_1 ∈ (a :: t) :: S' → t_1 ≠ [] ∧ rmatch P t_1 = true ** constructor ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hu : rmatch (star P) u = true ⊢ length u < length (a :: x) ** rw [hs, List.length_cons, List.length_append] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hu : rmatch (star P) u = true ⊢ length u < Nat.succ (length t + length u) ** apply A ** case h.left α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ a :: x = join ((a :: t) :: S') ** simp [hs, hsum] ** case h.right α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ ∀ (t_1 : List α), t_1 ∈ (a :: t) :: S' → t_1 ≠ [] ∧ rmatch P t_1 = true ** intro t' ht' ** case h.right α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true t' : List α ht' : t' ∈ (a :: t) :: S' ⊢ t' ≠ [] ∧ rmatch P t' = true ** cases ht' ** case h.right.head α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ a :: t ≠ [] ∧ rmatch P (a :: t) = true case h.right.tail α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝¹ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true t' : List α a✝ : Mem t' S' ⊢ t' ≠ [] ∧ rmatch P t' = true ** case head ht' => simp only [ne_eq, not_false_iff, true_and, rmatch] exact ht ** case h.right.tail α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝¹ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true t' : List α a✝ : Mem t' S' ⊢ t' ≠ [] ∧ rmatch P t' = true ** case tail ht' => exact helem t' ht' ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α ht' b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ a :: t ≠ [] ∧ rmatch P (a :: t) = true ** simp only [ne_eq, not_false_iff, true_and, rmatch] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α ht' b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true ⊢ rmatch (deriv P a) t = true ** exact ht ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t u : List α hs : x = t ++ u ht : rmatch (deriv P a) t = true hwf : length u < length (a :: x) S' : List (List α) hsum : u = join S' helem : ∀ (t : List α), t ∈ S' → t ≠ [] ∧ rmatch P t = true t' : List α ht' : Mem t' S' ⊢ t' ≠ [] ∧ rmatch P t' = true ** exact helem t' ht' ** case mpr α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length x → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) ⊢ (∃ S, x = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) → rmatch (star P) x = true ** rintro ⟨S, hsum, helem⟩ ** case mpr.intro.intro α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α x : List α A : ∀ (m n : ℕ), n < m + n + 1 IH : ∀ (t : List α), length t < length x → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) S : List (List α) hsum : x = join S helem : ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ⊢ rmatch (star P) x = true ** cases' x with a x ** case mpr.intro.intro.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 S : List (List α) helem : ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true IH : ∀ (t : List α), length t < length [] → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) hsum : [] = join S ⊢ rmatch (star P) [] = true ** rfl ** case mpr.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 S : List (List α) helem : ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) hsum : a :: x = join S ⊢ rmatch (star P) (a :: x) = true ** rw [rmatch, deriv, mul_rmatch_iff] ** case mpr.intro.intro.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 S : List (List α) helem : ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) hsum : a :: x = join S ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** cases' S with t' U ** case mpr.intro.intro.cons.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) helem : ∀ (t : List α), t ∈ [] → t ≠ [] ∧ rmatch P t = true hsum : a :: x = join [] ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** exact ⟨[], [], by tauto⟩ ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) helem : ∀ (t : List α), t ∈ [] → t ≠ [] ∧ rmatch P t = true hsum : a :: x = join [] ⊢ x = [] ++ [] ∧ rmatch (deriv P a) [] = true ∧ rmatch (star P) [] = true ** tauto ** case mpr.intro.intro.cons.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) t' : List α U : List (List α) helem : ∀ (t : List α), t ∈ t' :: U → t ≠ [] ∧ rmatch P t = true hsum : a :: x = join (t' :: U) ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** cases' t' with b t ** case mpr.intro.intro.cons.cons.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a :: x = join ((b :: t) :: U) ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** simp only [List.join, List.cons_append, List.cons_eq_cons] at hsum ** case mpr.intro.intro.cons.cons.cons α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** refine' ⟨t, U.join, hsum.2, _, _⟩ ** case mpr.intro.intro.cons.cons.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) helem : ∀ (t : List α), t ∈ [] :: U → t ≠ [] ∧ rmatch P t = true hsum : a :: x = join ([] :: U) ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** simp only [forall_eq_or_imp, List.mem_cons] at helem ** case mpr.intro.intro.cons.cons.nil α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) hsum : a :: x = join ([] :: U) helem : ([] ≠ [] ∧ rmatch P [] = true) ∧ ∀ (a : List α), a ∈ U → a ≠ [] ∧ rmatch P a = true ⊢ ∃ t u, x = t ++ u ∧ rmatch (deriv P a) t = true ∧ rmatch (star P) u = true ** simp only [eq_self_iff_true, not_true, Ne.def, false_and_iff] at helem ** case mpr.intro.intro.cons.cons.cons.refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ rmatch (deriv P a) t = true ** specialize helem (b :: t) (by simp) ** case mpr.intro.intro.cons.cons.cons.refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α hsum : a = b ∧ x = t ++ join U helem : b :: t ≠ [] ∧ rmatch P (b :: t) = true ⊢ rmatch (deriv P a) t = true ** rw [rmatch] at helem ** case mpr.intro.intro.cons.cons.cons.refine'_1 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α hsum : a = b ∧ x = t ++ join U helem : b :: t ≠ [] ∧ rmatch (deriv P b) t = true ⊢ rmatch (deriv P a) t = true ** convert helem.2 ** case h.e'_2.h.e'_3.h.e'_4 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α hsum : a = b ∧ x = t ++ join U helem : b :: t ≠ [] ∧ rmatch (deriv P b) t = true ⊢ a = b ** exact hsum.1 ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ b :: t ∈ (b :: t) :: U ** simp ** case mpr.intro.intro.cons.cons.cons.refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ rmatch (star P) (join U) = true ** have hwf : U.join.length < (List.cons a x).length := by rw [hsum.1, hsum.2] simp only [List.length_append, List.length_join, List.length] apply A ** case mpr.intro.intro.cons.cons.cons.refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U hwf : length (join U) < length (a :: x) ⊢ rmatch (star P) (join U) = true ** rw [IH _ hwf] ** case mpr.intro.intro.cons.cons.cons.refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U hwf : length (join U) < length (a :: x) ⊢ ∃ S, join U = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true ** refine' ⟨U, rfl, fun t h => helem t _⟩ ** case mpr.intro.intro.cons.cons.cons.refine'_2 α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t✝ : List α helem : ∀ (t : List α), t ∈ (b :: t✝) :: U → t ≠ [] ∧ rmatch P t = true hsum : a = b ∧ x = t✝ ++ join U hwf : length (join U) < length (a :: x) t : List α h : t ∈ U ⊢ t ∈ (b :: t✝) :: U ** right ** case mpr.intro.intro.cons.cons.cons.refine'_2.a α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t✝ : List α helem : ∀ (t : List α), t ∈ (b :: t✝) :: U → t ≠ [] ∧ rmatch P t = true hsum : a = b ∧ x = t✝ ++ join U hwf : length (join U) < length (a :: x) t : List α h : t ∈ U ⊢ Mem t U ** assumption ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ length (join U) < length (a :: x) ** rw [hsum.1, hsum.2] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ length (join U) < length (b :: (t ++ join U)) ** simp only [List.length_append, List.length_join, List.length] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a✝ b✝ : α P : RegularExpression α A : ∀ (m n : ℕ), n < m + n + 1 a : α x : List α IH : ∀ (t : List α), length t < length (a :: x) → (rmatch (star P) t = true ↔ ∃ S, t = join S ∧ ∀ (t : List α), t ∈ S → t ≠ [] ∧ rmatch P t = true) U : List (List α) b : α t : List α helem : ∀ (t_1 : List α), t_1 ∈ (b :: t) :: U → t_1 ≠ [] ∧ rmatch P t_1 = true hsum : a = b ∧ x = t ++ join U ⊢ sum (map length U) < length t + sum (map length U) + 1 ** apply A ** Qed
RegularExpression.map_pow ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α f : α → β P : RegularExpression α ⊢ map f (P ^ 0) = map f P ^ 0 ** dsimp ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α f : α → β P : RegularExpression α ⊢ 1 = map f P ^ 0 ** rfl ** Qed
RegularExpression.map_id ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α R S : RegularExpression α ⊢ map id (R + S) = R + S ** simp_rw [map, map_id] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α R S : RegularExpression α ⊢ map id (R * S) = R * S ** simp_rw [map, map_id] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α R : RegularExpression α ⊢ map id (star R) = star R ** simp_rw [map, map_id] ** Qed
RegularExpression.map_map ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α g : β → γ f : α → β R S : RegularExpression α ⊢ map g (map f (R + S)) = map (g ∘ f) (R + S) ** simp only [map, Function.comp_apply, map_map] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α g : β → γ f : α → β R S : RegularExpression α ⊢ map g (map f (R * S)) = map (g ∘ f) (R * S) ** simp only [map, Function.comp_apply, map_map] ** α : Type u_1 β : Type u_2 γ : Type u_3 dec : DecidableEq α a b : α g : β → γ f : α → β R : RegularExpression α ⊢ map g (map f (star R)) = map (g ∘ f) (star R) ** simp only [map, Function.comp_apply, map_map] ** Qed
MeasurableSpace.empty_mem_generateMeasurableRec ** α : Type u s : Set (Set α) i : (Quotient.out (ord (aleph 1))).α ⊢ ∅ ∈ generateMeasurableRec s i ** unfold generateMeasurableRec ** α : Type u s : Set (Set α) i : (Quotient.out (ord (aleph 1))).α ⊢ ∅ ∈ let i := i; let S := ⋃ j, generateMeasurableRec s ↑j; s ∪ {∅} ∪ compl '' S ∪ range fun f => ⋃ n, ↑(f n) ** exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton ∅))) ** Qed
MeasurableSpace.compl_mem_generateMeasurableRec ** α : Type u s : Set (Set α) i j : (Quotient.out (ord (aleph 1))).α h : j < i t : Set α ht : t ∈ generateMeasurableRec s j ⊢ tᶜ ∈ generateMeasurableRec s i ** unfold generateMeasurableRec ** α : Type u s : Set (Set α) i j : (Quotient.out (ord (aleph 1))).α h : j < i t : Set α ht : t ∈ generateMeasurableRec s j ⊢ tᶜ ∈ let i := i; let S := ⋃ j, generateMeasurableRec s ↑j; s ∪ {∅} ∪ compl '' S ∪ range fun f => ⋃ n, ↑(f n) ** exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩) ** Qed
MeasurableSpace.iUnion_mem_generateMeasurableRec ** α : Type u s : Set (Set α) i : (Quotient.out (ord (aleph 1))).α f : ℕ → Set α hf : ∀ (n : ℕ), ∃ j, j < i ∧ f n ∈ generateMeasurableRec s j ⊢ ⋃ n, f n ∈ generateMeasurableRec s i ** unfold generateMeasurableRec ** α : Type u s : Set (Set α) i : (Quotient.out (ord (aleph 1))).α f : ℕ → Set α hf : ∀ (n : ℕ), ∃ j, j < i ∧ f n ∈ generateMeasurableRec s j ⊢ ⋃ n, f n ∈ let i := i; let S := ⋃ j, generateMeasurableRec s ↑j; s ∪ {∅} ∪ compl '' S ∪ range fun f => ⋃ n, ↑(f n) ** exact mem_union_right _ ⟨fun n => ⟨f n, let ⟨j, hj, hf⟩ := hf n; mem_iUnion.2 ⟨⟨j, hj⟩, hf⟩⟩, rfl⟩ ** Qed