-- Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean
theorem hasBasis_nhds_zero : HasBasis (@nhds A hB.topology 0) (fun _ => True) fun i => B i :=
  ⟨by
    intro s
    rw [hB.toRingFilterBasis.toAddGroupFilterBasis.nhds_zero_hasBasis.mem_iff]
    constructor
    · rintro ⟨-, ⟨i, rfl⟩, hi⟩
      exact ⟨i, trivial, hi⟩
    · rintro ⟨i, -, hi⟩
      exact ⟨B i, ⟨i, rfl⟩, hi⟩⟩

Proof state:
case mpr
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ (∃ i, True ∧ ↑(B i) ⊆ s) → ∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s

Tactic:
rintro ⟨i, -, hi⟩

Result:
case mpr.intro.intro
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
i : ι
hi : ↑(B i) ⊆ s
⊢ ∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s

Proof state:
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ s ∈ 𝓝 0 ↔ ∃ i, True ∧ ↑(B i) ⊆ s

Tactic:
rw [hB.toRingFilterBasis.toAddGroupFilterBasis.nhds_zero_hasBasis.mem_iff]

Result:
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ (∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s) ↔ ∃ i, True ∧ ↑(B i) ⊆ s

Proof state:
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
⊢ ∀ (t : Set A), t ∈ 𝓝 0 ↔ ∃ i, True ∧ ↑(B i) ⊆ t

Tactic:
intro s

Result:
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ s ∈ 𝓝 0 ↔ ∃ i, True ∧ ↑(B i) ⊆ s

Proof state:
case mp
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ (∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s) → ∃ i, True ∧ ↑(B i) ⊆ s

Tactic:
rintro ⟨-, ⟨i, rfl⟩, hi⟩

Result:
case mp.intro.intro.intro
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
i : ι
hi : id ↑(B i) ⊆ s
⊢ ∃ i, True ∧ ↑(B i) ⊆ s

Proof state:
case mpr.intro.intro
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
i : ι
hi : ↑(B i) ⊆ s
⊢ ∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s

Tactic:
exact ⟨B i, ⟨i, rfl⟩, hi⟩

Result:
no goals

Proof state:
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ (∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s) ↔ ∃ i, True ∧ ↑(B i) ⊆ s

Tactic:
constructor

Result:
case mp
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ (∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s) → ∃ i, True ∧ ↑(B i) ⊆ s

case mpr
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
⊢ (∃ i, True ∧ ↑(B i) ⊆ s) → ∃ i ∈ RingFilterBasis.toAddGroupFilterBasis, id i ⊆ s

Proof state:
case mp.intro.intro.intro
A : Type u_1
ι : Type u_2
inst✝¹ : Ring A
inst✝ : Nonempty ι
B : ι → AddSubgroup A
hB : RingSubgroupsBasis B
s : Set A
i : ι
hi : id ↑(B i) ⊆ s
⊢ ∃ i, True ∧ ↑(B i) ⊆ s

Tactic:
exact ⟨i, trivial, hi⟩

Result:
no goals