l3lab/ntp-mathlib huggingface dataset:
theorem le_of_inf_neBot' (f : Ultrafilter α) {g : Filter α} (hg : NeBot (g ⊓ f)) : ↑f ≤ g :=
  f.le_of_inf_neBot <| by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g✝ : Ultrafilter α
s t : Set α
p q : α → Prop
f : Ultrafilter α
g : Filter α
hg : NeBot (g ⊓ ↑f)
⊢ NeBot (↑f ⊓ g)

Next tactic:
rwa [inf_comm]
theorem disjoint_iff_not_le {f : Ultrafilter α} {g : Filter α} : Disjoint (↑f) g ↔ ¬↑f ≤ g := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g✝ : Ultrafilter α
s t : Set α
p q : α → Prop
f : Ultrafilter α
g : Filter α
⊢ Disjoint (↑f) g ↔ ¬↑f ≤ g

Next tactic:
rw [← inf_neBot_iff, neBot_iff, Ne.def, not_not, disjoint_iff]
@[simp]
theorem compl_not_mem_iff : sᶜ ∉ f ↔ s ∈ f :=
  ⟨fun hsc =>
    le_principal_iff.1 <|
      f.le_of_inf_neBot ⟨fun h => hsc <| mem_of_eq_bot <| by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
hsc : sᶜ ∉ f
h : ↑f ⊓ 𝓟 s = ⊥
⊢ ↑f ⊓ 𝓟 sᶜᶜ = ⊥

Next tactic:
rwa [compl_compl]
theorem compl_mem_iff_not_mem : sᶜ ∈ f ↔ s ∉ f := by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
⊢ sᶜ ∈ f ↔ s ∉ f

Next tactic:
rw [← compl_not_mem_iff, compl_compl]
/-- If `sᶜ ∉ f ↔ s ∈ f`, then `f` is an ultrafilter. The other implication is given by
`Ultrafilter.compl_not_mem_iff`.  -/
def ofComplNotMemIff (f : Filter α) (h : ∀ s, sᶜ ∉ f ↔ s ∈ f) : Ultrafilter α where
  toFilter := f
  neBot' := ⟨fun hf => by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g : Ultrafilter α
s t : Set α
p q : α → Prop
f : Filter α
h : ∀ (s : Set α), sᶜ ∉ f ↔ s ∈ f
hf : f = ⊥
⊢ False

Next tactic:
simp [hf] at h
@[simp]
theorem le_sup_iff {u : Ultrafilter α} {f g : Filter α} : ↑u ≤ f ⊔ g ↔ ↑u ≤ f ∨ ↑u ≤ g :=
  not_iff_not.1 <| by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g✝ : Ultrafilter α
s t : Set α
p q : α → Prop
u : Ultrafilter α
f g : Filter α
⊢ ¬↑u ≤ f ⊔ g ↔ ¬(↑u ≤ f ∨ ↑u ≤ g)

Next tactic:
simp only [← disjoint_iff_not_le, not_or, disjoint_sup_right]
@[simp]
theorem union_mem_iff : s ∪ t ∈ f ↔ s ∈ f ∨ t ∈ f := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
⊢ s ∪ t ∈ f ↔ s ∈ f ∨ t ∈ f

Next tactic:
simp only [← mem_coe, ← le_principal_iff, ← sup_principal, le_sup_iff]
theorem eventually_imp : (∀ᶠ x in f, p x → q x) ↔ (∀ᶠ x in f, p x) → ∀ᶠ x in f, q x := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
⊢ (∀ᶠ (x : α) in ↑f, p x → q x) ↔ (∀ᶠ (x : α) in ↑f, p x) → ∀ᶠ (x : α) in ↑f, q x

Next tactic:
simp only [imp_iff_not_or, eventually_or, eventually_not]
theorem finite_sUnion_mem_iff {s : Set (Set α)} (hs : s.Finite) : ⋃₀ s ∈ f ↔ ∃ t ∈ s, t ∈ f :=
  Finite.induction_on hs (by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s✝ t : Set α
p q : α → Prop
s : Set (Set α)
hs : Set.Finite s
⊢ ⋃₀ ∅ ∈ f ↔ ∃ t ∈ ∅, t ∈ f

Next tactic:
simp
theorem finite_sUnion_mem_iff {s : Set (Set α)} (hs : s.Finite) : ⋃₀ s ∈ f ↔ ∃ t ∈ s, t ∈ f :=
  Finite.induction_on hs (by simp) fun _ _ his => by
    

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s✝¹ t : Set α
p q : α → Prop
s : Set (Set α)
hs : Set.Finite s
a✝ : Set α
s✝ : Set (Set α)
x✝¹ : a✝ ∉ s✝
x✝ : Set.Finite s✝
his : ⋃₀ s✝ ∈ f ↔ ∃ t ∈ s✝, t ∈ f
⊢ ⋃₀ insert a✝ s✝ ∈ f ↔ ∃ t ∈ insert a✝ s✝, t ∈ f

Next tactic:
simp [union_mem_iff, his, or_and_right, exists_or]
theorem finite_biUnion_mem_iff {is : Set β} {s : β → Set α} (his : is.Finite) :
    (⋃ i ∈ is, s i) ∈ f ↔ ∃ i ∈ is, s i ∈ f := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s✝ t : Set α
p q : α → Prop
is : Set β
s : β → Set α
his : Set.Finite is
⊢ ⋃ i ∈ is, s i ∈ f ↔ ∃ i ∈ is, s i ∈ f

Next tactic:
simp only [← sUnion_image, finite_sUnion_mem_iff (his.image s), bex_image_iff]
/-- The pullback of an ultrafilter along an injection whose range is large with respect to the given
ultrafilter. -/
nonrec def comap {m : α → β} (u : Ultrafilter β) (inj : Injective m) (large : Set.range m ∈ u) :
    Ultrafilter α where
  toFilter := comap m u
  neBot' := u.neBot'.comap_of_range_mem large
  le_of_le g hg hgu := by
    

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g✝ : Ultrafilter α
s t : Set α
p q : α → Prop
m : α → β
u : Ultrafilter β
inj : Injective m
large : range m ∈ u
g : Filter α
hg : NeBot g
hgu : g ≤ Filter.comap m ↑u
⊢ Filter.comap m ↑u ≤ g

Next tactic:
simp only [← u.unique (map_le_iff_le_comap.2 hgu), comap_map inj, le_rfl]
@[simp]
nonrec theorem comap_id (f : Ultrafilter α) (h₀ : Injective (id : α → α) := injective_id)
    (h₁ : range id ∈ f := (by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g : Ultrafilter α
s t : Set α
p q : α → Prop
f : Ultrafilter α
h₀ : optParam (Injective id) (_ : Injective id)
⊢ range id ∈ f

Next tactic:
rw [range_id]
@[simp]
nonrec theorem comap_id (f : Ultrafilter α) (h₀ : Injective (id : α → α) := injective_id)
    (h₁ : range id ∈ f := (by rw [range_id]; 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g : Ultrafilter α
s t : Set α
p q : α → Prop
f : Ultrafilter α
h₀ : optParam (Injective id) (_ : Injective id)
⊢ univ ∈ f

Next tactic:
exact univ_mem
@[simp]
nonrec theorem comap_comap (f : Ultrafilter γ) {m : α → β} {n : β → γ} (inj₀ : Injective n)
    (large₀ : range n ∈ f) (inj₁ : Injective m) (large₁ : range m ∈ f.comap inj₀ large₀)
    (inj₂ : Injective (n ∘ m) := inj₀.comp inj₁)
    (large₂ : range (n ∘ m) ∈ f :=
      (by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g : Ultrafilter α
s t : Set α
p q : α → Prop
f : Ultrafilter γ
m : α → β
n : β → γ
inj₀ : Injective n
large₀ : range n ∈ f
inj₁ : Injective m
large₁ : range m ∈ comap f inj₀ large₀
inj₂ : optParam (Injective (n ∘ m)) (_ : Injective (n ∘ m))
⊢ range (n ∘ m) ∈ f

Next tactic:
rw [range_comp]
@[simp]
nonrec theorem comap_comap (f : Ultrafilter γ) {m : α → β} {n : β → γ} (inj₀ : Injective n)
    (large₀ : range n ∈ f) (inj₁ : Injective m) (large₁ : range m ∈ f.comap inj₀ large₀)
    (inj₂ : Injective (n ∘ m) := inj₀.comp inj₁)
    (large₂ : range (n ∘ m) ∈ f :=
      (by rw [range_comp]; 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g : Ultrafilter α
s t : Set α
p q : α → Prop
f : Ultrafilter γ
m : α → β
n : β → γ
inj₀ : Injective n
large₀ : range n ∈ f
inj₁ : Injective m
large₁ : range m ∈ comap f inj₀ large₀
inj₂ : optParam (Injective (n ∘ m)) (_ : Injective (n ∘ m))
⊢ n '' range m ∈ f

Next tactic:
exact image_mem_of_mem_comap large₀ large₁
/-- The principal ultrafilter associated to a point `x`. -/
instance : Pure Ultrafilter :=
  ⟨fun a => ofComplNotMemIff (pure a) fun s => by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s✝ t : Set α
p q : α → Prop
α✝ : Type ?u.18439
a : α✝
s : Set α✝
⊢ sᶜ ∉ pure a ↔ s ∈ pure a

Next tactic:
simp
@[simp]
theorem comap_pure {m : α → β} (a : α) (inj : Injective m) (large) :
    comap (pure <| m a) inj large = pure a :=
  coe_injective <|
    comap_pure.trans <| by
      

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
m : α → β
a : α
inj : Injective m
large : range m ∈ pure (m a)
⊢ 𝓟 (m ⁻¹' {m a}) = ↑(pure a)

Next tactic:
rw [coe_pure, ← principal_singleton, ← image_singleton, preimage_image_eq _ inj]
theorem eq_pure_of_finite_mem (h : s.Finite) (h' : s ∈ f) : ∃ x ∈ s, f = pure x := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
h : Set.Finite s
h' : s ∈ f
⊢ ∃ x ∈ s, f = pure x

Next tactic:
rw [← biUnion_of_singleton s] at h'
theorem eq_pure_of_finite_mem (h : s.Finite) (h' : s ∈ f) : ∃ x ∈ s, f = pure x := by
  rw [← biUnion_of_singleton s] at h'
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
h : Set.Finite s
h' : ⋃ x ∈ s, {x} ∈ f
⊢ ∃ x ∈ s, f = pure x

Next tactic:
rcases (Ultrafilter.finite_biUnion_mem_iff h).mp h' with ⟨a, has, haf⟩
theorem eq_pure_of_finite_mem (h : s.Finite) (h' : s ∈ f) : ∃ x ∈ s, f = pure x := by
  rw [← biUnion_of_singleton s] at h'
  rcases (Ultrafilter.finite_biUnion_mem_iff h).mp h' with ⟨a, has, haf⟩
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type u_1
f g : Ultrafilter α
s t : Set α
p q : α → Prop
h : Set.Finite s
h' : ⋃ x ∈ s, {x} ∈ f
a : α
has : a ∈ s
haf : {a} ∈ f
⊢ ∃ x ∈ s, f = pure x

Next tactic:
exact ⟨a, has, eq_of_le (Filter.le_pure_iff.2 haf)⟩
/-- Monadic bind for ultrafilters, coming from the one on filters
defined in terms of map and join.-/
def bind (f : Ultrafilter α) (m : α → Ultrafilter β) : Ultrafilter β :=
  ofComplNotMemIff (Filter.bind ↑f fun x => ↑(m x)) fun s => by
    

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ g : Ultrafilter α
s✝ t : Set α
p q : α → Prop
f : Ultrafilter α
m : α → Ultrafilter β
s : Set β
⊢ (sᶜ ∉ Filter.bind ↑f fun x => ↑(m x)) ↔ s ∈ Filter.bind ↑f fun x => ↑(m x)

Next tactic:
simp only [mem_bind', mem_coe, ← compl_mem_iff_not_mem, compl_setOf, compl_compl]
protected theorem NeBot.eq_pure_iff (hf : f.NeBot) {x : α} :
    f = pure x ↔ {x} ∈ f := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
hf : NeBot f
x : α
⊢ f = pure x ↔ {x} ∈ f

Next tactic:
rw [← hf.le_pure_iff, le_pure_iff]
lemma atTop_eq_pure_of_isTop [LinearOrder α] {x : α} (hx : IsTop x) :
    (atTop : Filter α) = pure x := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
inst✝ : LinearOrder α
x : α
hx : IsTop x
⊢ atTop = pure x

Next tactic:
have : Nonempty α := ⟨x⟩
lemma atTop_eq_pure_of_isTop [LinearOrder α] {x : α} (hx : IsTop x) :
    (atTop : Filter α) = pure x := by
  have : Nonempty α := ⟨x⟩
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
inst✝ : LinearOrder α
x : α
hx : IsTop x
this : Nonempty α
⊢ atTop = pure x

Next tactic:
apply atTop_neBot.eq_pure_iff.2
lemma atTop_eq_pure_of_isTop [LinearOrder α] {x : α} (hx : IsTop x) :
    (atTop : Filter α) = pure x := by
  have : Nonempty α := ⟨x⟩
  apply atTop_neBot.eq_pure_iff.2
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
inst✝ : LinearOrder α
x : α
hx : IsTop x
this : Nonempty α
⊢ {x} ∈ atTop

Next tactic:
convert Ici_mem_atTop x using 1
lemma atTop_eq_pure_of_isTop [LinearOrder α] {x : α} (hx : IsTop x) :
    (atTop : Filter α) = pure x := by
  have : Nonempty α := ⟨x⟩
  apply atTop_neBot.eq_pure_iff.2
  convert Ici_mem_atTop x using 1
  

Proof state:
case h.e'_4
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
inst✝ : LinearOrder α
x : α
hx : IsTop x
this : Nonempty α
⊢ {x} = Ici x

Next tactic:
exact (Ici_eq_singleton_iff_isTop.2 hx).symm
theorem mem_iff_ultrafilter : s ∈ f ↔ ∀ g : Ultrafilter α, ↑g ≤ f → s ∈ g := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
⊢ s ∈ f ↔ ∀ (g : Ultrafilter α), ↑g ≤ f → s ∈ g

Next tactic:
refine' ⟨fun hf g hg => hg hf, fun H => by_contra fun hf => _⟩
theorem mem_iff_ultrafilter : s ∈ f ↔ ∀ g : Ultrafilter α, ↑g ≤ f → s ∈ g := by
  refine' ⟨fun hf g hg => hg hf, fun H => by_contra fun hf => _⟩
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
H : ∀ (g : Ultrafilter α), ↑g ≤ f → s ∈ g
hf : s ∉ f
⊢ False

Next tactic:
set g : Filter (sᶜ : Set α) := comap (↑) f
theorem mem_iff_ultrafilter : s ∈ f ↔ ∀ g : Ultrafilter α, ↑g ≤ f → s ∈ g := by
  refine' ⟨fun hf g hg => hg hf, fun H => by_contra fun hf => _⟩
  set g : Filter (sᶜ : Set α) := comap (↑) f
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
H : ∀ (g : Ultrafilter α), ↑g ≤ f → s ∈ g
hf : s ∉ f
g : Filter ↑sᶜ := comap Subtype.val f
⊢ False

Next tactic:
haveI : NeBot g := comap_neBot_iff_compl_range.2 (by simpa [compl_setOf] )
theorem mem_iff_ultrafilter : s ∈ f ↔ ∀ g : Ultrafilter α, ↑g ≤ f → s ∈ g := by
  refine' ⟨fun hf g hg => hg hf, fun H => by_contra fun hf => _⟩
  set g : Filter (sᶜ : Set α) := comap (↑) f
  haveI : NeBot g := comap_neBot_iff_compl_range.2 (by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
H : ∀ (g : Ultrafilter α), ↑g ≤ f → s ∈ g
hf : s ∉ f
g : Filter ↑sᶜ := comap Subtype.val f
⊢ (range Subtype.val)ᶜ ∉ f

Next tactic:
simpa [compl_setOf]
theorem mem_iff_ultrafilter : s ∈ f ↔ ∀ g : Ultrafilter α, ↑g ≤ f → s ∈ g := by
  refine' ⟨fun hf g hg => hg hf, fun H => by_contra fun hf => _⟩
  set g : Filter (sᶜ : Set α) := comap (↑) f
  haveI : NeBot g := comap_neBot_iff_compl_range.2 (by simpa [compl_setOf] )
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
H : ∀ (g : Ultrafilter α), ↑g ≤ f → s ∈ g
hf : s ∉ f
g : Filter ↑sᶜ := comap Subtype.val f
this : NeBot g
⊢ False

Next tactic:
simpa using H ((of g).map (↑)) (map_le_iff_le_comap.mpr (of_le g))
/-- A filter equals the intersection of all the ultrafilters which contain it. -/
theorem iSup_ultrafilter_le_eq (f : Filter α) :
    ⨆ (g : Ultrafilter α) (_ : g ≤ f), (g : Filter α) = f :=
  eq_of_forall_ge_iff fun f' => by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ : Filter α
s : Set α
a : α
f f' : Filter α
⊢ ⨆ g, ⨆ (_ : ↑g ≤ f), ↑g ≤ f' ↔ f ≤ f'

Next tactic:
simp only [iSup_le_iff, ← le_iff_ultrafilter]
/-- The `tendsto` relation can be checked on ultrafilters. -/
theorem tendsto_iff_ultrafilter (f : α → β) (l₁ : Filter α) (l₂ : Filter β) :
    Tendsto f l₁ l₂ ↔ ∀ g : Ultrafilter α, ↑g ≤ l₁ → Tendsto f g l₂ := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ : Filter α
s : Set α
a : α
f : α → β
l₁ : Filter α
l₂ : Filter β
⊢ Tendsto f l₁ l₂ ↔ ∀ (g : Ultrafilter α), ↑g ≤ l₁ → Tendsto f (↑g) l₂

Next tactic:
simpa only [tendsto_iff_comap] using le_iff_ultrafilter
theorem forall_neBot_le_iff {g : Filter α} {p : Filter α → Prop} (hp : Monotone p) :
    (∀ f : Filter α, NeBot f → f ≤ g → p f) ↔ ∀ f : Ultrafilter α, ↑f ≤ g → p f := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
g : Filter α
p : Filter α → Prop
hp : Monotone p
⊢ (∀ (f : Filter α), NeBot f → f ≤ g → p f) ↔ ∀ (f : Ultrafilter α), ↑f ≤ g → p ↑f

Next tactic:
refine' ⟨fun H f hf => H f f.neBot hf, _⟩
theorem forall_neBot_le_iff {g : Filter α} {p : Filter α → Prop} (hp : Monotone p) :
    (∀ f : Filter α, NeBot f → f ≤ g → p f) ↔ ∀ f : Ultrafilter α, ↑f ≤ g → p f := by
  refine' ⟨fun H f hf => H f f.neBot hf, _⟩
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f : Filter α
s : Set α
a : α
g : Filter α
p : Filter α → Prop
hp : Monotone p
⊢ (∀ (f : Ultrafilter α), ↑f ≤ g → p ↑f) → ∀ (f : Filter α), NeBot f → f ≤ g → p f

Next tactic:
intro H f hf hfg
theorem forall_neBot_le_iff {g : Filter α} {p : Filter α → Prop} (hp : Monotone p) :
    (∀ f : Filter α, NeBot f → f ≤ g → p f) ↔ ∀ f : Ultrafilter α, ↑f ≤ g → p f := by
  refine' ⟨fun H f hf => H f f.neBot hf, _⟩
  intro H f hf hfg
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
f✝ : Filter α
s : Set α
a : α
g : Filter α
p : Filter α → Prop
hp : Monotone p
H : ∀ (f : Ultrafilter α), ↑f ≤ g → p ↑f
f : Filter α
hf : NeBot f
hfg : f ≤ g
⊢ p f

Next tactic:
exact hp (of_le f) (H _ ((of_le f).trans hfg))
theorem ofComapInfPrincipal_mem (h : m '' s ∈ g) : s ∈ ofComapInfPrincipal h := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
⊢ s ∈ ofComapInfPrincipal h

Next tactic:
let f := Filter.comap m g ⊓ 𝓟 s
theorem ofComapInfPrincipal_mem (h : m '' s ∈ g) : s ∈ ofComapInfPrincipal h := by
  let f := Filter.comap m g ⊓ 𝓟 s
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
⊢ s ∈ ofComapInfPrincipal h

Next tactic:
haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
theorem ofComapInfPrincipal_mem (h : m '' s ∈ g) : s ∈ ofComapInfPrincipal h := by
  let f := Filter.comap m g ⊓ 𝓟 s
  haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
this : NeBot f
⊢ s ∈ ofComapInfPrincipal h

Next tactic:
have : s ∈ f := mem_inf_of_right (mem_principal_self s)
theorem ofComapInfPrincipal_mem (h : m '' s ∈ g) : s ∈ ofComapInfPrincipal h := by
  let f := Filter.comap m g ⊓ 𝓟 s
  haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
  have : s ∈ f := mem_inf_of_right (mem_principal_self s)
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
this✝ : NeBot f
this : s ∈ f
⊢ s ∈ ofComapInfPrincipal h

Next tactic:
exact le_def.mp (of_le _) s this
theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g := by
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
⊢ map m (ofComapInfPrincipal h) = g

Next tactic:
let f := Filter.comap m g ⊓ 𝓟 s
theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g := by
  let f := Filter.comap m g ⊓ 𝓟 s
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
⊢ map m (ofComapInfPrincipal h) = g

Next tactic:
haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g := by
  let f := Filter.comap m g ⊓ 𝓟 s
  haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
  

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
this : NeBot f
⊢ map m (ofComapInfPrincipal h) = g

Next tactic:
apply eq_of_le
theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g := by
  let f := Filter.comap m g ⊓ 𝓟 s
  haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
  apply eq_of_le
  

Proof state:
case h
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
this : NeBot f
⊢ ↑(map m (ofComapInfPrincipal h)) ≤ ↑g

Next tactic:
calc
    Filter.map m (of f) ≤ Filter.map m f := map_mono (of_le _)
    _ ≤ (Filter.map m <| Filter.comap m g) ⊓ Filter.map m (𝓟 s) := map_inf_le
    _ = (Filter.map m <| Filter.comap m g) ⊓ (𝓟 <| m '' s) := by rw [map_principal]
    _ ≤ ↑g ⊓ (𝓟 <| m '' s) := inf_le_inf_right _ map_comap_le
    _ = ↑g := inf_of_le_left (le_principal_iff.mpr h)
theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g := by
  let f := Filter.comap m g ⊓ 𝓟 s
  haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h
  apply eq_of_le
  calc
    Filter.map m (of f) ≤ Filter.map m f := map_mono (of_le _)
    _ ≤ (Filter.map m <| Filter.comap m g) ⊓ Filter.map m (𝓟 s) := map_inf_le
    _ = (Filter.map m <| Filter.comap m g) ⊓ (𝓟 <| m '' s) := by 

Proof state:
α : Type u
β : Type v
γ : Type u_1
m : α → β
s : Set α
g : Ultrafilter β
h : m '' s ∈ g
f : Filter α := Filter.comap m ↑g ⊓ 𝓟 s
this : NeBot f
⊢ Filter.map m (Filter.comap m ↑g) ⊓ Filter.map m (𝓟 s) = Filter.map m (Filter.comap m ↑g) ⊓ 𝓟 (m '' s)

Next tactic:
rw [map_principal]
instance (priority := 100) addMonoidHomClass [SemilinearMapClass F σ M M₃] :
    AddMonoidHomClass F M M₃ :=
  { SemilinearMapClass.toAddHomClass with
    map_zero := fun f ↦
      show f 0 = 0 by
        

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
F : Type u_17
inst✝⁹ : Semiring R
inst✝⁸ : Semiring S
inst✝⁷ : AddCommMonoid M
inst✝⁶ : AddCommMonoid M₁
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M
inst✝² : Module R M₂
inst✝¹ : Module S M₃
σ : R →+* S
inst✝ : SemilinearMapClass F σ M M₃
src✝ : AddHomClass F M M₃ := toAddHomClass
f : F
⊢ f 0 = 0

Next tactic:
rw [← zero_smul R (0 : M), map_smulₛₗ]
instance (priority := 100) addMonoidHomClass [SemilinearMapClass F σ M M₃] :
    AddMonoidHomClass F M M₃ :=
  { SemilinearMapClass.toAddHomClass with
    map_zero := fun f ↦
      show f 0 = 0 by
        rw [← zero_smul R (0 : M), map_smulₛₗ]
        

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
F : Type u_17
inst✝⁹ : Semiring R
inst✝⁸ : Semiring S
inst✝⁷ : AddCommMonoid M
inst✝⁶ : AddCommMonoid M₁
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M
inst✝² : Module R M₂
inst✝¹ : Module S M₃
σ : R →+* S
inst✝ : SemilinearMapClass F σ M M₃
src✝ : AddHomClass F M M₃ := toAddHomClass
f : F
⊢ σ 0 • f 0 = 0

Next tactic:
simp
instance (priority := 100) distribMulActionHomClass [LinearMapClass F R M M₂] :
    DistribMulActionHomClass F R M M₂ :=
  { SemilinearMapClass.addMonoidHomClass F with
    map_smul := fun f c x ↦ by 

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
F : Type u_17
inst✝⁹ : Semiring R
inst✝⁸ : Semiring S
inst✝⁷ : AddCommMonoid M
inst✝⁶ : AddCommMonoid M₁
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M
inst✝² : Module R M₂
inst✝¹ : Module S M₃
σ : R →+* S
inst✝ : LinearMapClass F R M M₂
src✝ : AddMonoidHomClass F M M₂ := addMonoidHomClass F
f : F
c : R
x : M
⊢ f (c • x) = c • f x

Next tactic:
rw [map_smulₛₗ, RingHom.id_apply]
theorem map_smul_inv {σ' : S →+* R} [RingHomInvPair σ σ'] (c : S) (x : M) :
    c • f x = f (σ' c • x) := by 

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
F : Type u_17
inst✝⁹ : Semiring R
inst✝⁸ : Semiring S
inst✝⁷ : AddCommMonoid M
inst✝⁶ : AddCommMonoid M₁
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M
inst✝² : Module R M₂
inst✝¹ : Module S M₃
σ : R →+* S
f : F
i : SemilinearMapClass F σ M M₃
σ' : S →+* R
inst✝ : RingHomInvPair σ σ'
c : S
x : M
⊢ c • f x = f (σ' c • x)

Next tactic:
simp
instance semilinearMapClass : SemilinearMapClass (M →ₛₗ[σ] M₃) σ M M₃ where
  coe f := f.toFun
  coe_injective' f g h := by
    

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
inst✝¹¹ : Semiring R
inst✝¹⁰ : Semiring S
inst✝⁹ : AddCommMonoid M
inst✝⁸ : AddCommMonoid M₁
inst✝⁷ : AddCommMonoid M₂
inst✝⁶ : AddCommMonoid M₃
inst✝⁵ : AddCommMonoid N₁
inst✝⁴ : AddCommMonoid N₂
inst✝³ : AddCommMonoid N₃
inst✝² : Module R M
inst✝¹ : Module R M₂
inst✝ : Module S M₃
σ : R →+* S
f g : M →ₛₗ[σ] M₃
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g

Next tactic:
cases f
instance semilinearMapClass : SemilinearMapClass (M →ₛₗ[σ] M₃) σ M M₃ where
  coe f := f.toFun
  coe_injective' f g h := by
    cases f
    

Proof state:
case mk
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
inst✝¹¹ : Semiring R
inst✝¹⁰ : Semiring S
inst✝⁹ : AddCommMonoid M
inst✝⁸ : AddCommMonoid M₁
inst✝⁷ : AddCommMonoid M₂
inst✝⁶ : AddCommMonoid M₃
inst✝⁵ : AddCommMonoid N₁
inst✝⁴ : AddCommMonoid N₂
inst✝³ : AddCommMonoid N₃
inst✝² : Module R M
inst✝¹ : Module R M₂
inst✝ : Module S M₃
σ : R →+* S
g : M →ₛₗ[σ] M₃
toAddHom✝ : AddHom M M₃
map_smul'✝ : ∀ (r : R) (x : M), AddHom.toFun toAddHom✝ (r • x) = σ r • AddHom.toFun toAddHom✝ x
h : (fun f => f.toFun) { toAddHom := toAddHom✝, map_smul' := map_smul'✝ } = (fun f => f.toFun) g
⊢ { toAddHom := toAddHom✝, map_smul' := map_smul'✝ } = g

Next tactic:
cases g