l3lab/ntp-mathlib huggingface dataset:
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · rw [map_pmap]
        conv_lhs => 

Proof state:
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
| s

Next tactic:
rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · rw [map_pmap]
        conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
        

Proof state:
case neg.refine_1
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
⊢ pmap (fun a x => id a) s (_ : ∀ x ∈ s, x ∈ s) = pmap (fun a h => gcd s * f h) s (_ : ∀ x ∈ s, x ∈ s)

Next tactic:
congr with (x hx)
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · rw [map_pmap]
        conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
        congr with (x hx)
        

Proof state:
case neg.refine_1.e_f.h.h
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
x : α
hx : x ∈ s
⊢ id x = gcd s * f hx

Next tactic:
rw [id, ← hf hx]
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · 

Proof state:
case neg.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
⊢ s = map (fun x => gcd s * x) (pmap f s (_ : ∀ x ∈ s, x ∈ s))

Next tactic:
rw [map_pmap]
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · rw [map_pmap]
        

Proof state:
case neg.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
⊢ s = pmap (fun a h => gcd s * f h) s (_ : ∀ x ∈ s, x ∈ s)

Next tactic:
conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · rw [map_pmap]
        conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
        

Proof state:
case neg.refine_2
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
⊢ pmap (fun a x => id a) s (_ : ∀ x ∈ s, x ∈ s) = pmap (fun a h => gcd s * f h) s (_ : ∀ x ∈ s, x ∈ s)

Next tactic:
congr with (x hx)
theorem extract_gcd (s : Multiset α) (hs : s ≠ 0) :
    ∃ t : Multiset α, s = t.map (s.gcd * ·) ∧ t.gcd = 1 := by
  classical
    by_cases h : ∀ x ∈ s, x = (0 : α)
    · use replicate (card s) 1
      rw [map_replicate, eq_replicate, mul_one, s.gcd_eq_zero_iff.2 h, ← nsmul_singleton,
    ← gcd_dedup, dedup_nsmul (card_pos.2 hs).ne', dedup_singleton, gcd_singleton]
      exact ⟨⟨rfl, h⟩, normalize_one⟩
    · choose f hf using @gcd_dvd _ _ _ s
      push_neg at h
      refine ⟨s.pmap @f fun _ ↦ id, ?_, extract_gcd' s _ h ?_⟩ <;>
      · rw [map_pmap]
        conv_lhs => rw [← s.map_id, ← s.pmap_eq_map _ _ fun _ ↦ id]
        congr with (x hx)
        

Proof state:
case neg.refine_2.e_f.h.h
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizedGCDMonoid α
s : Multiset α
hs : s ≠ 0
f : {a : α} → a ∈ s → α
hf : ∀ {a : α} (h : a ∈ s), a = gcd s * f h
h : ∃ x ∈ s, x ≠ 0
x : α
hx : x ∈ s
⊢ id x = gcd s * f hx

Next tactic:
rw [id, ← hf hx]
theorem nhdsSet_diagonal (α) [TopologicalSpace (α × α)] :
    𝓝ˢ (diagonal α) = ⨆ (x : α), 𝓝 (x, x) := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α✝
inst✝¹ : TopologicalSpace β
f : Filter α✝
s t s₁ s₂ t₁ t₂ : Set α✝
x : α✝
α : Type u_3
inst✝ : TopologicalSpace (α × α)
⊢ 𝓝ˢ (diagonal α) = ⨆ x, 𝓝 (x, x)

Next tactic:
rw [nhdsSet, ← range_diag, ← range_comp]
theorem nhdsSet_diagonal (α) [TopologicalSpace (α × α)] :
    𝓝ˢ (diagonal α) = ⨆ (x : α), 𝓝 (x, x) := by
  rw [nhdsSet, ← range_diag, ← range_comp]
  

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α✝
inst✝¹ : TopologicalSpace β
f : Filter α✝
s t s₁ s₂ t₁ t₂ : Set α✝
x : α✝
α : Type u_3
inst✝ : TopologicalSpace (α × α)
⊢ sSup (range (𝓝 ∘ fun x => (x, x))) = ⨆ x, 𝓝 (x, x)

Next tactic:
rfl
theorem mem_nhdsSet_iff_forall : s ∈ 𝓝ˢ t ↔ ∀ x : α, x ∈ t → s ∈ 𝓝 x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ s ∈ 𝓝ˢ t ↔ ∀ x ∈ t, s ∈ 𝓝 x

Next tactic:
simp_rw [nhdsSet, Filter.mem_sSup, ball_image_iff]
lemma nhdsSet_le : 𝓝ˢ s ≤ f ↔ ∀ a ∈ s, 𝓝 a ≤ f := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ 𝓝ˢ s ≤ f ↔ ∀ a ∈ s, 𝓝 a ≤ f

Next tactic:
simp [nhdsSet]
theorem subset_interior_iff_mem_nhdsSet : s ⊆ interior t ↔ t ∈ 𝓝ˢ s := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ s ⊆ interior t ↔ t ∈ 𝓝ˢ s

Next tactic:
simp_rw [mem_nhdsSet_iff_forall, subset_interior_iff_nhds]
theorem disjoint_principal_nhdsSet : Disjoint (𝓟 s) (𝓝ˢ t) ↔ Disjoint (closure s) t := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ Disjoint (𝓟 s) (𝓝ˢ t) ↔ Disjoint (closure s) t

Next tactic:
rw [disjoint_principal_left, ← subset_interior_iff_mem_nhdsSet, interior_compl,
    subset_compl_iff_disjoint_left]
theorem disjoint_nhdsSet_principal : Disjoint (𝓝ˢ s) (𝓟 t) ↔ Disjoint s (closure t) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ Disjoint (𝓝ˢ s) (𝓟 t) ↔ Disjoint s (closure t)

Next tactic:
rw [disjoint_comm, disjoint_principal_nhdsSet, disjoint_comm]
theorem mem_nhdsSet_iff_exists : s ∈ 𝓝ˢ t ↔ ∃ U : Set α, IsOpen U ∧ t ⊆ U ∧ U ⊆ s := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ s ∈ 𝓝ˢ t ↔ ∃ U, IsOpen U ∧ t ⊆ U ∧ U ⊆ s

Next tactic:
rw [← subset_interior_iff_mem_nhdsSet, subset_interior_iff]
theorem hasBasis_nhdsSet (s : Set α) : (𝓝ˢ s).HasBasis (fun U => IsOpen U ∧ s ⊆ U) fun U => U :=
  ⟨fun t => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s✝ t✝ s₁ s₂ t₁ t₂ : Set α
x : α
s t : Set α
⊢ t ∈ 𝓝ˢ s ↔ ∃ i, (IsOpen i ∧ s ⊆ i) ∧ i ⊆ t

Next tactic:
simp [mem_nhdsSet_iff_exists, and_assoc]
theorem IsOpen.mem_nhdsSet (hU : IsOpen s) : s ∈ 𝓝ˢ t ↔ t ⊆ s := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
hU : IsOpen s
⊢ s ∈ 𝓝ˢ t ↔ t ⊆ s

Next tactic:
rw [← subset_interior_iff_mem_nhdsSet, hU.interior_eq]
@[simp]
theorem nhdsSet_eq_principal_iff : 𝓝ˢ s = 𝓟 s ↔ IsOpen s := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ 𝓝ˢ s = 𝓟 s ↔ IsOpen s

Next tactic:
rw [← principal_le_nhdsSet.le_iff_eq, le_principal_iff, mem_nhdsSet_iff_forall,
    isOpen_iff_mem_nhds]
@[simp]
theorem nhdsSet_singleton : 𝓝ˢ {x} = 𝓝 x := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ 𝓝ˢ {x} = 𝓝 x

Next tactic:
simp [nhdsSet]
@[simp]
theorem nhdsSet_empty : 𝓝ˢ (∅ : Set α) = ⊥ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ 𝓝ˢ ∅ = ⊥

Next tactic:
rw [isOpen_empty.nhdsSet_eq, principal_empty]
theorem mem_nhdsSet_empty : s ∈ 𝓝ˢ (∅ : Set α) := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ s ∈ 𝓝ˢ ∅

Next tactic:
simp
@[simp]
theorem nhdsSet_univ : 𝓝ˢ (univ : Set α) = ⊤ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
⊢ 𝓝ˢ univ = ⊤

Next tactic:
rw [isOpen_univ.nhdsSet_eq, principal_univ]
@[simp]
theorem nhdsSet_union (s t : Set α) : 𝓝ˢ (s ∪ t) = 𝓝ˢ s ⊔ 𝓝ˢ t := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s✝ t✝ s₁ s₂ t₁ t₂ : Set α
x : α
s t : Set α
⊢ 𝓝ˢ (s ∪ t) = 𝓝ˢ s ⊔ 𝓝ˢ t

Next tactic:
simp only [nhdsSet, image_union, sSup_union]
theorem union_mem_nhdsSet (h₁ : s₁ ∈ 𝓝ˢ t₁) (h₂ : s₂ ∈ 𝓝ˢ t₂) : s₁ ∪ s₂ ∈ 𝓝ˢ (t₁ ∪ t₂) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
h₁ : s₁ ∈ 𝓝ˢ t₁
h₂ : s₂ ∈ 𝓝ˢ t₂
⊢ s₁ ∪ s₂ ∈ 𝓝ˢ (t₁ ∪ t₂)

Next tactic:
rw [nhdsSet_union]
theorem union_mem_nhdsSet (h₁ : s₁ ∈ 𝓝ˢ t₁) (h₂ : s₂ ∈ 𝓝ˢ t₂) : s₁ ∪ s₂ ∈ 𝓝ˢ (t₁ ∪ t₂) := by
  rw [nhdsSet_union]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s t s₁ s₂ t₁ t₂ : Set α
x : α
h₁ : s₁ ∈ 𝓝ˢ t₁
h₂ : s₂ ∈ 𝓝ˢ t₂
⊢ s₁ ∪ s₂ ∈ 𝓝ˢ t₁ ⊔ 𝓝ˢ t₂

Next tactic:
exact union_mem_sup h₁ h₂
@[simp]
theorem nhdsSet_insert (x : α) (s : Set α) : 𝓝ˢ (insert x s) = 𝓝 x ⊔ 𝓝ˢ s := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : Filter α
s✝ t s₁ s₂ t₁ t₂ : Set α
x✝ x : α
s : Set α
⊢ 𝓝ˢ (insert x s) = 𝓝 x ⊔ 𝓝ˢ s

Next tactic:
rw [insert_eq, nhdsSet_union, nhdsSet_singleton]
lemma Continuous.tendsto_nhdsSet_nhds {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    {s : Set X} {y : Y} {f : X → Y} (h : Continuous f) (h' : EqOn f (fun _ ↦ y) s) :
    Tendsto f (𝓝ˢ s) (𝓝 y) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
f✝ : Filter α
s✝ t s₁ s₂ t₁ t₂ : Set α
x : α
X : Type u_3
Y : Type u_4
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
s : Set X
y : Y
f : X → Y
h : Continuous f
h' : EqOn f (fun x => y) s
⊢ Tendsto f (𝓝ˢ s) (𝓝 y)

Next tactic:
rw [← nhdsSet_singleton]
lemma Continuous.tendsto_nhdsSet_nhds {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    {s : Set X} {y : Y} {f : X → Y} (h : Continuous f) (h' : EqOn f (fun _ ↦ y) s) :
    Tendsto f (𝓝ˢ s) (𝓝 y) := by
  rw [← nhdsSet_singleton]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
f✝ : Filter α
s✝ t s₁ s₂ t₁ t₂ : Set α
x : α
X : Type u_3
Y : Type u_4
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
s : Set X
y : Y
f : X → Y
h : Continuous f
h' : EqOn f (fun x => y) s
⊢ Tendsto f (𝓝ˢ s) (𝓝ˢ {y})

Next tactic:
exact h.tendsto_nhdsSet h'
lemma iIndepSets_iff [MeasurableSpace Ω] (π : ι → Set (Set Ω)) (μ : Measure Ω) :
    iIndepSets π μ ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → f i ∈ π i),
      μ (⋂ i ∈ s, f i) = ∏ i in s, μ (f i) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π✝ : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
inst✝ : MeasurableSpace Ω
π : ι → Set (Set Ω)
μ : Measure Ω
⊢ iIndepSets π ↔ ∀ (s : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s, f i ∈ π i) → ↑↑μ (⋂ i ∈ s, f i) = ∏ i in s, ↑↑μ (f i)

Next tactic:
simp only [iIndepSets, kernel.iIndepSets, ae_dirac_eq, Filter.eventually_pure, kernel.const_apply]
lemma iIndepSets.meas_iInter [Fintype ι] (h : iIndepSets π μ) (hs : ∀ i, s i ∈ π i) :
    μ (⋂ i, s i) = ∏ i, μ (s i) := by 

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ : Measure Ω
S : Finset ι
s : ι → Set Ω
inst✝ : Fintype ι
h : iIndepSets π
hs : ∀ (i : ι), s i ∈ π i
⊢ ↑↑μ (⋂ i, s i) = ∏ i : ι, ↑↑μ (s i)

Next tactic:
simp [← h.meas_biInter _ fun _i _ ↦ hs _]
lemma IndepSets_iff [MeasurableSpace Ω] (s1 s2 : Set (Set Ω)) (μ : Measure Ω) :
    IndepSets s1 s2 μ ↔ ∀ t1 t2 : Set Ω, t1 ∈ s1 → t2 ∈ s2 → (μ (t1 ∩ t2) = μ t1 * μ t2) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
inst✝ : MeasurableSpace Ω
s1 s2 : Set (Set Ω)
μ : Measure Ω
⊢ IndepSets s1 s2 ↔ ∀ (t1 t2 : Set Ω), t1 ∈ s1 → t2 ∈ s2 → ↑↑μ (t1 ∩ t2) = ↑↑μ t1 * ↑↑μ t2

Next tactic:
simp only [IndepSets, kernel.IndepSets, ae_dirac_eq, Filter.eventually_pure, kernel.const_apply]
lemma iIndep_iff_iIndepSets (m : ι → MeasurableSpace Ω) [MeasurableSpace Ω] (μ : Measure Ω) :
    iIndep m μ ↔ iIndepSets (fun x ↦ {s | MeasurableSet[m x] s}) μ := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m✝ : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
m : ι → MeasurableSpace Ω
inst✝ : MeasurableSpace Ω
μ : Measure Ω
⊢ iIndep m ↔ iIndepSets fun x => {s | MeasurableSet s}

Next tactic:
simp only [iIndep, iIndepSets, kernel.iIndep]
lemma iIndep_iff (m : ι → MeasurableSpace Ω) [MeasurableSpace Ω] (μ : Measure Ω) :
    iIndep m μ ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → MeasurableSet[m i] (f i)),
      μ (⋂ i ∈ s, f i) = ∏ i in s, μ (f i) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m✝ : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
m : ι → MeasurableSpace Ω
inst✝ : MeasurableSpace Ω
μ : Measure Ω
⊢ iIndep m ↔ ∀ (s : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s, MeasurableSet (f i)) → ↑↑μ (⋂ i ∈ s, f i) = ∏ i in s, ↑↑μ (f i)

Next tactic:
simp only [iIndep_iff_iIndepSets, iIndepSets_iff]
lemma iIndep_iff (m : ι → MeasurableSpace Ω) [MeasurableSpace Ω] (μ : Measure Ω) :
    iIndep m μ ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → MeasurableSet[m i] (f i)),
      μ (⋂ i ∈ s, f i) = ∏ i in s, μ (f i) := by
  simp only [iIndep_iff_iIndepSets, iIndepSets_iff]; 

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m✝ : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
m : ι → MeasurableSpace Ω
inst✝ : MeasurableSpace Ω
μ : Measure Ω
⊢ (∀ (s : Finset ι) {f : ι → Set Ω},
      (∀ i ∈ s, f i ∈ {s | MeasurableSet s}) → ↑↑μ (⋂ i ∈ s, f i) = ∏ i in s, ↑↑μ (f i)) ↔
    ∀ (s : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s, MeasurableSet (f i)) → ↑↑μ (⋂ i ∈ s, f i) = ∏ i in s, ↑↑μ (f i)

Next tactic:
rfl
lemma iIndep.meas_iInter [Fintype ι] (hμ : iIndep m μ) (hs : ∀ i, MeasurableSet[m i] (s i)) :
    μ (⋂ i, s i) = ∏ i, μ (s i) := by 

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ : Measure Ω
S : Finset ι
s : ι → Set Ω
inst✝ : Fintype ι
hμ : iIndep m
hs : ∀ (i : ι), MeasurableSet (s i)
⊢ ↑↑μ (⋂ i, s i) = ∏ i : ι, ↑↑μ (s i)

Next tactic:
simp [← hμ.meas_biInter fun _ _ ↦ hs _]
lemma Indep_iff_IndepSets (m₁ m₂ : MeasurableSpace Ω) [MeasurableSpace Ω] (μ : Measure Ω) :
    Indep m₁ m₂ μ ↔ IndepSets {s | MeasurableSet[m₁] s} {s | MeasurableSet[m₂] s} μ := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
m₁ m₂ inst✝ : MeasurableSpace Ω
μ : Measure Ω
⊢ Indep m₁ m₂ ↔ IndepSets {s | MeasurableSet s} {s | MeasurableSet s}

Next tactic:
simp only [Indep, IndepSets, kernel.Indep]
lemma Indep_iff (m₁ m₂ : MeasurableSpace Ω) [MeasurableSpace Ω] (μ : Measure Ω) :
    Indep m₁ m₂ μ
      ↔ ∀ t1 t2, MeasurableSet[m₁] t1 → MeasurableSet[m₂] t2 → μ (t1 ∩ t2) = μ t1 * μ t2 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
m₁ m₂ inst✝ : MeasurableSpace Ω
μ : Measure Ω
⊢ Indep m₁ m₂ ↔ ∀ (t1 t2 : Set Ω), MeasurableSet t1 → MeasurableSet t2 → ↑↑μ (t1 ∩ t2) = ↑↑μ t1 * ↑↑μ t2

Next tactic:
rw [Indep_iff_IndepSets, IndepSets_iff]
lemma Indep_iff (m₁ m₂ : MeasurableSpace Ω) [MeasurableSpace Ω] (μ : Measure Ω) :
    Indep m₁ m₂ μ
      ↔ ∀ t1 t2, MeasurableSet[m₁] t1 → MeasurableSet[m₂] t2 → μ (t1 ∩ t2) = μ t1 * μ t2 := by
  rw [Indep_iff_IndepSets, IndepSets_iff]; 

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
m₁ m₂ inst✝ : MeasurableSpace Ω
μ : Measure Ω
⊢ (∀ (t1 t2 : Set Ω), t1 ∈ {s | MeasurableSet s} → t2 ∈ {s | MeasurableSet s} → ↑↑μ (t1 ∩ t2) = ↑↑μ t1 * ↑↑μ t2) ↔
    ∀ (t1 t2 : Set Ω), MeasurableSet t1 → MeasurableSet t2 → ↑↑μ (t1 ∩ t2) = ↑↑μ t1 * ↑↑μ t2

Next tactic:
rfl
lemma iIndepSet_iff_iIndep [MeasurableSpace Ω] (s : ι → Set Ω) (μ : Measure Ω) :
    iIndepSet s μ ↔ iIndep (fun i ↦ generateFrom {s i}) μ := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s✝ : ι → Set Ω
inst✝ : MeasurableSpace Ω
s : ι → Set Ω
μ : Measure Ω
⊢ iIndepSet s ↔ iIndep fun i => generateFrom {s i}

Next tactic:
simp only [iIndepSet, iIndep, kernel.iIndepSet]
lemma iIndepSet_iff [MeasurableSpace Ω] (s : ι → Set Ω) (μ : Measure Ω) :
    iIndepSet s μ ↔ ∀ (s' : Finset ι) {f : ι → Set Ω}
      (_H : ∀ i, i ∈ s' → MeasurableSet[generateFrom {s i}] (f i)),
      μ (⋂ i ∈ s', f i) = ∏ i in s', μ (f i) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s✝ : ι → Set Ω
inst✝ : MeasurableSpace Ω
s : ι → Set Ω
μ : Measure Ω
⊢ iIndepSet s ↔
    ∀ (s' : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s', MeasurableSet (f i)) → ↑↑μ (⋂ i ∈ s', f i) = ∏ i in s', ↑↑μ (f i)

Next tactic:
simp only [iIndepSet_iff_iIndep, iIndep_iff]
lemma IndepSet_iff_Indep [MeasurableSpace Ω] (s t : Set Ω) (μ : Measure Ω) :
    IndepSet s t μ ↔ Indep (generateFrom {s}) (generateFrom {t}) μ := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s✝ : ι → Set Ω
inst✝ : MeasurableSpace Ω
s t : Set Ω
μ : Measure Ω
⊢ IndepSet s t ↔ Indep (generateFrom {s}) (generateFrom {t})

Next tactic:
simp only [IndepSet, Indep, kernel.IndepSet]
lemma IndepSet_iff [MeasurableSpace Ω] (s t : Set Ω) (μ : Measure Ω) :
    IndepSet s t μ ↔ ∀ t1 t2, MeasurableSet[generateFrom {s}] t1
      → MeasurableSet[generateFrom {t}] t2 → μ (t1 ∩ t2) = μ t1 * μ t2 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s✝ : ι → Set Ω
inst✝ : MeasurableSpace Ω
s t : Set Ω
μ : Measure Ω
⊢ IndepSet s t ↔ ∀ (t1 t2 : Set Ω), MeasurableSet t1 → MeasurableSet t2 → ↑↑μ (t1 ∩ t2) = ↑↑μ t1 * ↑↑μ t2

Next tactic:
simp only [IndepSet_iff_Indep, Indep_iff]
lemma iIndepFun_iff_iIndep [MeasurableSpace Ω] {β : ι → Type*}
    (m : ∀ x : ι, MeasurableSpace (β x)) (f : ∀ x : ι, Ω → β x) (μ : Measure Ω) :
    iIndepFun m f μ ↔ iIndep (fun x ↦ (m x).comap (f x)) μ := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β✝ : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m✝ : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
inst✝ : MeasurableSpace Ω
β : ι → Type u_6
m : (x : ι) → MeasurableSpace (β x)
f : (x : ι) → Ω → β x
μ : Measure Ω
⊢ iIndepFun m f ↔ iIndep fun x => MeasurableSpace.comap (f x) (m x)

Next tactic:
simp only [iIndepFun, iIndep, kernel.iIndepFun]
lemma iIndepFun_iff [MeasurableSpace Ω] {β : ι → Type*}
    (m : ∀ x : ι, MeasurableSpace (β x)) (f : ∀ x : ι, Ω → β x) (μ : Measure Ω) :
    iIndepFun m f μ ↔ ∀ (s : Finset ι) {f' : ι → Set Ω}
      (_H : ∀ i, i ∈ s → MeasurableSet[(m i).comap (f i)] (f' i)),
      μ (⋂ i ∈ s, f' i) = ∏ i in s, μ (f' i) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
β✝ : Type u_3
γ : Type u_4
κ : ι → Type u_5
π : ι → Set (Set Ω)
m✝ : ι → MeasurableSpace Ω
x✝ : MeasurableSpace Ω
μ✝ : Measure Ω
S : Finset ι
s : ι → Set Ω
inst✝ : MeasurableSpace Ω
β : ι → Type u_6
m : (x : ι) → MeasurableSpace (β x)
f : (x : ι) → Ω → β x
μ : Measure Ω
⊢ iIndepFun m f ↔
    ∀ (s : Finset ι) {f' : ι → Set Ω}, (∀ i ∈ s, MeasurableSet (f' i)) → ↑↑μ (⋂ i ∈ s, f' i) = ∏ i in s, ↑↑μ (f' i)

Next tactic:
simp only [iIndepFun_iff_iIndep, iIndep_iff]