l3lab/ntp-mathlib huggingface dataset:
theorem eval_preimage' [DecidableEq ι] {s : Set (α i)} :
    eval i ⁻¹' s = pi {i} (update (fun i => univ) i s) := by
  ext
  

Proof state:
case h
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
s : Set (α i)
x✝ : (x : ι) → α x
⊢ x✝ ∈ eval i ⁻¹' s ↔ x✝ ∈ pi {i} (update (fun i => univ) i s)

Next tactic:
simp
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  

Proof state:
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
⊢ update f i ⁻¹' pi s t = t i

Next tactic:
ext x
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  

Proof state:
case h
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
x : α i
⊢ x ∈ update f i ⁻¹' pi s t ↔ x ∈ t i

Next tactic:
refine' ⟨fun h => _, fun hx j hj => _⟩
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  refine' ⟨fun h => _, fun hx j hj => _⟩
  · 

Proof state:
case h.refine'_1
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
x : α i
h : x ∈ update f i ⁻¹' pi s t
⊢ x ∈ t i

Next tactic:
convert h i hi
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  refine' ⟨fun h => _, fun hx j hj => _⟩
  · convert h i hi
    

Proof state:
case h.e'_4
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
x : α i
h : x ∈ update f i ⁻¹' pi s t
⊢ x = update f i x i

Next tactic:
simp
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  refine' ⟨fun h => _, fun hx j hj => _⟩
  · convert h i hi
    simp
  · 

Proof state:
case h.refine'_2
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
x : α i
hx : x ∈ t i
j : ι
hj : j ∈ s
⊢ update f i x j ∈ t j

Next tactic:
obtain rfl | h := eq_or_ne j i
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  refine' ⟨fun h => _, fun hx j hj => _⟩
  · convert h i hi
    simp
  · obtain rfl | h := eq_or_ne j i
    · 

Proof state:
case h.refine'_2.inl
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
inst✝ : DecidableEq ι
f : (i : ι) → α i
j : ι
hj hi : j ∈ s
hf : ∀ j_1 ∈ s, j_1 ≠ j → f j_1 ∈ t j_1
x : α j
hx : x ∈ t j
⊢ update f j x j ∈ t j

Next tactic:
simpa
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  refine' ⟨fun h => _, fun hx j hj => _⟩
  · convert h i hi
    simp
  · obtain rfl | h := eq_or_ne j i
    · simpa
    · 

Proof state:
case h.refine'_2.inr
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
x : α i
hx : x ∈ t i
j : ι
hj : j ∈ s
h : j ≠ i
⊢ update f i x j ∈ t j

Next tactic:
rw [update_noteq h]
theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i := by
  ext x
  refine' ⟨fun h => _, fun hx j hj => _⟩
  · convert h i hi
    simp
  · obtain rfl | h := eq_or_ne j i
    · simpa
    · rw [update_noteq h]
      

Proof state:
case h.refine'_2.inr
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s s₁ s₂ : Set ι
t t₁ t₂ : (i : ι) → Set (α i)
i : ι
inst✝ : DecidableEq ι
f : (i : ι) → α i
hi : i ∈ s
hf : ∀ j ∈ s, j ≠ i → f j ∈ t j
x : α i
hx : x ∈ t i
j : ι
hj : j ∈ s
h : j ≠ i
⊢ f j ∈ t j

Next tactic:
exact hf j hj h
theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by
  

Proof state:
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t✝ t₁ t₂ : (i : ι) → Set (α i)
i : ι
s : Set ι
inst✝ : DecidablePred fun x => x ∈ s
t : (i : ι) → Set (α i)
⊢ (pi univ fun i => if i ∈ s then t i else univ) = pi s t

Next tactic:
ext
theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by
  ext
  

Proof state:
case h
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t✝ t₁ t₂ : (i : ι) → Set (α i)
i : ι
s : Set ι
inst✝ : DecidablePred fun x => x ∈ s
t : (i : ι) → Set (α i)
x✝ : (i : ι) → α i
⊢ (x✝ ∈ pi univ fun i => if i ∈ s then t i else univ) ↔ x✝ ∈ pi s t

Next tactic:
simp_rw [mem_univ_pi]
theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by
  ext
  simp_rw [mem_univ_pi]
  

Proof state:
case h
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t✝ t₁ t₂ : (i : ι) → Set (α i)
i : ι
s : Set ι
inst✝ : DecidablePred fun x => x ∈ s
t : (i : ι) → Set (α i)
x✝ : (i : ι) → α i
⊢ (∀ (i : ι), x✝ i ∈ if i ∈ s then t i else univ) ↔ x✝ ∈ pi s t

Next tactic:
refine' forall_congr' fun i => _
theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by
  ext
  simp_rw [mem_univ_pi]
  refine' forall_congr' fun i => _
  

Proof state:
case h
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t✝ t₁ t₂ : (i : ι) → Set (α i)
i✝ : ι
s : Set ι
inst✝ : DecidablePred fun x => x ∈ s
t : (i : ι) → Set (α i)
x✝ : (i : ι) → α i
i : ι
⊢ (x✝ i ∈ if i ∈ s then t i else univ) ↔ i ∈ s → x✝ i ∈ t i

Next tactic:
split_ifs with h
theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by
  ext
  simp_rw [mem_univ_pi]
  refine' forall_congr' fun i => _
  split_ifs with h <;> 

Proof state:
case pos
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t✝ t₁ t₂ : (i : ι) → Set (α i)
i✝ : ι
s : Set ι
inst✝ : DecidablePred fun x => x ∈ s
t : (i : ι) → Set (α i)
x✝ : (i : ι) → α i
i : ι
h : i ∈ s
⊢ x✝ i ∈ t i ↔ i ∈ s → x✝ i ∈ t i

Next tactic:
simp [h]
theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) :
    (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by
  ext
  simp_rw [mem_univ_pi]
  refine' forall_congr' fun i => _
  split_ifs with h <;> 

Proof state:
case neg
ι : Type u_1
α : ι → Type u_2
β : ι → Type u_3
s✝ s₁ s₂ : Set ι
t✝ t₁ t₂ : (i : ι) → Set (α i)
i✝ : ι
s : Set ι
inst✝ : DecidablePred fun x => x ∈ s
t : (i : ι) → Set (α i)
x✝ : (i : ι) → α i
i : ι
h : i ∉ s
⊢ x✝ i ∈ univ ↔ i ∈ s → x✝ i ∈ t i

Next tactic:
simp [h]
theorem piCongrLeft_symm_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    (f.piCongrLeft α).symm ⁻¹' s.pi (fun i' => t <| f i') = (f '' s).pi t := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
s : Set ι'
t : (i : ι) → Set (α i)
⊢ (⇑(piCongrLeft α f).symm ⁻¹' pi s fun i' => t (f i')) = pi (⇑f '' s) t

Next tactic:
ext
theorem piCongrLeft_symm_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    (f.piCongrLeft α).symm ⁻¹' s.pi (fun i' => t <| f i') = (f '' s).pi t := by
  ext; 

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
s : Set ι'
t : (i : ι) → Set (α i)
x✝ : (b : ι) → α b
⊢ (x✝ ∈ ⇑(piCongrLeft α f).symm ⁻¹' pi s fun i' => t (f i')) ↔ x✝ ∈ pi (⇑f '' s) t

Next tactic:
simp
theorem piCongrLeft_symm_preimage_univ_pi (f : ι' ≃ ι) (t : ∀ i, Set (α i)) :
    (f.piCongrLeft α).symm ⁻¹' univ.pi (fun i' => t <| f i') = univ.pi t := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
t : (i : ι) → Set (α i)
⊢ (⇑(piCongrLeft α f).symm ⁻¹' pi univ fun i' => t (f i')) = pi univ t

Next tactic:
simpa [f.surjective.range_eq] using piCongrLeft_symm_preimage_pi f univ t
theorem piCongrLeft_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    f.piCongrLeft α ⁻¹' (f '' s).pi t = s.pi fun i => t (f i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
s : Set ι'
t : (i : ι) → Set (α i)
⊢ ⇑(piCongrLeft α f) ⁻¹' pi (⇑f '' s) t = pi s fun i => t (f i)

Next tactic:
apply Set.ext
theorem piCongrLeft_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    f.piCongrLeft α ⁻¹' (f '' s).pi t = s.pi fun i => t (f i) := by
  apply Set.ext;
  

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
s : Set ι'
t : (i : ι) → Set (α i)
⊢ ∀ (x : (a : ι') → α (f a)), x ∈ ⇑(piCongrLeft α f) ⁻¹' pi (⇑f '' s) t ↔ x ∈ pi s fun i => t (f i)

Next tactic:
rw [← (f.piCongrLeft α).symm.forall_congr_left]
theorem piCongrLeft_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    f.piCongrLeft α ⁻¹' (f '' s).pi t = s.pi fun i => t (f i) := by
  apply Set.ext;
  rw [← (f.piCongrLeft α).symm.forall_congr_left]
  

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
s : Set ι'
t : (i : ι) → Set (α i)
⊢ ∀ (x : (b : ι) → α b),
    (piCongrLeft α f).symm x ∈ ⇑(piCongrLeft α f) ⁻¹' pi (⇑f '' s) t ↔ (piCongrLeft α f).symm x ∈ pi s fun i => t (f i)

Next tactic:
simp
theorem piCongrLeft_preimage_univ_pi (f : ι' ≃ ι) (t : ∀ i, Set (α i)) :
    f.piCongrLeft α ⁻¹' univ.pi t = univ.pi fun i => t (f i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
f : ι' ≃ ι
t : (i : ι) → Set (α i)
⊢ ⇑(piCongrLeft α f) ⁻¹' pi univ t = pi univ fun i => t (f i)

Next tactic:
simpa [f.surjective.range_eq] using piCongrLeft_preimage_pi f univ t
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
⊢ ⇑(sumPiEquivProdPi π).symm ⁻¹' pi univ t = (pi univ fun i => t (Sum.inl i)) ×ˢ pi univ fun i => t (Sum.inr i)

Next tactic:
ext
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
⊢ x✝ ∈ ⇑(sumPiEquivProdPi π).symm ⁻¹' pi univ t ↔
    x✝ ∈ (pi univ fun i => t (Sum.inl i)) ×ˢ pi univ fun i => t (Sum.inr i)

Next tactic:
simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
⊢ (∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i) ↔ (∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)) ∧ ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)

Next tactic:
constructor
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · 

Proof state:
case h.mp
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
⊢ (∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i) → (∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)) ∧ ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)

Next tactic:
intro h
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; 

Proof state:
case h.mp
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h : ∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i
⊢ (∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)) ∧ ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)

Next tactic:
constructor
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> 

Proof state:
case h.mp.left
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h : ∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i
⊢ ∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)

Next tactic:
intro i
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> 

Proof state:
case h.mp.right
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h : ∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i
⊢ ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)

Next tactic:
intro i
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> 

Proof state:
case h.mp.left
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h : ∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i
i : ι
⊢ x✝.1 i ∈ t (Sum.inl i)

Next tactic:
apply h
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> 

Proof state:
case h.mp.right
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h : ∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i
i : ι'
⊢ x✝.2 i ∈ t (Sum.inr i)

Next tactic:
apply h
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> apply h
  · 

Proof state:
case h.mpr
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
⊢ ((∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)) ∧ ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)) → ∀ (i : ι ⊕ ι'), Sum.rec x✝.1 x✝.2 i ∈ t i

Next tactic:
rintro ⟨h₁, h₂⟩ (i|i)
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> apply h
  · rintro ⟨h₁, h₂⟩ (i|i) <;> 

Proof state:
case h.mpr.intro.inl
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h₁ : ∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)
h₂ : ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)
i : ι
⊢ Sum.rec x✝.1 x✝.2 (Sum.inl i) ∈ t (Sum.inl i)

Next tactic:
simp
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> apply h
  · rintro ⟨h₁, h₂⟩ (i|i) <;> 

Proof state:
case h.mpr.intro.inr
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h₁ : ∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)
h₂ : ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)
i : ι'
⊢ Sum.rec x✝.1 x✝.2 (Sum.inr i) ∈ t (Sum.inr i)

Next tactic:
simp
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> apply h
  · rintro ⟨h₁, h₂⟩ (i|i) <;> simp <;> 

Proof state:
case h.mpr.intro.inl
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h₁ : ∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)
h₂ : ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)
i : ι
⊢ x✝.1 i ∈ t (Sum.inl i)

Next tactic:
apply_assumption
theorem sumPiEquivProdPi_symm_preimage_univ_pi (π : ι ⊕ ι' → Type*) (t : ∀ i, Set (π i)) :
    (sumPiEquivProdPi π).symm ⁻¹' univ.pi t =
    univ.pi (fun i => t (.inl i)) ×ˢ univ.pi fun i => t (.inr i) := by
  ext
  simp_rw [mem_preimage, mem_prod, mem_univ_pi, sumPiEquivProdPi_symm_apply]
  constructor
  · intro h; constructor <;> intro i <;> apply h
  · rintro ⟨h₁, h₂⟩ (i|i) <;> simp <;> 

Proof state:
case h.mpr.intro.inr
ι : Type u_1
ι' : Type u_2
α : ι → Type u_3
π : ι ⊕ ι' → Type u_4
t : (i : ι ⊕ ι') → Set (π i)
x✝ : ((i : ι) → π (Sum.inl i)) × ((i' : ι') → π (Sum.inr i'))
h₁ : ∀ (i : ι), x✝.1 i ∈ t (Sum.inl i)
h₂ : ∀ (i : ι'), x✝.2 i ∈ t (Sum.inr i)
i : ι'
⊢ x✝.2 i ∈ t (Sum.inr i)

Next tactic:
apply_assumption
instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] : SupConvergenceClass α := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
⊢ SupConvergenceClass α

Next tactic:
refine' ⟨fun a s ha => tendsto_order.2 ⟨fun b hb => _, fun b hb => _⟩⟩
instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] : SupConvergenceClass α := by
  refine' ⟨fun a s ha => tendsto_order.2 ⟨fun b hb => _, fun b hb => _⟩⟩
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
s : Set α
ha : IsLUB s a
b : α
hb : b < a
⊢ ∀ᶠ (b_1 : ↑s) in atTop, b < CoeTC.coe b_1

Next tactic:
rcases ha.exists_between hb with ⟨c, hcs, bc, bca⟩
instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] : SupConvergenceClass α := by
  refine' ⟨fun a s ha => tendsto_order.2 ⟨fun b hb => _, fun b hb => _⟩⟩
  · rcases ha.exists_between hb with ⟨c, hcs, bc, bca⟩
    

Proof state:
case refine'_1.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
s : Set α
ha : IsLUB s a
b : α
hb : b < a
c : α
hcs : c ∈ s
bc : b < c
bca : c ≤ a
⊢ ∀ᶠ (b_1 : ↑s) in atTop, b < CoeTC.coe b_1

Next tactic:
lift c to s using hcs
instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] : SupConvergenceClass α := by
  refine' ⟨fun a s ha => tendsto_order.2 ⟨fun b hb => _, fun b hb => _⟩⟩
  · rcases ha.exists_between hb with ⟨c, hcs, bc, bca⟩
    lift c to s using hcs
    

Proof state:
case refine'_1.intro.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
s : Set α
ha : IsLUB s a
b : α
hb : b < a
c : { x // x ∈ s }
bc : b < ↑c
bca : ↑c ≤ a
⊢ ∀ᶠ (b_1 : ↑s) in atTop, b < CoeTC.coe b_1

Next tactic:
refine' (eventually_ge_atTop c).mono fun x hx => bc.trans_le hx
instance (priority := 100) LinearOrder.supConvergenceClass [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] : SupConvergenceClass α := by
  refine' ⟨fun a s ha => tendsto_order.2 ⟨fun b hb => _, fun b hb => _⟩⟩
  · rcases ha.exists_between hb with ⟨c, hcs, bc, bca⟩
    lift c to s using hcs
    refine' (eventually_ge_atTop c).mono fun x hx => bc.trans_le hx
  · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
s : Set α
ha : IsLUB s a
b : α
hb : b > a
⊢ ∀ᶠ (b_1 : ↑s) in atTop, CoeTC.coe b_1 < b

Next tactic:
exact eventually_of_forall fun x => (ha.1 x.2).trans_lt hb
theorem tendsto_atTop_isLUB (h_mono : Monotone f) (ha : IsLUB (Set.range f) a) :
    Tendsto f atTop (𝓝 a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
inst✝² : TopologicalSpace α
inst✝¹ : Preorder α
inst✝ : SupConvergenceClass α
f : ι → α
a : α
h_mono : Monotone f
ha : IsLUB (range f) a
⊢ Tendsto f atTop (𝓝 a)

Next tactic:
suffices : Tendsto (rangeFactorization f) atTop atTop
theorem tendsto_atTop_isLUB (h_mono : Monotone f) (ha : IsLUB (Set.range f) a) :
    Tendsto f atTop (𝓝 a) := by
  suffices : Tendsto (rangeFactorization f) atTop atTop
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
inst✝² : TopologicalSpace α
inst✝¹ : Preorder α
inst✝ : SupConvergenceClass α
f : ι → α
a : α
h_mono : Monotone f
ha : IsLUB (range f) a
this : Tendsto (rangeFactorization f) atTop atTop
⊢ Tendsto f atTop (𝓝 a)
case this
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
inst✝² : TopologicalSpace α
inst✝¹ : Preorder α
inst✝ : SupConvergenceClass α
f : ι → α
a : α
h_mono : Monotone f
ha : IsLUB (range f) a
⊢ Tendsto (rangeFactorization f) atTop atTop

Next tactic:
exact (SupConvergenceClass.tendsto_coe_atTop_isLUB _ _ ha).comp this
theorem tendsto_atTop_isLUB (h_mono : Monotone f) (ha : IsLUB (Set.range f) a) :
    Tendsto f atTop (𝓝 a) := by
  suffices : Tendsto (rangeFactorization f) atTop atTop
  exact (SupConvergenceClass.tendsto_coe_atTop_isLUB _ _ ha).comp this
  

Proof state:
case this
α : Type u_1
β : Type u_2
ι : Type u_3
inst✝³ : Preorder ι
inst✝² : TopologicalSpace α
inst✝¹ : Preorder α
inst✝ : SupConvergenceClass α
f : ι → α
a : α
h_mono : Monotone f
ha : IsLUB (range f) a
⊢ Tendsto (rangeFactorization f) atTop atTop

Next tactic:
exact h_mono.rangeFactorization.tendsto_atTop_atTop fun b => b.2.imp fun a ha => ha.ge