l3lab/ntp-mathlib huggingface dataset:
/-- Roger's fixed-point theorem: Any total, computable `f` has a fixed point: That is, under the
interpretation given by `Nat.Partrec.Code.eval`, there is a code `c` such that `c` and `f c` have
the same evaluation.
-/
theorem fixed_point {f : Code → Code} (hf : Computable f) : ∃ c : Code, eval (f c) = eval c :=
  let g (x y : ℕ) : Part ℕ := eval (ofNat Code x) x >>= fun b => eval (ofNat Code b) y
  have : Partrec₂ g :=
    (eval_part.comp ((Computable.ofNat _).comp fst) fst).bind
      (eval_part.comp ((Computable.ofNat _).comp snd) (snd.comp fst)).to₂
  let ⟨cg, eg⟩ := exists_code.1 this
  have eg' : ∀ a n, eval cg (Nat.pair a n) = Part.map encode (g a n) := by simp [eg]
  let F (x : ℕ) : Code := f (curry cg x)
  have : Computable F :=
    hf.comp (curry_prim.comp (_root_.Primrec.const cg) _root_.Primrec.id).to_comp
  let ⟨cF, eF⟩ := exists_code.1 this
  have eF' : eval cF (encode cF) = Part.some (encode (F (encode cF))) := by simp [eF]
  ⟨curry cg (encode cF),
    funext fun n =>
      show eval (f (curry cg (encode cF))) n = eval (curry cg (encode cF)) n by
        

Proof state:
f : Code → Code
hf : Computable f
g : ℕ → ℕ → Part ℕ :=
  fun x y => do
    let b ← eval (ofNat Code x) x
    eval (ofNat Code b) y
this✝ : Partrec₂ g
cg : Code
eg : eval cg = fun n => Part.bind ↑(decode n) fun a => Part.map encode ((fun p => g p.1 p.2) a)
eg' : ∀ (a n : ℕ), eval cg (Nat.pair a n) = Part.map encode (g a n)
F : ℕ → Code := fun x => f (curry cg x)
this : Computable F
cF : Code
eF : eval cF = fun n => Part.bind ↑(decode n) fun a => Part.map encode (↑F a)
eF' : eval cF (encode cF) = Part.some (encode (F (encode cF)))
n : ℕ
⊢ eval (f (curry cg (encode cF))) n = eval (curry cg (encode cF)) n

Next tactic:
simp [eg', eF', Part.map_id']
theorem fixed_point₂ {f : Code → ℕ →. ℕ} (hf : Partrec₂ f) : ∃ c : Code, eval c = f c :=
  let ⟨cf, ef⟩ := exists_code.1 hf
  (fixed_point (curry_prim.comp (_root_.Primrec.const cf) Primrec.encode).to_comp).imp fun c e =>
    funext fun n => by 

Proof state:
f : Code → ℕ →. ℕ
hf : Partrec₂ f
cf : Code
ef : eval cf = fun n => Part.bind ↑(decode n) fun a => Part.map encode ((fun p => f p.1 p.2) a)
c : Code
e : eval (curry cf (encode c)) = eval c
n : ℕ
⊢ eval c n = f c n

Next tactic:
simp [e.symm, ef, Part.map_id']
/-- If a topological group embeds into a nonarchimedean group, then it is nonarchimedean. -/
@[to_additive]
theorem nonarchimedean_of_emb (f : G →* H) (emb : OpenEmbedding f) : NonarchimedeanGroup H :=
  { is_nonarchimedean := fun U hU =>
      have h₁ : f ⁻¹' U ∈ nhds (1 : G) := by
        

Proof state:
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
f : G →* H
emb : OpenEmbedding ⇑f
U : Set H
hU : U ∈ nhds 1
⊢ ⇑f ⁻¹' U ∈ nhds 1

Next tactic:
apply emb.continuous.tendsto
/-- If a topological group embeds into a nonarchimedean group, then it is nonarchimedean. -/
@[to_additive]
theorem nonarchimedean_of_emb (f : G →* H) (emb : OpenEmbedding f) : NonarchimedeanGroup H :=
  { is_nonarchimedean := fun U hU =>
      have h₁ : f ⁻¹' U ∈ nhds (1 : G) := by
        apply emb.continuous.tendsto
        

Proof state:
case a
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
f : G →* H
emb : OpenEmbedding ⇑f
U : Set H
hU : U ∈ nhds 1
⊢ U ∈ nhds (f 1)

Next tactic:
rwa [f.map_one]
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  

Proof state:
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
hU : U ∈ nhds 1
⊢ ∃ V W, ↑V ×ˢ ↑W ⊆ U

Next tactic:
erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  

Proof state:
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
hU : ∃ t₁ ∈ nhds 1, ∃ t₂ ∈ nhds 1, t₁ ×ˢ t₂ ⊆ U
⊢ ∃ V W, ↑V ×ˢ ↑W ⊆ U

Next tactic:
rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  

Proof state:
case intro.intro.intro.intro
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
⊢ ∃ V W, ↑V ×ˢ ↑W ⊆ U

Next tactic:
cases' is_nonarchimedean _ hU₁ with V hV
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  cases' is_nonarchimedean _ hU₁ with V hV
  

Proof state:
case intro.intro.intro.intro.intro
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
V : OpenSubgroup G
hV : ↑V ⊆ U₁
⊢ ∃ V W, ↑V ×ˢ ↑W ⊆ U

Next tactic:
cases' is_nonarchimedean _ hU₂ with W hW
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  cases' is_nonarchimedean _ hU₁ with V hV
  cases' is_nonarchimedean _ hU₂ with W hW
  

Proof state:
case intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
V : OpenSubgroup G
hV : ↑V ⊆ U₁
W : OpenSubgroup K
hW : ↑W ⊆ U₂
⊢ ∃ V W, ↑V ×ˢ ↑W ⊆ U

Next tactic:
use V
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  cases' is_nonarchimedean _ hU₁ with V hV
  cases' is_nonarchimedean _ hU₂ with W hW
  use V; 

Proof state:
case h
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
V : OpenSubgroup G
hV : ↑V ⊆ U₁
W : OpenSubgroup K
hW : ↑W ⊆ U₂
⊢ ∃ W, ↑V ×ˢ ↑W ⊆ U

Next tactic:
use W
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  cases' is_nonarchimedean _ hU₁ with V hV
  cases' is_nonarchimedean _ hU₂ with W hW
  use V; use W
  

Proof state:
case h
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
V : OpenSubgroup G
hV : ↑V ⊆ U₁
W : OpenSubgroup K
hW : ↑W ⊆ U₂
⊢ ↑V ×ˢ ↑W ⊆ U

Next tactic:
rw [Set.prod_subset_iff]
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  cases' is_nonarchimedean _ hU₁ with V hV
  cases' is_nonarchimedean _ hU₂ with W hW
  use V; use W
  rw [Set.prod_subset_iff]
  

Proof state:
case h
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
V : OpenSubgroup G
hV : ↑V ⊆ U₁
W : OpenSubgroup K
hW : ↑W ⊆ U₂
⊢ ∀ x ∈ ↑V, ∀ y ∈ ↑W, (x, y) ∈ U

Next tactic:
intro x hX y hY
/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ nhds (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U := by
  erw [nhds_prod_eq, Filter.mem_prod_iff] at hU
  rcases hU with ⟨U₁, hU₁, U₂, hU₂, h⟩
  cases' is_nonarchimedean _ hU₁ with V hV
  cases' is_nonarchimedean _ hU₂ with W hW
  use V; use W
  rw [Set.prod_subset_iff]
  intro x hX y hY
  

Proof state:
case h
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × K)
U₁ : Set G
hU₁ : U₁ ∈ nhds 1
U₂ : Set K
hU₂ : U₂ ∈ nhds 1
h : U₁ ×ˢ U₂ ⊆ U
V : OpenSubgroup G
hV : ↑V ⊆ U₁
W : OpenSubgroup K
hW : ↑W ⊆ U₂
x : G
hX : x ∈ ↑V
y : K
hY : y ∈ ↑W
⊢ (x, y) ∈ U

Next tactic:
exact Set.Subset.trans (Set.prod_mono hV hW) h (Set.mem_sep hX hY)
/-- An open neighborhood of the identity in the cartesian square of a nonarchimedean group
contains the cartesian square of an open neighborhood in the group. -/
@[to_additive NonarchimedeanAddGroup.prod_self_subset "An open neighborhood of the identity in
the cartesian square of a nonarchimedean group contains the cartesian square of
an open neighborhood in the group."]
theorem prod_self_subset {U} (hU : U ∈ nhds (1 : G × G)) :
    ∃ V : OpenSubgroup G, (V : Set G) ×ˢ (V : Set G) ⊆ U :=
  let ⟨V, W, h⟩ := prod_subset hU
  ⟨V ⊓ W, by 

Proof state:
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × G)
hU : U ∈ nhds 1
V W : OpenSubgroup G
h : ↑V ×ˢ ↑W ⊆ U
⊢ ↑(V ⊓ W) ×ˢ ↑(V ⊓ W) ⊆ U

Next tactic:
refine' Set.Subset.trans (Set.prod_mono _ _) ‹_›
/-- An open neighborhood of the identity in the cartesian square of a nonarchimedean group
contains the cartesian square of an open neighborhood in the group. -/
@[to_additive NonarchimedeanAddGroup.prod_self_subset "An open neighborhood of the identity in
the cartesian square of a nonarchimedean group contains the cartesian square of
an open neighborhood in the group."]
theorem prod_self_subset {U} (hU : U ∈ nhds (1 : G × G)) :
    ∃ V : OpenSubgroup G, (V : Set G) ×ˢ (V : Set G) ⊆ U :=
  let ⟨V, W, h⟩ := prod_subset hU
  ⟨V ⊓ W, by refine' Set.Subset.trans (Set.prod_mono _ _) ‹_› <;> 

Proof state:
case refine'_1
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × G)
hU : U ∈ nhds 1
V W : OpenSubgroup G
h : ↑V ×ˢ ↑W ⊆ U
⊢ ↑(V ⊓ W) ⊆ ↑V

Next tactic:
simp
/-- An open neighborhood of the identity in the cartesian square of a nonarchimedean group
contains the cartesian square of an open neighborhood in the group. -/
@[to_additive NonarchimedeanAddGroup.prod_self_subset "An open neighborhood of the identity in
the cartesian square of a nonarchimedean group contains the cartesian square of
an open neighborhood in the group."]
theorem prod_self_subset {U} (hU : U ∈ nhds (1 : G × G)) :
    ∃ V : OpenSubgroup G, (V : Set G) ×ˢ (V : Set G) ⊆ U :=
  let ⟨V, W, h⟩ := prod_subset hU
  ⟨V ⊓ W, by refine' Set.Subset.trans (Set.prod_mono _ _) ‹_› <;> 

Proof state:
case refine'_2
G : Type u_1
inst✝⁸ : Group G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : NonarchimedeanGroup G
H : Type u_2
inst✝⁵ : Group H
inst✝⁴ : TopologicalSpace H
inst✝³ : TopologicalGroup H
K : Type u_3
inst✝² : Group K
inst✝¹ : TopologicalSpace K
inst✝ : NonarchimedeanGroup K
U : Set (G × G)
hU : U ∈ nhds 1
V W : OpenSubgroup G
h : ↑V ×ˢ ↑W ⊆ U
⊢ ↑(V ⊓ W) ⊆ ↑W

Next tactic:
simp
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U : OpenAddSubgroup R
⊢ ∃ V, ↑V * ↑V ⊆ ↑U

Next tactic:
let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by 

Proof state:
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U : OpenAddSubgroup R
⊢ 0 ∈ (fun p => p.1 * p.2) ⁻¹' ↑U

Next tactic:
simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
  

Proof state:
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U V : OpenAddSubgroup R
H : ↑V ×ˢ ↑V ⊆ (fun p => p.1 * p.2) ⁻¹' ↑U
⊢ ∃ V, ↑V * ↑V ⊆ ↑U

Next tactic:
use V
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
  use V
  

Proof state:
case h
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U V : OpenAddSubgroup R
H : ↑V ×ˢ ↑V ⊆ (fun p => p.1 * p.2) ⁻¹' ↑U
⊢ ↑V * ↑V ⊆ ↑U

Next tactic:
rintro v ⟨a, b, ha, hb, hv⟩
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
  use V
  rintro v ⟨a, b, ha, hb, hv⟩
  

Proof state:
case h.intro.intro.intro.intro
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U V : OpenAddSubgroup R
H : ↑V ×ˢ ↑V ⊆ (fun p => p.1 * p.2) ⁻¹' ↑U
v a b : R
ha : a ∈ ↑V
hb : b ∈ ↑V
hv : (fun x x_1 => x * x_1) a b = v
⊢ v ∈ ↑U

Next tactic:
have hy := H (Set.mk_mem_prod ha hb)
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
  use V
  rintro v ⟨a, b, ha, hb, hv⟩
  have hy := H (Set.mk_mem_prod ha hb)
  

Proof state:
case h.intro.intro.intro.intro
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U V : OpenAddSubgroup R
H : ↑V ×ˢ ↑V ⊆ (fun p => p.1 * p.2) ⁻¹' ↑U
v a b : R
ha : a ∈ ↑V
hb : b ∈ ↑V
hv : (fun x x_1 => x * x_1) a b = v
hy : (a, b) ∈ (fun p => p.1 * p.2) ⁻¹' ↑U
⊢ v ∈ ↑U

Next tactic:
simp only [Set.mem_preimage, SetLike.mem_coe, hv] at hy
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
  use V
  rintro v ⟨a, b, ha, hb, hv⟩
  have hy := H (Set.mk_mem_prod ha hb)
  simp only [Set.mem_preimage, SetLike.mem_coe, hv] at hy
  

Proof state:
case h.intro.intro.intro.intro
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U V : OpenAddSubgroup R
H : ↑V ×ˢ ↑V ⊆ (fun p => p.1 * p.2) ⁻¹' ↑U
v a b : R
ha : a ∈ ↑V
hb : b ∈ ↑V
hv : (fun x x_1 => x * x_1) a b = v
hy : v ∈ U
⊢ v ∈ ↑U

Next tactic:
rw [SetLike.mem_coe]
/-- An open subgroup of a nonarchimedean ring contains the square of another one. -/
theorem mul_subset (U : OpenAddSubgroup R) : ∃ V : OpenAddSubgroup R, (V : Set R) * V ⊆ U := by
  let ⟨V, H⟩ :=
    prod_self_subset
      (IsOpen.mem_nhds (IsOpen.preimage continuous_mul U.isOpen)
        (by simpa only [Set.mem_preimage, SetLike.mem_coe, Prod.snd_zero,
            mul_zero] using U.zero_mem))
  use V
  rintro v ⟨a, b, ha, hb, hv⟩
  have hy := H (Set.mk_mem_prod ha hb)
  simp only [Set.mem_preimage, SetLike.mem_coe, hv] at hy
  rw [SetLike.mem_coe]
  

Proof state:
case h.intro.intro.intro.intro
R : Type u_1
S : Type u_2
inst✝⁵ : Ring R
inst✝⁴ : TopologicalSpace R
inst✝³ : NonarchimedeanRing R
inst✝² : Ring S
inst✝¹ : TopologicalSpace S
inst✝ : NonarchimedeanRing S
U V : OpenAddSubgroup R
H : ↑V ×ˢ ↑V ⊆ (fun p => p.1 * p.2) ⁻¹' ↑U
v a b : R
ha : a ∈ ↑V
hb : b ∈ ↑V
hv : (fun x x_1 => x * x_1) a b = v
hy : v ∈ U
⊢ v ∈ U

Next tactic:
exact hy
instance (priority := 100) hasFiniteLimits_of_semilatticeInf_orderTop [SemilatticeInf α]
    [OrderTop α] : HasFiniteLimits α := ⟨by
  

Proof state:
α : Type u
J : Type w
inst✝³ : SmallCategory J
inst✝² : FinCategory J
inst✝¹ : SemilatticeInf α
inst✝ : OrderTop α
⊢ ∀ (J : Type) [𝒥 : SmallCategory J] [inst : FinCategory J], HasLimitsOfShape J α

Next tactic:
intro J 𝒥₁ 𝒥₂
instance (priority := 100) hasFiniteLimits_of_semilatticeInf_orderTop [SemilatticeInf α]
    [OrderTop α] : HasFiniteLimits α := ⟨by
  intro J 𝒥₁ 𝒥₂
  

Proof state:
α : Type u
J✝ : Type w
inst✝³ : SmallCategory J✝
inst✝² : FinCategory J✝
inst✝¹ : SemilatticeInf α
inst✝ : OrderTop α
J : Type
𝒥₁ : SmallCategory J
𝒥₂ : FinCategory J
⊢ HasLimitsOfShape J α

Next tactic:
exact { has_limit := fun F => HasLimit.mk (finiteLimitCone F) }