l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
theorem nhds_one_eq (B : GroupFilterBasis G) :
    @nhds G B.topology (1 : G) = B.toFilterBasis.filter := by
  rw [B.nhds_eq]
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
⊢ N B 1 = FilterBasis.filter toFilterBasis

Next tactic:
simp only [N, one_mul]
@[to_additive]
theorem nhds_one_eq (B : GroupFilterBasis G) :
    @nhds G B.topology (1 : G) = B.toFilterBasis.filter := by
  rw [B.nhds_eq]
  simp only [N, one_mul]
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
⊢ map (fun y => y) (FilterBasis.filter toFilterBasis) = FilterBasis.filter toFilterBasis

Next tactic:
exact map_id
@[to_additive]
theorem nhds_hasBasis (B : GroupFilterBasis G) (x₀ : G) :
    HasBasis (@nhds G B.topology x₀) (fun V : Set G ↦ V ∈ B) fun V ↦ (fun y ↦ x₀ * y) '' V := by
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
x₀ : G
⊢ HasBasis (𝓝 x₀) (fun V => V ∈ B) fun V => (fun y => x₀ * y) '' V

Next tactic:
rw [B.nhds_eq]
@[to_additive]
theorem nhds_hasBasis (B : GroupFilterBasis G) (x₀ : G) :
    HasBasis (@nhds G B.topology x₀) (fun V : Set G ↦ V ∈ B) fun V ↦ (fun y ↦ x₀ * y) '' V := by
  rw [B.nhds_eq]
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
x₀ : G
⊢ HasBasis (N B x₀) (fun V => V ∈ B) fun V => (fun y => x₀ * y) '' V

Next tactic:
apply B.hasBasis
@[to_additive]
theorem nhds_one_hasBasis (B : GroupFilterBasis G) :
    HasBasis (@nhds G B.topology 1) (fun V : Set G ↦ V ∈ B) id := by
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
⊢ HasBasis (𝓝 1) (fun V => V ∈ B) id

Next tactic:
rw [B.nhds_one_eq]
@[to_additive]
theorem nhds_one_hasBasis (B : GroupFilterBasis G) :
    HasBasis (@nhds G B.topology 1) (fun V : Set G ↦ V ∈ B) id := by
  rw [B.nhds_one_eq]
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
⊢ HasBasis (FilterBasis.filter toFilterBasis) (fun V => V ∈ B) id

Next tactic:
exact B.toFilterBasis.hasBasis
@[to_additive]
theorem mem_nhds_one (B : GroupFilterBasis G) {U : Set G} (hU : U ∈ B) :
    U ∈ @nhds G B.topology 1 := by
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
U : Set G
hU : U ∈ B
⊢ U ∈ 𝓝 1

Next tactic:
rw [B.nhds_one_hasBasis.mem_iff]
@[to_additive]
theorem mem_nhds_one (B : GroupFilterBasis G) {U : Set G} (hU : U ∈ B) :
    U ∈ @nhds G B.topology 1 := by
  rw [B.nhds_one_hasBasis.mem_iff]
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
U : Set G
hU : U ∈ B
⊢ ∃ i ∈ B, id i ⊆ U

Next tactic:
exact ⟨U, hU, rfl.subset⟩
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
⊢ TopologicalGroup G

Next tactic:
letI := B.topology
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
⊢ TopologicalGroup G

Next tactic:
have basis := B.nhds_one_hasBasis
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
⊢ TopologicalGroup G

Next tactic:
have basis' := basis.prod basis
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ TopologicalGroup G

Next tactic:
refine' TopologicalGroup.of_nhds_one _ _ _ _
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · 

Proof state:
case refine'_1
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)

Next tactic:
rw [basis'.tendsto_iff basis]
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    

Proof state:
case refine'_1
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ ∀ ib ∈ B, ∃ ia, (ia.1 ∈ B ∧ ia.2 ∈ B) ∧ ∀ x ∈ id ia.1 ×ˢ id ia.2, uncurry (fun x x_1 => x * x_1) x ∈ id ib

Next tactic:
suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by 

Proof state:
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this✝ : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
this : ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ (a b : G), a ∈ V → b ∈ W → a * b ∈ U
⊢ ∀ ib ∈ B, ∃ ia, (ia.1 ∈ B ∧ ia.2 ∈ B) ∧ ∀ x ∈ id ia.1 ×ˢ id ia.2, uncurry (fun x x_1 => x * x_1) x ∈ id ib

Next tactic:
simpa
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    

Proof state:
case refine'_1
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ (a b : G), a ∈ V → b ∈ W → a * b ∈ U

Next tactic:
intro U U_in
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    

Proof state:
case refine'_1
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
U : Set G
U_in : U ∈ B
⊢ ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ (a b : G), a ∈ V → b ∈ W → a * b ∈ U

Next tactic:
rcases mul U_in with ⟨V, V_in, hV⟩
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    

Proof state:
case refine'_1.intro.intro
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
U : Set G
U_in : U ∈ B
V : Set G
V_in : V ∈ B
hV : V * V ⊆ U
⊢ ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ (a b : G), a ∈ V → b ∈ W → a * b ∈ U

Next tactic:
refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    

Proof state:
case refine'_1.intro.intro
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
U : Set G
U_in : U ∈ B
V : Set G
V_in : V ∈ B
hV : V * V ⊆ U
⊢ ∀ (a b : G), a ∈ V → b ∈ V → a * b ∈ U

Next tactic:
intro a b a_in b_in
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    

Proof state:
case refine'_1.intro.intro
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
U : Set G
U_in : U ∈ B
V : Set G
V_in : V ∈ B
hV : V * V ⊆ U
a b : G
a_in : a ∈ V
b_in : b ∈ V
⊢ a * b ∈ U

Next tactic:
exact hV ⟨a, b, a_in, b_in, rfl⟩
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · 

Proof state:
case refine'_2
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ Tendsto (fun x => x⁻¹) (𝓝 1) (𝓝 1)

Next tactic:
rw [basis.tendsto_iff basis]
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    

Proof state:
case refine'_2
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ ∀ ib ∈ B, ∃ ia ∈ B, ∀ x ∈ id ia, x⁻¹ ∈ id ib

Next tactic:
intro U U_in
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    

Proof state:
case refine'_2
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
U : Set G
U_in : U ∈ B
⊢ ∃ ia ∈ B, ∀ x ∈ id ia, x⁻¹ ∈ id U

Next tactic:
simpa using inv U_in
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    simpa using inv U_in
  · 

Proof state:
case refine'_3
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ ∀ (x₀ : G), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)

Next tactic:
intro x₀
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    simpa using inv U_in
  · intro x₀
    

Proof state:
case refine'_3
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
x₀ : G
⊢ 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)

Next tactic:
rw [nhds_eq, nhds_one_eq]
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    simpa using inv U_in
  · intro x₀
    rw [nhds_eq, nhds_one_eq]
    

Proof state:
case refine'_3
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
x₀ : G
⊢ N B x₀ = map (fun x => x₀ * x) (FilterBasis.filter toFilterBasis)

Next tactic:
rfl
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    simpa using inv U_in
  · intro x₀
    rw [nhds_eq, nhds_one_eq]
    rfl
  · 

Proof state:
case refine'_4
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
⊢ ∀ (x₀ : G), Tendsto (fun x => x₀ * x * x₀⁻¹) (𝓝 1) (𝓝 1)

Next tactic:
intro x₀
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    simpa using inv U_in
  · intro x₀
    rw [nhds_eq, nhds_one_eq]
    rfl
  · intro x₀
    

Proof state:
case refine'_4
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
x₀ : G
⊢ Tendsto (fun x => x₀ * x * x₀⁻¹) (𝓝 1) (𝓝 1)

Next tactic:
rw [basis.tendsto_iff basis]
/-- If a group is endowed with a topological structure coming from a group filter basis then it's a
topological group. -/
@[to_additive "If a group is endowed with a topological structure coming from a group filter basis
then it's a topological group."]
instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) :
    @TopologicalGroup G B.topology _ := by
  letI := B.topology
  have basis := B.nhds_one_hasBasis
  have basis' := basis.prod basis
  refine' TopologicalGroup.of_nhds_one _ _ _ _
  · rw [basis'.tendsto_iff basis]
    suffices ∀ U ∈ B, ∃ V W, (V ∈ B ∧ W ∈ B) ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa
    intro U U_in
    rcases mul U_in with ⟨V, V_in, hV⟩
    refine' ⟨V, V, ⟨V_in, V_in⟩, _⟩
    intro a b a_in b_in
    exact hV ⟨a, b, a_in, b_in, rfl⟩
  · rw [basis.tendsto_iff basis]
    intro U U_in
    simpa using inv U_in
  · intro x₀
    rw [nhds_eq, nhds_one_eq]
    rfl
  · intro x₀
    rw [basis.tendsto_iff basis]
    

Proof state:
case refine'_4
G : Type u
inst✝ : Group G
B✝ B : GroupFilterBasis G
this : TopologicalSpace G := topology B
basis : HasBasis (𝓝 1) (fun V => V ∈ B) id
basis' : HasBasis (𝓝 1 ×ˢ 𝓝 1) (fun i => i.1 ∈ B ∧ i.2 ∈ B) fun i => id i.1 ×ˢ id i.2
x₀ : G
⊢ ∀ ib ∈ B, ∃ ia ∈ B, ∀ x ∈ id ia, x₀ * x * x₀⁻¹ ∈ id ib

Next tactic:
intro U U_in