l3lab/ntp-mathlib huggingface dataset:
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · 

Proof state:
case open_closure.mk
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
⊢ IsOpen (Sigma.mk i ⁻¹' closure s)

Next tactic:
rw [h]
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    

Proof state:
case open_closure.mk
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
⊢ IsOpen (closure (Sigma.mk i ⁻¹' s))

Next tactic:
exact h₀ _ (hs i)
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  

Proof state:
case h
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
⊢ Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)

Next tactic:
apply IsOpenMap.preimage_closure_eq_closure_preimage
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · 

Proof state:
case h.hf
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
⊢ IsOpenMap (Sigma.mk i)

Next tactic:
intro U _
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    

Proof state:
case h.hf
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
U : Set (π i)
a✝ : IsOpen U
⊢ IsOpen (Sigma.mk i '' U)

Next tactic:
rw [isOpen_sigma_iff]
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    rw [isOpen_sigma_iff]
    

Proof state:
case h.hf
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
U : Set (π i)
a✝ : IsOpen U
⊢ ∀ (i_1 : ι), IsOpen (Sigma.mk i_1 ⁻¹' (Sigma.mk i '' U))

Next tactic:
intro j
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    rw [isOpen_sigma_iff]
    intro j
    

Proof state:
case h.hf
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
U : Set (π i)
a✝ : IsOpen U
j : ι
⊢ IsOpen (Sigma.mk j ⁻¹' (Sigma.mk i '' U))

Next tactic:
by_cases ij : i = j
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    rw [isOpen_sigma_iff]
    intro j
    by_cases ij : i = j
    · 

Proof state:
case pos
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
U : Set (π i)
a✝ : IsOpen U
j : ι
ij : i = j
⊢ IsOpen (Sigma.mk j ⁻¹' (Sigma.mk i '' U))

Next tactic:
rwa [← ij, sigma_mk_preimage_image_eq_self]
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    rw [isOpen_sigma_iff]
    intro j
    by_cases ij : i = j
    · rwa [← ij, sigma_mk_preimage_image_eq_self]
    · 

Proof state:
case neg
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
U : Set (π i)
a✝ : IsOpen U
j : ι
ij : ¬i = j
⊢ IsOpen (Sigma.mk j ⁻¹' (Sigma.mk i '' U))

Next tactic:
rw [sigma_mk_preimage_image' ij]
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    rw [isOpen_sigma_iff]
    intro j
    by_cases ij : i = j
    · rwa [← ij, sigma_mk_preimage_image_eq_self]
    · rw [sigma_mk_preimage_image' ij]
      

Proof state:
case neg
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
U : Set (π i)
a✝ : IsOpen U
j : ι
ij : ¬i = j
⊢ IsOpen ∅

Next tactic:
exact isOpen_empty
/-- The sigma-type of extremally disconnected spaces is extremally disconnected. -/
instance instExtremallyDisconnected {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [h₀ : ∀ i, ExtremallyDisconnected (π i)] : ExtremallyDisconnected (Σ i, π i) := by
  constructor
  intro s hs
  rw [isOpen_sigma_iff] at hs ⊢
  intro i
  rcases h₀ i with ⟨h₀⟩
  suffices h : Sigma.mk i ⁻¹' closure s = closure (Sigma.mk i ⁻¹' s)
  · rw [h]
    exact h₀ _ (hs i)
  apply IsOpenMap.preimage_closure_eq_closure_preimage
  · intro U _
    rw [isOpen_sigma_iff]
    intro j
    by_cases ij : i = j
    · rwa [← ij, sigma_mk_preimage_image_eq_self]
    · rw [sigma_mk_preimage_image' ij]
      exact isOpen_empty
  · 

Proof state:
case h.hfc
X : Type u
inst✝¹ : TopologicalSpace X
ι : Type ?u.35158
π : ι → Type u_1
inst✝ : (i : ι) → TopologicalSpace (π i)
h₀✝ : ∀ (i : ι), ExtremallyDisconnected (π i)
s : Set ((i : ι) × π i)
hs : ∀ (i : ι), IsOpen (Sigma.mk i ⁻¹' s)
i : ι
h₀ : ∀ (U : Set (π i)), IsOpen U → IsOpen (closure U)
⊢ Continuous (Sigma.mk i)

Next tactic:
continuity
/-- Map a `CFilter` to an equivalent representation type. -/
def ofEquiv (E : σ ≃ τ) : CFilter α σ → CFilter α τ
  | ⟨f, p, g, h₁, h₂⟩ =>
    { f := fun a ↦ f (E.symm a)
      pt := E p
      inf := fun a b ↦ E (g (E.symm a) (E.symm b))
      inf_le_left := fun a b ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : PartialOrder α
F : CFilter α σ
E : σ ≃ τ
f : σ → α
p : σ
g : σ → σ → σ
h₁ : ∀ (a b : σ), f (g a b) ≤ f a
h₂ : ∀ (a b : σ), f (g a b) ≤ f b
a b : τ
⊢ (fun a => f (E.symm a)) ((fun a b => E (g (E.symm a) (E.symm b))) a b) ≤ (fun a => f (E.symm a)) a

Next tactic:
simpa using h₁ (E.symm a) (E.symm b)
/-- Map a `CFilter` to an equivalent representation type. -/
def ofEquiv (E : σ ≃ τ) : CFilter α σ → CFilter α τ
  | ⟨f, p, g, h₁, h₂⟩ =>
    { f := fun a ↦ f (E.symm a)
      pt := E p
      inf := fun a b ↦ E (g (E.symm a) (E.symm b))
      inf_le_left := fun a b ↦ by simpa using h₁ (E.symm a) (E.symm b)
      inf_le_right := fun a b ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : PartialOrder α
F : CFilter α σ
E : σ ≃ τ
f : σ → α
p : σ
g : σ → σ → σ
h₁ : ∀ (a b : σ), f (g a b) ≤ f a
h₂ : ∀ (a b : σ), f (g a b) ≤ f b
a b : τ
⊢ (fun a => f (E.symm a)) ((fun a b => E (g (E.symm a) (E.symm b))) a b) ≤ (fun a => f (E.symm a)) b

Next tactic:
simpa using h₂ (E.symm a) (E.symm b)
@[simp]
theorem ofEquiv_val (E : σ ≃ τ) (F : CFilter α σ) (a : τ) : F.ofEquiv E a = F (E.symm a) := by
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : PartialOrder α
F✝ : CFilter α σ
E : σ ≃ τ
F : CFilter α σ
a : τ
⊢ f (ofEquiv E F) a = f F (E.symm a)

Next tactic:
cases F
@[simp]
theorem ofEquiv_val (E : σ ≃ τ) (F : CFilter α σ) (a : τ) : F.ofEquiv E a = F (E.symm a) := by
  cases F; 

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : PartialOrder α
F : CFilter α σ
E : σ ≃ τ
a : τ
f✝ : σ → α
pt✝ : σ
inf✝ : σ → σ → σ
inf_le_left✝ : ∀ (a b : σ), f✝ (inf✝ a b) ≤ f✝ a
inf_le_right✝ : ∀ (a b : σ), f✝ (inf✝ a b) ≤ f✝ b
⊢ f (ofEquiv E { f := f✝, pt := pt✝, inf := inf✝, inf_le_left := inf_le_left✝, inf_le_right := inf_le_right✝ }) a =
    f { f := f✝, pt := pt✝, inf := inf✝, inf_le_left := inf_le_left✝, inf_le_right := inf_le_right✝ } (E.symm a)

Next tactic:
rfl
theorem mem_sets {f : Filter α} (F : f.Realizer) {a : Set α} : a ∈ f ↔ ∃ b, F.F b ⊆ a := by
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
a : Set α
⊢ a ∈ f ↔ ∃ b, CFilter.f F.F b ⊆ a

Next tactic:
cases F
theorem mem_sets {f : Filter α} (F : f.Realizer) {a : Set α} : a ∈ f ↔ ∃ b, F.F b ⊆ a := by
  cases F; 

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
a : Set α
σ✝ : Type u_5
F✝ : CFilter (Set α) σ✝
eq✝ : CFilter.toFilter F✝ = f
⊢ a ∈ f ↔ ∃ b, CFilter.f { σ := σ✝, F := F✝, eq := eq✝ }.F b ⊆ a

Next tactic:
subst f
theorem mem_sets {f : Filter α} (F : f.Realizer) {a : Set α} : a ∈ f ↔ ∃ b, F.F b ⊆ a := by
  cases F; subst f; 

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
a : Set α
σ✝ : Type u_5
F✝ : CFilter (Set α) σ✝
⊢ a ∈ CFilter.toFilter F✝ ↔
    ∃ b, CFilter.f { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F b ⊆ a

Next tactic:
rfl
/-- A filter realizes itself. -/
def ofFilter (f : Filter α) : f.Realizer :=
  ⟨f.sets,
    { f := Subtype.val
      pt := ⟨univ, univ_mem⟩
      inf := fun ⟨_, h₁⟩ ⟨_, h₂⟩ ↦ ⟨_, inter_mem h₁ h₂⟩
      inf_le_left := fun ⟨x, _⟩ ⟨y, _⟩ ↦ inter_subset_left x y
      inf_le_right := fun ⟨x, _⟩ ⟨y, _⟩ ↦ inter_subset_right x y },
    filter_eq <| Set.ext fun _ ↦ by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
x✝ : Set α
⊢ x✝ ∈
      (CFilter.toFilter
          { f := Subtype.val, pt := { val := univ, property := (_ : univ ∈ f) },
            inf := fun x x_1 =>
              match x with
              | { val := val, property := h₁ } =>
                match x_1 with
                | { val := val_1, property := h₂ } => { val := val ∩ val_1, property := (_ : val ∩ val_1 ∈ f) },
            inf_le_left :=
              (_ :
                ∀ (x x_1 : ↑f.sets),
                  ↑((fun x x_2 =>
                          match x with
                          | { val := val, property := h₁ } =>
                            match x_2 with
                            | { val := val_1, property := h₂ } =>
                              { val := val ∩ val_1, property := (_ : val ∩ val_1 ∈ f) })
                        x x_1) ≤
                    ↑x),
            inf_le_right :=
              (_ :
                ∀ (x x_1 : ↑f.sets),
                  ↑((fun x x_2 =>
                          match x with
                          | { val := val, property := h₁ } =>
                            match x_2 with
                            | { val := val_1, property := h₂ } =>
                              { val := val ∩ val_1, property := (_ : val ∩ val_1 ∈ f) })
                        x x_1) ≤
                    ↑x_1) }).sets ↔
    x✝ ∈ f.sets

Next tactic:
simp [exists_mem_subset_iff]
/-- Transfer a filter realizer to another realizer on a different base type. -/
def ofEquiv {f : Filter α} (F : f.Realizer) (E : F.σ ≃ τ) : f.Realizer :=
  ⟨τ, F.F.ofEquiv E, by
    

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
E : F.σ ≃ τ
⊢ CFilter.toFilter (CFilter.ofEquiv E F.F) = f

Next tactic:
refine' Eq.trans _ F.eq
/-- Transfer a filter realizer to another realizer on a different base type. -/
def ofEquiv {f : Filter α} (F : f.Realizer) (E : F.σ ≃ τ) : f.Realizer :=
  ⟨τ, F.F.ofEquiv E, by
    refine' Eq.trans _ F.eq
    

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
E : F.σ ≃ τ
⊢ CFilter.toFilter (CFilter.ofEquiv E F.F) = CFilter.toFilter F.F

Next tactic:
exact filter_eq (Set.ext fun _ ↦
      ⟨fun ⟨s, h⟩ ↦ ⟨E.symm s, by simpa using h⟩, fun ⟨t, h⟩ ↦ ⟨E t, by simp [h]⟩⟩)
/-- Transfer a filter realizer to another realizer on a different base type. -/
def ofEquiv {f : Filter α} (F : f.Realizer) (E : F.σ ≃ τ) : f.Realizer :=
  ⟨τ, F.F.ofEquiv E, by
    refine' Eq.trans _ F.eq
    exact filter_eq (Set.ext fun _ ↦
      ⟨fun ⟨s, h⟩ ↦ ⟨E.symm s, by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
E : F.σ ≃ τ
x✝¹ : Set α
x✝ : x✝¹ ∈ (CFilter.toFilter (CFilter.ofEquiv E F.F)).sets
s : τ
h : CFilter.f (CFilter.ofEquiv E F.F) s ⊆ x✝¹
⊢ CFilter.f F.F (E.symm s) ⊆ x✝¹

Next tactic:
simpa using h
/-- Transfer a filter realizer to another realizer on a different base type. -/
def ofEquiv {f : Filter α} (F : f.Realizer) (E : F.σ ≃ τ) : f.Realizer :=
  ⟨τ, F.F.ofEquiv E, by
    refine' Eq.trans _ F.eq
    exact filter_eq (Set.ext fun _ ↦
      ⟨fun ⟨s, h⟩ ↦ ⟨E.symm s, by simpa using h⟩, fun ⟨t, h⟩ ↦ ⟨E t, by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
E : F.σ ≃ τ
x✝¹ : Set α
x✝ : x✝¹ ∈ (CFilter.toFilter F.F).sets
t : F.σ
h : CFilter.f F.F t ⊆ x✝¹
⊢ CFilter.f (CFilter.ofEquiv E F.F) (E t) ⊆ x✝¹

Next tactic:
simp [h]
/-- Construct a realizer for `map m f` given a realizer for `f` -/
protected def map (m : α → β) {f : Filter α} (F : f.Realizer) : (map m f).Realizer :=
  ⟨F.σ,
    { f := fun s ↦ image m (F.F s)
      pt := F.F.pt
      inf := F.F.inf
      inf_le_left := fun _ _ ↦ image_subset _ (F.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ image_subset _ (F.F.inf_le_right _ _) },
    filter_eq <| Set.ext fun _ ↦ by
      

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
m : α → β
f : Filter α
F : Realizer f
x✝ : Set β
⊢ x✝ ∈
      (CFilter.toFilter
          { f := fun s => m '' CFilter.f F.F s, pt := F.F.pt, inf := F.F.inf,
            inf_le_left := (_ : ∀ (x x_1 : F.σ), m '' CFilter.f F.F (CFilter.inf F.F x x_1) ⊆ m '' CFilter.f F.F x),
            inf_le_right :=
              (_ : ∀ (x x_1 : F.σ), m '' CFilter.f F.F (CFilter.inf F.F x x_1) ⊆ m '' CFilter.f F.F x_1) }).sets ↔
    x✝ ∈ (map m f).sets

Next tactic:
simp only [CFilter.toFilter, image_subset_iff, mem_setOf_eq, Filter.mem_sets, mem_map]
/-- Construct a realizer for `map m f` given a realizer for `f` -/
protected def map (m : α → β) {f : Filter α} (F : f.Realizer) : (map m f).Realizer :=
  ⟨F.σ,
    { f := fun s ↦ image m (F.F s)
      pt := F.F.pt
      inf := F.F.inf
      inf_le_left := fun _ _ ↦ image_subset _ (F.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ image_subset _ (F.F.inf_le_right _ _) },
    filter_eq <| Set.ext fun _ ↦ by
      simp only [CFilter.toFilter, image_subset_iff, mem_setOf_eq, Filter.mem_sets, mem_map]
      

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
m : α → β
f : Filter α
F : Realizer f
x✝ : Set β
⊢ (∃ b, CFilter.f F.F b ⊆ m ⁻¹' x✝) ↔ m ⁻¹' x✝ ∈ f

Next tactic:
rw [F.mem_sets]
/-- Construct a realizer for `comap m f` given a realizer for `f` -/
protected def comap (m : α → β) {f : Filter β} (F : f.Realizer) : (comap m f).Realizer :=
  ⟨F.σ,
    { f := fun s ↦ preimage m (F.F s)
      pt := F.F.pt
      inf := F.F.inf
      inf_le_left := fun _ _ ↦ preimage_mono (F.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ preimage_mono (F.F.inf_le_right _ _) },
    filter_eq <| Set.ext fun _ ↦ by
      

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
m : α → β
f : Filter β
F : Realizer f
x✝ : Set α
⊢ x✝ ∈
      (CFilter.toFilter
          { f := fun s => m ⁻¹' CFilter.f F.F s, pt := F.F.pt, inf := F.F.inf,
            inf_le_left := (_ : ∀ (x x_1 : F.σ), m ⁻¹' CFilter.f F.F (CFilter.inf F.F x x_1) ⊆ m ⁻¹' CFilter.f F.F x),
            inf_le_right :=
              (_ : ∀ (x x_1 : F.σ), m ⁻¹' CFilter.f F.F (CFilter.inf F.F x x_1) ⊆ m ⁻¹' CFilter.f F.F x_1) }).sets ↔
    x✝ ∈ (comap m f).sets

Next tactic:
cases F
/-- Construct a realizer for `comap m f` given a realizer for `f` -/
protected def comap (m : α → β) {f : Filter β} (F : f.Realizer) : (comap m f).Realizer :=
  ⟨F.σ,
    { f := fun s ↦ preimage m (F.F s)
      pt := F.F.pt
      inf := F.F.inf
      inf_le_left := fun _ _ ↦ preimage_mono (F.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ preimage_mono (F.F.inf_le_right _ _) },
    filter_eq <| Set.ext fun _ ↦ by
      cases F; 

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
m : α → β
f : Filter β
x✝ : Set α
σ✝ : Type ?u.18956
F✝ : CFilter (Set β) σ✝
eq✝ : CFilter.toFilter F✝ = f
⊢ x✝ ∈
      (CFilter.toFilter
          { f := fun s => m ⁻¹' CFilter.f { σ := σ✝, F := F✝, eq := eq✝ }.F s,
            pt := { σ := σ✝, F := F✝, eq := eq✝ }.F.pt, inf := { σ := σ✝, F := F✝, eq := eq✝ }.F.inf,
            inf_le_left :=
              (_ :
                ∀ (x x_1 : { σ := σ✝, F := F✝, eq := eq✝ }.σ),
                  m ⁻¹'
                      CFilter.f { σ := σ✝, F := F✝, eq := eq✝ }.F
                        (CFilter.inf { σ := σ✝, F := F✝, eq := eq✝ }.F x x_1) ⊆
                    m ⁻¹' CFilter.f { σ := σ✝, F := F✝, eq := eq✝ }.F x),
            inf_le_right :=
              (_ :
                ∀ (x x_1 : { σ := σ✝, F := F✝, eq := eq✝ }.σ),
                  m ⁻¹'
                      CFilter.f { σ := σ✝, F := F✝, eq := eq✝ }.F
                        (CFilter.inf { σ := σ✝, F := F✝, eq := eq✝ }.F x x_1) ⊆
                    m ⁻¹' CFilter.f { σ := σ✝, F := F✝, eq := eq✝ }.F x_1) }).sets ↔
    x✝ ∈ (comap m f).sets

Next tactic:
subst f
/-- Construct a realizer for `comap m f` given a realizer for `f` -/
protected def comap (m : α → β) {f : Filter β} (F : f.Realizer) : (comap m f).Realizer :=
  ⟨F.σ,
    { f := fun s ↦ preimage m (F.F s)
      pt := F.F.pt
      inf := F.F.inf
      inf_le_left := fun _ _ ↦ preimage_mono (F.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ preimage_mono (F.F.inf_le_right _ _) },
    filter_eq <| Set.ext fun _ ↦ by
      cases F; subst f
      

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
m : α → β
x✝ : Set α
σ✝ : Type ?u.18956
F✝ : CFilter (Set β) σ✝
⊢ x✝ ∈
      (CFilter.toFilter
          {
            f := fun s =>
              m ⁻¹' CFilter.f { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F s,
            pt := { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F.pt,
            inf := { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F.inf,
            inf_le_left :=
              (_ :
                ∀ (x x_1 : { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.σ),
                  m ⁻¹'
                      CFilter.f { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F
                        (CFilter.inf { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F x
                          x_1) ⊆
                    m ⁻¹' CFilter.f { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F x),
            inf_le_right :=
              (_ :
                ∀ (x x_1 : { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.σ),
                  m ⁻¹'
                      CFilter.f { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F
                        (CFilter.inf { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F x
                          x_1) ⊆
                    m ⁻¹'
                      CFilter.f { σ := σ✝, F := F✝, eq := (_ : CFilter.toFilter F✝ = CFilter.toFilter F✝) }.F
                        x_1) }).sets ↔
    x✝ ∈ (comap m (CFilter.toFilter F✝)).sets

Next tactic:
exact ⟨fun ⟨s, h⟩ ↦ ⟨_, ⟨s, Subset.refl _⟩, h⟩,
        fun ⟨_, ⟨s, h⟩, h₂⟩ ↦ ⟨s, Subset.trans (preimage_mono h) h₂⟩⟩