l3lab/ntp-mathlib huggingface dataset:
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    

Proof state:
case refine'_1.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi U.1 fun i => Metric.ball 0 (U.2 i)

Next tactic:
by_cases hU₃ : U.fst.Nonempty
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · 

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi U.1 fun i => Metric.ball 0 (U.2 i)

Next tactic:
have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi U.1 fun i => Metric.ball 0 (U.2 i)

Next tactic:
refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : x ∈ Seminorm.ball (Finset.sup U' p) 0 (Finset.inf' U' hU₃' U.2)
y : F
hy : y ∈ U.1
⊢ (fun x y => (B x) y) x y ∈ (fun i => Metric.ball 0 (U.2 i)) y

Next tactic:
simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : x ∈ Seminorm.ball (Finset.sup U' p) 0 (Finset.inf' U' hU₃' U.2)
y : F
hy : y ∈ U.1
⊢ ‖(B x) y‖ < U.2 y

Next tactic:
rw [Seminorm.mem_ball_zero] at hx
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : (Finset.sup U' p) x < Finset.inf' U' hU₃' U.2
y : F
hy : y ∈ U.1
⊢ ‖(B x) y‖ < U.2 y

Next tactic:
rw [← LinearMap.toSeminormFamily_apply]
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : (Finset.sup U' p) x < Finset.inf' U' hU₃' U.2
y : F
hy : y ∈ U.1
⊢ (toSeminormFamily B y) x < U.2 y

Next tactic:
have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : (Finset.sup U' p) x < Finset.inf' U' hU₃' U.2
y : F
hy : y ∈ U.1
hyU' : y ∈ U'
⊢ (toSeminormFamily B y) x < U.2 y

Next tactic:
have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : (Finset.sup U' p) x < Finset.inf' U' hU₃' U.2
y : F
hy : y ∈ U.1
hyU' : y ∈ U'
hp : p y ≤ Finset.sup U' p
⊢ (toSeminormFamily B y) x < U.2 y

Next tactic:
refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
      

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : Set.Nonempty U.1
hU₃' : Finset.Nonempty U'
x : E
hx : (Finset.sup U' p) x < Finset.inf' U' hU₃' U.2
y : F
hy : y ∈ U.1
hyU' : y ∈ U'
hp : p y ≤ Finset.sup U' p
⊢ Finset.inf' U' hU₃' U.2 ≤ U.2 y

Next tactic:
exact Finset.inf'_le _ hyU'
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
      exact Finset.inf'_le _ hyU'
    

Proof state:
case neg
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : ¬Set.Nonempty U.1
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi U.1 fun i => Metric.ball 0 (U.2 i)

Next tactic:
rw [Set.not_nonempty_iff_eq_empty.mp hU₃]
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
      exact Finset.inf'_le _ hyU'
    rw [Set.not_nonempty_iff_eq_empty.mp hU₃]
    

Proof state:
case neg
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set F × (F → ℝ)
hU₁ : Set.Finite U.1
hU₂ : ∀ i ∈ U.1, 0 < U.2 i
U' : Finset F := Set.Finite.toFinset hU₁
hU₃ : ¬Set.Nonempty U.1
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi ∅ fun i => Metric.ball 0 (U.2 i)

Next tactic:
simp only [Set.empty_pi, Set.preimage_univ, Set.subset_univ, and_true_iff]