l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem range_sigmaMk (i : ι) : range (Sigma.mk i : α i → Sigma α) = Sigma.fst ⁻¹' {i} := by
  apply Subset.antisymm
  · 

Proof state:
case h₁
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i✝ j : ι
a : α i✝
i : ι
⊢ range (Sigma.mk i) ⊆ Sigma.fst ⁻¹' {i}

Next tactic:
rintro _ ⟨b, rfl⟩
@[simp]
theorem range_sigmaMk (i : ι) : range (Sigma.mk i : α i → Sigma α) = Sigma.fst ⁻¹' {i} := by
  apply Subset.antisymm
  · rintro _ ⟨b, rfl⟩
    

Proof state:
case h₁.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i✝ j : ι
a : α i✝
i : ι
b : α i
⊢ { fst := i, snd := b } ∈ Sigma.fst ⁻¹' {i}

Next tactic:
simp
@[simp]
theorem range_sigmaMk (i : ι) : range (Sigma.mk i : α i → Sigma α) = Sigma.fst ⁻¹' {i} := by
  apply Subset.antisymm
  · rintro _ ⟨b, rfl⟩
    simp
  · 

Proof state:
case h₂
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i✝ j : ι
a : α i✝
i : ι
⊢ Sigma.fst ⁻¹' {i} ⊆ range (Sigma.mk i)

Next tactic:
rintro ⟨x, y⟩ (rfl | _)
@[simp]
theorem range_sigmaMk (i : ι) : range (Sigma.mk i : α i → Sigma α) = Sigma.fst ⁻¹' {i} := by
  apply Subset.antisymm
  · rintro _ ⟨b, rfl⟩
    simp
  · rintro ⟨x, y⟩ (rfl | _)
    

Proof state:
case h₂.mk.refl
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : ι
y : α x
⊢ { fst := x, snd := y } ∈ range (Sigma.mk { fst := x, snd := y }.fst)

Next tactic:
exact mem_range_self y
theorem preimage_image_sigmaMk_of_ne (h : i ≠ j) (s : Set (α j)) :
    Sigma.mk i ⁻¹' (Sigma.mk j '' s) = ∅ := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
h : i ≠ j
s : Set (α j)
⊢ Sigma.mk i ⁻¹' (Sigma.mk j '' s) = ∅

Next tactic:
ext x
theorem preimage_image_sigmaMk_of_ne (h : i ≠ j) (s : Set (α j)) :
    Sigma.mk i ⁻¹' (Sigma.mk j '' s) = ∅ := by
  ext x
  

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
h : i ≠ j
s : Set (α j)
x : α i
⊢ x ∈ Sigma.mk i ⁻¹' (Sigma.mk j '' s) ↔ x ∈ ∅

Next tactic:
simp [h.symm]
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i✝ j : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
⊢ Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s)

Next tactic:
refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i✝ j : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
⊢ Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) ⊆ Sigma.mk i '' (g i ⁻¹' s)

Next tactic:
rintro ⟨j, x⟩ ⟨y, hys, hxy⟩
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
  rintro ⟨j, x⟩ ⟨y, hys, hxy⟩
  

Proof state:
case mk.intro.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i✝ j✝ : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
j : ι
x : α j
y : β (f i)
hys : y ∈ s
hxy : { fst := f i, snd := y } = Sigma.map f g { fst := j, snd := x }
⊢ { fst := j, snd := x } ∈ Sigma.mk i '' (g i ⁻¹' s)

Next tactic:
simp only [hf.eq_iff, Sigma.map, Sigma.ext_iff] at hxy
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
  rintro ⟨j, x⟩ ⟨y, hys, hxy⟩
  simp only [hf.eq_iff, Sigma.map, Sigma.ext_iff] at hxy
  

Proof state:
case mk.intro.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i✝ j✝ : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
j : ι
x : α j
y : β (f i)
hys : y ∈ s
hxy : i = j ∧ HEq y (g j x)
⊢ { fst := j, snd := x } ∈ Sigma.mk i '' (g i ⁻¹' s)

Next tactic:
rcases hxy with ⟨rfl, hxy⟩
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
  rintro ⟨j, x⟩ ⟨y, hys, hxy⟩
  simp only [hf.eq_iff, Sigma.map, Sigma.ext_iff] at hxy
  rcases hxy with ⟨rfl, hxy⟩; 

Proof state:
case mk.intro.intro.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i✝ j : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
y : β (f i)
hys : y ∈ s
x : α i
hxy : HEq y (g i x)
⊢ { fst := i, snd := x } ∈ Sigma.mk i '' (g i ⁻¹' s)

Next tactic:
rw [heq_iff_eq] at hxy
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
  rintro ⟨j, x⟩ ⟨y, hys, hxy⟩
  simp only [hf.eq_iff, Sigma.map, Sigma.ext_iff] at hxy
  rcases hxy with ⟨rfl, hxy⟩; rw [heq_iff_eq] at hxy; 

Proof state:
case mk.intro.intro.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i✝ j : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
y : β (f i)
hys : y ∈ s
x : α i
hxy : y = g i x
⊢ { fst := i, snd := x } ∈ Sigma.mk i '' (g i ⁻¹' s)

Next tactic:
subst y
theorem image_sigmaMk_preimage_sigmaMap {β : ι' → Type*} {f : ι → ι'} (hf : Function.Injective f)
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) = Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s) := by
  refine' (image_sigmaMk_preimage_sigmaMap_subset f g i s).antisymm _
  rintro ⟨j, x⟩ ⟨y, hys, hxy⟩
  simp only [hf.eq_iff, Sigma.map, Sigma.ext_iff] at hxy
  rcases hxy with ⟨rfl, hxy⟩; rw [heq_iff_eq] at hxy; subst y
  

Proof state:
case mk.intro.intro.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i✝ j : ι
a : α i✝
β : ι' → Type u_5
f : ι → ι'
hf : Function.Injective f
g : (i : ι) → α i → β (f i)
i : ι
s : Set (β (f i))
x : α i
hys : g i x ∈ s
⊢ { fst := i, snd := x } ∈ Sigma.mk i '' (g i ⁻¹' s)

Next tactic:
exact ⟨x, hys, rfl⟩
@[simp]
theorem singleton_sigma : ({i} : Set ι).sigma t = Sigma.mk i '' t i :=
  ext fun x ↦ by
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
⊢ x ∈ Set.sigma {i} t ↔ x ∈ Sigma.mk i '' t i

Next tactic:
constructor
@[simp]
theorem singleton_sigma : ({i} : Set ι).sigma t = Sigma.mk i '' t i :=
  ext fun x ↦ by
    constructor
    · 

Proof state:
case mp
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
⊢ x ∈ Set.sigma {i} t → x ∈ Sigma.mk i '' t i

Next tactic:
obtain ⟨j, a⟩ := x
@[simp]
theorem singleton_sigma : ({i} : Set ι).sigma t = Sigma.mk i '' t i :=
  ext fun x ↦ by
    constructor
    · obtain ⟨j, a⟩ := x
      

Proof state:
case mp.mk
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j✝ : ι
a✝ : α i
j : ι
a : α j
⊢ { fst := j, snd := a } ∈ Set.sigma {i} t → { fst := j, snd := a } ∈ Sigma.mk i '' t i

Next tactic:
rintro ⟨rfl : j = i, ha⟩
@[simp]
theorem singleton_sigma : ({i} : Set ι).sigma t = Sigma.mk i '' t i :=
  ext fun x ↦ by
    constructor
    · obtain ⟨j, a⟩ := x
      rintro ⟨rfl : j = i, ha⟩
      

Proof state:
case mp.mk.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
j✝ j : ι
a✝ : α j
ha : { fst := j, snd := a✝ }.snd ∈ t { fst := j, snd := a✝ }.fst
a : α j
⊢ { fst := j, snd := a✝ } ∈ Sigma.mk j '' t j

Next tactic:
exact mem_image_of_mem _ ha
@[simp]
theorem singleton_sigma : ({i} : Set ι).sigma t = Sigma.mk i '' t i :=
  ext fun x ↦ by
    constructor
    · obtain ⟨j, a⟩ := x
      rintro ⟨rfl : j = i, ha⟩
      exact mem_image_of_mem _ ha
    · 

Proof state:
case mpr
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
⊢ x ∈ Sigma.mk i '' t i → x ∈ Set.sigma {i} t

Next tactic:
rintro ⟨b, hb, rfl⟩
@[simp]
theorem singleton_sigma : ({i} : Set ι).sigma t = Sigma.mk i '' t i :=
  ext fun x ↦ by
    constructor
    · obtain ⟨j, a⟩ := x
      rintro ⟨rfl : j = i, ha⟩
      exact mem_image_of_mem _ ha
    · rintro ⟨b, hb, rfl⟩
      

Proof state:
case mpr.intro.intro
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a b : α i
hb : b ∈ t i
⊢ { fst := i, snd := b } ∈ Set.sigma {i} t

Next tactic:
exact ⟨rfl, hb⟩
@[simp]
theorem sigma_singleton {a : ∀ i, α i} :
    s.sigma (fun i ↦ ({a i} : Set (α i))) = (fun i ↦ Sigma.mk i <| a i) '' s := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a✝ : α i
a : (i : ι) → α i
⊢ (Set.sigma s fun i => {a i}) = (fun i => { fst := i, snd := a i }) '' s

Next tactic:
ext ⟨x, y⟩
@[simp]
theorem sigma_singleton {a : ∀ i, α i} :
    s.sigma (fun i ↦ ({a i} : Set (α i))) = (fun i ↦ Sigma.mk i <| a i) '' s := by
  ext ⟨x, y⟩
  

Proof state:
case h.mk
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a✝ : α i
a : (i : ι) → α i
x : ι
y : α x
⊢ ({ fst := x, snd := y } ∈ Set.sigma s fun i => {a i}) ↔
    { fst := x, snd := y } ∈ (fun i => { fst := i, snd := a i }) '' s

Next tactic:
simp [and_left_comm, eq_comm]
theorem singleton_sigma_singleton {a : ∀ i, α i} :
    (({i} : Set ι).sigma fun i ↦ ({a i} : Set (α i))) = {⟨i, a i⟩} := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a✝ : α i
a : (i : ι) → α i
⊢ (Set.sigma {i} fun i => {a i}) = {{ fst := i, snd := a i }}

Next tactic:
rw [sigma_singleton, image_singleton]
theorem sigma_inter_sigma : s₁.sigma t₁ ∩ s₂.sigma t₂ = (s₁ ∩ s₂).sigma fun i ↦ t₁ i ∩ t₂ i := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
⊢ Set.sigma s₁ t₁ ∩ Set.sigma s₂ t₂ = Set.sigma (s₁ ∩ s₂) fun i => t₁ i ∩ t₂ i

Next tactic:
ext ⟨x, y⟩
theorem sigma_inter_sigma : s₁.sigma t₁ ∩ s₂.sigma t₂ = (s₁ ∩ s₂).sigma fun i ↦ t₁ i ∩ t₂ i := by
  ext ⟨x, y⟩
  

Proof state:
case h.mk
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : ι
y : α x
⊢ { fst := x, snd := y } ∈ Set.sigma s₁ t₁ ∩ Set.sigma s₂ t₂ ↔
    { fst := x, snd := y } ∈ Set.sigma (s₁ ∩ s₂) fun i => t₁ i ∩ t₂ i

Next tactic:
simp [and_assoc, and_left_comm]
theorem insert_sigma : (insert i s).sigma t = Sigma.mk i '' t i ∪ s.sigma t := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
⊢ Set.sigma (insert i s) t = Sigma.mk i '' t i ∪ Set.sigma s t

Next tactic:
rw [insert_eq, union_sigma, singleton_sigma]
theorem insert_sigma : (insert i s).sigma t = Sigma.mk i '' t i ∪ s.sigma t := by
  rw [insert_eq, union_sigma, singleton_sigma]
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
⊢ α i

Next tactic:
exact a
theorem sigma_insert {a : ∀ i, α i} :
    s.sigma (fun i ↦ insert (a i) (t i)) = (fun i ↦ ⟨i, a i⟩) '' s ∪ s.sigma t := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a✝ : α i
a : (i : ι) → α i
⊢ (Set.sigma s fun i => insert (a i) (t i)) = (fun i => { fst := i, snd := a i }) '' s ∪ Set.sigma s t

Next tactic:
simp_rw [insert_eq, sigma_union, sigma_singleton]
theorem mk_preimage_sigma_eq_if [DecidablePred (· ∈ s)] :
    Sigma.mk i ⁻¹' s.sigma t = if i ∈ s then t i else ∅ := by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
inst✝ : DecidablePred fun x => x ∈ s
⊢ Sigma.mk i ⁻¹' Set.sigma s t = if i ∈ s then t i else ∅

Next tactic:
split_ifs
theorem mk_preimage_sigma_eq_if [DecidablePred (· ∈ s)] :
    Sigma.mk i ⁻¹' s.sigma t = if i ∈ s then t i else ∅ := by split_ifs <;> 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
inst✝ : DecidablePred fun x => x ∈ s
h✝ : i ∈ s
⊢ Sigma.mk i ⁻¹' Set.sigma s t = t i

Next tactic:
simp [*]
theorem mk_preimage_sigma_eq_if [DecidablePred (· ∈ s)] :
    Sigma.mk i ⁻¹' s.sigma t = if i ∈ s then t i else ∅ := by split_ifs <;> 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
inst✝ : DecidablePred fun x => x ∈ s
h✝ : i ∉ s
⊢ Sigma.mk i ⁻¹' Set.sigma s t = ∅

Next tactic:
simp [*]
theorem mk_preimage_sigma_fn_eq_if {β : Type*} [DecidablePred (· ∈ s)] (g : β → α i) :
    (fun b ↦ Sigma.mk i (g b)) ⁻¹' s.sigma t = if i ∈ s then g ⁻¹' t i else ∅ :=
  ext fun _ ↦ by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
β : Type u_5
inst✝ : DecidablePred fun x => x ∈ s
g : β → α i
x✝ : β
⊢ x✝ ∈ (fun b => { fst := i, snd := g b }) ⁻¹' Set.sigma s t ↔ x✝ ∈ if i ∈ s then g ⁻¹' t i else ∅

Next tactic:
split_ifs
theorem mk_preimage_sigma_fn_eq_if {β : Type*} [DecidablePred (· ∈ s)] (g : β → α i) :
    (fun b ↦ Sigma.mk i (g b)) ⁻¹' s.sigma t = if i ∈ s then g ⁻¹' t i else ∅ :=
  ext fun _ ↦ by split_ifs <;> 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
β : Type u_5
inst✝ : DecidablePred fun x => x ∈ s
g : β → α i
x✝ : β
h✝ : i ∈ s
⊢ x✝ ∈ (fun b => { fst := i, snd := g b }) ⁻¹' Set.sigma s t ↔ x✝ ∈ g ⁻¹' t i

Next tactic:
simp [*]
theorem mk_preimage_sigma_fn_eq_if {β : Type*} [DecidablePred (· ∈ s)] (g : β → α i) :
    (fun b ↦ Sigma.mk i (g b)) ⁻¹' s.sigma t = if i ∈ s then g ⁻¹' t i else ∅ :=
  ext fun _ ↦ by split_ifs <;> 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β✝ : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
β : Type u_5
inst✝ : DecidablePred fun x => x ∈ s
g : β → α i
x✝ : β
h✝ : i ∉ s
⊢ x✝ ∈ (fun b => { fst := i, snd := g b }) ⁻¹' Set.sigma s t ↔ x✝ ∈ ∅

Next tactic:
simp [*]
theorem sigma_univ_range_eq {f : ∀ i, α i → β i} :
    (univ : Set ι).sigma (fun i ↦ range (f i)) = range fun x : Σ i, α i ↦ ⟨x.1, f _ x.2⟩ :=
  ext <| by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
f : (i : ι) → α i → β i
⊢ ∀ (x : (i : ι) × β i),
    (x ∈ Set.sigma univ fun i => range (f i)) ↔ x ∈ range fun x => { fst := x.fst, snd := f x.fst x.snd }

Next tactic:
simp [range]
theorem sigma_eq_empty_iff : s.sigma t = ∅ ↔ ∀ i ∈ s, t i = ∅ :=
  not_nonempty_iff_eq_empty.symm.trans <|
    sigma_nonempty_iff.not.trans <| by
      

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x : (i : ι) × α i
i j : ι
a : α i
⊢ (¬∃ i ∈ s, Set.Nonempty (t i)) ↔ ∀ i ∈ s, t i = ∅

Next tactic:
simp only [not_nonempty_iff_eq_empty, not_and, not_exists]
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
by_cases h₁ : x.1 ∈ s₁
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    by_cases h₁ : x.1 ∈ s₁ <;> 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
h₁ : x.fst ∈ s₁
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
by_cases h₂ : x.2 ∈ t₁ x.1
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    by_cases h₁ : x.1 ∈ s₁ <;> 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
h₁ : x.fst ∉ s₁
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
by_cases h₂ : x.2 ∈ t₁ x.1
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    by_cases h₁ : x.1 ∈ s₁ <;> by_cases h₂ : x.2 ∈ t₁ x.1 <;> 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
h₁ : x.fst ∈ s₁
h₂ : x.snd ∈ t₁ x.fst
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
simp [*, ← imp_iff_or_not]
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    by_cases h₁ : x.1 ∈ s₁ <;> by_cases h₂ : x.2 ∈ t₁ x.1 <;> 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
h₁ : x.fst ∈ s₁
h₂ : x.snd ∉ t₁ x.fst
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
simp [*, ← imp_iff_or_not]
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    by_cases h₁ : x.1 ∈ s₁ <;> by_cases h₂ : x.2 ∈ t₁ x.1 <;> 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
h₁ : x.fst ∉ s₁
h₂ : x.snd ∈ t₁ x.fst
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
simp [*, ← imp_iff_or_not]
theorem sigma_diff_sigma : s₁.sigma t₁ \ s₂.sigma t₂ = s₁.sigma (t₁ \ t₂) ∪ (s₁ \ s₂).sigma t₁ :=
  ext fun x ↦ by
    by_cases h₁ : x.1 ∈ s₁ <;> by_cases h₂ : x.2 ∈ t₁ x.1 <;> 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
β : ι → Type u_4
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
u : Set ((i : ι) × α i)
x✝ : (i : ι) × α i
i j : ι
a : α i
x : (i : ι) × α i
h₁ : x.fst ∉ s₁
h₂ : x.snd ∉ t₁ x.fst
⊢ x ∈ Set.sigma s₁ t₁ \ Set.sigma s₂ t₂ ↔ x ∈ Set.sigma s₁ (t₁ \ t₂) ∪ Set.sigma (s₁ \ s₂) t₁

Next tactic:
simp [*, ← imp_iff_or_not]
@[to_additive Icc_add_Icc_subset]
theorem Icc_mul_Icc_subset' (a b c d : α) : Icc a b * Icc c d ⊆ Icc (a * c) (b * d) := by
  

Proof state:
α : Type u_1
inst✝³ : Mul α
inst✝² : Preorder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (Function.swap HMul.hMul) LE.le
a b c d : α
⊢ Icc a b * Icc c d ⊆ Icc (a * c) (b * d)

Next tactic:
rintro x ⟨y, z, ⟨hya, hyb⟩, ⟨hzc, hzd⟩, rfl⟩
@[to_additive Icc_add_Icc_subset]
theorem Icc_mul_Icc_subset' (a b c d : α) : Icc a b * Icc c d ⊆ Icc (a * c) (b * d) := by
  rintro x ⟨y, z, ⟨hya, hyb⟩, ⟨hzc, hzd⟩, rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : Mul α
inst✝² : Preorder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (Function.swap HMul.hMul) LE.le
a b c d y z : α
hya : a ≤ y
hyb : y ≤ b
hzc : c ≤ z
hzd : z ≤ d
⊢ (fun x x_1 => x * x_1) y z ∈ Icc (a * c) (b * d)

Next tactic:
exact ⟨mul_le_mul' hya hzc, mul_le_mul' hyb hzd⟩
@[to_additive Iic_add_Iic_subset]
theorem Iic_mul_Iic_subset' (a b : α) : Iic a * Iic b ⊆ Iic (a * b) := by
  

Proof state:
α : Type u_1
inst✝³ : Mul α
inst✝² : Preorder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (Function.swap HMul.hMul) LE.le
a b : α
⊢ Iic a * Iic b ⊆ Iic (a * b)

Next tactic:
rintro x ⟨y, z, hya, hzb, rfl⟩
@[to_additive Iic_add_Iic_subset]
theorem Iic_mul_Iic_subset' (a b : α) : Iic a * Iic b ⊆ Iic (a * b) := by
  rintro x ⟨y, z, hya, hzb, rfl⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
inst✝³ : Mul α
inst✝² : Preorder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (Function.swap HMul.hMul) LE.le
a b y z : α
hya : y ∈ Iic a
hzb : z ∈ Iic b
⊢ (fun x x_1 => x * x_1) y z ∈ Iic (a * b)

Next tactic:
exact mul_le_mul' hya hzb