l3lab/ntp-mathlib huggingface dataset:
theorem Concrete.isColimit_exists_of_rep_eq {D : Cocone F} {i j : J} (hD : IsColimit D)
    (x : F.obj i) (y : F.obj j) (h : D.ι.app _ x = D.ι.app _ y) :
    ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f x = F.map g y := by
  let E := (forget C).mapCocone D
  let hE : IsColimit E := isColimitOfPreserves _ hD
  let G := Types.colimitCocone.{v, v} (F ⋙ forget C)
  let hG := Types.colimitCoconeIsColimit.{v, v} (F ⋙ forget C)
  let T : E ≅ G := hE.uniqueUpToIso hG
  let TX : E.pt ≅ G.pt := (Cocones.forget _).mapIso T
  apply_fun TX.hom at h
  change (E.ι.app i ≫ TX.hom) x = (E.ι.app j ≫ TX.hom) y at h
  erw [T.hom.w, T.hom.w] at h
  replace h := Quot.exact _ h
  suffices
    ∀ (a b : Σj, F.obj j) (_ : EqvGen (Limits.Types.Quot.Rel.{v, v} (F ⋙ forget C)) a b),
      ∃ (k : _) (f : a.1 ⟶ k) (g : b.1 ⟶ k), F.map f a.2 = F.map g b.2
    by exact this ⟨i, x⟩ ⟨j, y⟩ h
  intro a b h
  induction h
  case rel x y hh =>
    obtain ⟨e, he⟩ := hh
    use y.1, e, 𝟙 _
    simpa using he.symm
  case refl x =>
    exact ⟨x.1, 𝟙 _, 𝟙 _, rfl⟩
  case symm x y _ hh =>
    obtain ⟨k, f, g, hh⟩ := hh
    exact ⟨k, g, f, hh.symm⟩
  case trans x y z _ _ hh1 hh2 =>
    obtain ⟨k1, f1, g1, h1⟩ := hh1
    obtain ⟨k2, f2, g2, h2⟩ := hh2
    let k0 : J := IsFiltered.max k1 k2
    let e1 : k1 ⟶ k0 := IsFiltered.leftToMax _ _
    let e2 : k2 ⟶ k0 := IsFiltered.rightToMax _ _
    

Proof state:
case intro.intro.intro.intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : ConcreteCategory C
J : Type v
inst✝² : SmallCategory J
F : J ⥤ C
inst✝¹ : PreservesColimit F (forget C)
inst✝ : IsFiltered J
D : Cocone F
i j : J
hD : IsColimit D
x✝ : (forget C).obj (F.obj i)
y✝ : (forget C).obj (F.obj j)
E : Cocone (F ⋙ forget C) := (forget C).mapCocone D
hE : IsColimit E := isColimitOfPreserves (forget C) hD
G : Cocone (F ⋙ forget C) := Types.colimitCocone (F ⋙ forget C)
hG : IsColimit (Types.colimitCocone (F ⋙ forget C)) := Types.colimitCoconeIsColimit (F ⋙ forget C)
T : E ≅ G := IsColimit.uniqueUpToIso hE hG
TX : E.pt ≅ G.pt := (Cocones.forget (F ⋙ forget C)).mapIso T
h : EqvGen (Types.Quot.Rel (F ⋙ forget C)) { fst := i, snd := x✝ } { fst := j, snd := y✝ }
a b x y z : (j : J) × (forget C).obj (F.obj j)
a✝¹ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) x y
a✝ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) y z
k1 : J
f1 : x.fst ⟶ k1
g1 : y.fst ⟶ k1
h1 : (F.map f1) x.snd = (F.map g1) y.snd
k2 : J
f2 : y.fst ⟶ k2
g2 : z.fst ⟶ k2
h2 : (F.map f2) y.snd = (F.map g2) z.snd
k0 : J := IsFiltered.max k1 k2
e1 : k1 ⟶ k0 := IsFiltered.leftToMax k1 k2
e2 : k2 ⟶ k0 := IsFiltered.rightToMax k1 k2
⊢ ∃ k f g, (F.map f) x.snd = (F.map g) z.snd

Next tactic:
let k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
theorem Concrete.isColimit_exists_of_rep_eq {D : Cocone F} {i j : J} (hD : IsColimit D)
    (x : F.obj i) (y : F.obj j) (h : D.ι.app _ x = D.ι.app _ y) :
    ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f x = F.map g y := by
  let E := (forget C).mapCocone D
  let hE : IsColimit E := isColimitOfPreserves _ hD
  let G := Types.colimitCocone.{v, v} (F ⋙ forget C)
  let hG := Types.colimitCoconeIsColimit.{v, v} (F ⋙ forget C)
  let T : E ≅ G := hE.uniqueUpToIso hG
  let TX : E.pt ≅ G.pt := (Cocones.forget _).mapIso T
  apply_fun TX.hom at h
  change (E.ι.app i ≫ TX.hom) x = (E.ι.app j ≫ TX.hom) y at h
  erw [T.hom.w, T.hom.w] at h
  replace h := Quot.exact _ h
  suffices
    ∀ (a b : Σj, F.obj j) (_ : EqvGen (Limits.Types.Quot.Rel.{v, v} (F ⋙ forget C)) a b),
      ∃ (k : _) (f : a.1 ⟶ k) (g : b.1 ⟶ k), F.map f a.2 = F.map g b.2
    by exact this ⟨i, x⟩ ⟨j, y⟩ h
  intro a b h
  induction h
  case rel x y hh =>
    obtain ⟨e, he⟩ := hh
    use y.1, e, 𝟙 _
    simpa using he.symm
  case refl x =>
    exact ⟨x.1, 𝟙 _, 𝟙 _, rfl⟩
  case symm x y _ hh =>
    obtain ⟨k, f, g, hh⟩ := hh
    exact ⟨k, g, f, hh.symm⟩
  case trans x y z _ _ hh1 hh2 =>
    obtain ⟨k1, f1, g1, h1⟩ := hh1
    obtain ⟨k2, f2, g2, h2⟩ := hh2
    let k0 : J := IsFiltered.max k1 k2
    let e1 : k1 ⟶ k0 := IsFiltered.leftToMax _ _
    let e2 : k2 ⟶ k0 := IsFiltered.rightToMax _ _
    let k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
    

Proof state:
case intro.intro.intro.intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : ConcreteCategory C
J : Type v
inst✝² : SmallCategory J
F : J ⥤ C
inst✝¹ : PreservesColimit F (forget C)
inst✝ : IsFiltered J
D : Cocone F
i j : J
hD : IsColimit D
x✝ : (forget C).obj (F.obj i)
y✝ : (forget C).obj (F.obj j)
E : Cocone (F ⋙ forget C) := (forget C).mapCocone D
hE : IsColimit E := isColimitOfPreserves (forget C) hD
G : Cocone (F ⋙ forget C) := Types.colimitCocone (F ⋙ forget C)
hG : IsColimit (Types.colimitCocone (F ⋙ forget C)) := Types.colimitCoconeIsColimit (F ⋙ forget C)
T : E ≅ G := IsColimit.uniqueUpToIso hE hG
TX : E.pt ≅ G.pt := (Cocones.forget (F ⋙ forget C)).mapIso T
h : EqvGen (Types.Quot.Rel (F ⋙ forget C)) { fst := i, snd := x✝ } { fst := j, snd := y✝ }
a b x y z : (j : J) × (forget C).obj (F.obj j)
a✝¹ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) x y
a✝ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) y z
k1 : J
f1 : x.fst ⟶ k1
g1 : y.fst ⟶ k1
h1 : (F.map f1) x.snd = (F.map g1) y.snd
k2 : J
f2 : y.fst ⟶ k2
g2 : z.fst ⟶ k2
h2 : (F.map f2) y.snd = (F.map g2) z.snd
k0 : J := IsFiltered.max k1 k2
e1 : k1 ⟶ k0 := IsFiltered.leftToMax k1 k2
e2 : k2 ⟶ k0 := IsFiltered.rightToMax k1 k2
k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
⊢ ∃ k f g, (F.map f) x.snd = (F.map g) z.snd

Next tactic:
let e : k0 ⟶ k := IsFiltered.coeqHom _ _
theorem Concrete.isColimit_exists_of_rep_eq {D : Cocone F} {i j : J} (hD : IsColimit D)
    (x : F.obj i) (y : F.obj j) (h : D.ι.app _ x = D.ι.app _ y) :
    ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f x = F.map g y := by
  let E := (forget C).mapCocone D
  let hE : IsColimit E := isColimitOfPreserves _ hD
  let G := Types.colimitCocone.{v, v} (F ⋙ forget C)
  let hG := Types.colimitCoconeIsColimit.{v, v} (F ⋙ forget C)
  let T : E ≅ G := hE.uniqueUpToIso hG
  let TX : E.pt ≅ G.pt := (Cocones.forget _).mapIso T
  apply_fun TX.hom at h
  change (E.ι.app i ≫ TX.hom) x = (E.ι.app j ≫ TX.hom) y at h
  erw [T.hom.w, T.hom.w] at h
  replace h := Quot.exact _ h
  suffices
    ∀ (a b : Σj, F.obj j) (_ : EqvGen (Limits.Types.Quot.Rel.{v, v} (F ⋙ forget C)) a b),
      ∃ (k : _) (f : a.1 ⟶ k) (g : b.1 ⟶ k), F.map f a.2 = F.map g b.2
    by exact this ⟨i, x⟩ ⟨j, y⟩ h
  intro a b h
  induction h
  case rel x y hh =>
    obtain ⟨e, he⟩ := hh
    use y.1, e, 𝟙 _
    simpa using he.symm
  case refl x =>
    exact ⟨x.1, 𝟙 _, 𝟙 _, rfl⟩
  case symm x y _ hh =>
    obtain ⟨k, f, g, hh⟩ := hh
    exact ⟨k, g, f, hh.symm⟩
  case trans x y z _ _ hh1 hh2 =>
    obtain ⟨k1, f1, g1, h1⟩ := hh1
    obtain ⟨k2, f2, g2, h2⟩ := hh2
    let k0 : J := IsFiltered.max k1 k2
    let e1 : k1 ⟶ k0 := IsFiltered.leftToMax _ _
    let e2 : k2 ⟶ k0 := IsFiltered.rightToMax _ _
    let k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
    let e : k0 ⟶ k := IsFiltered.coeqHom _ _
    

Proof state:
case intro.intro.intro.intro.intro.intro
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : ConcreteCategory C
J : Type v
inst✝² : SmallCategory J
F : J ⥤ C
inst✝¹ : PreservesColimit F (forget C)
inst✝ : IsFiltered J
D : Cocone F
i j : J
hD : IsColimit D
x✝ : (forget C).obj (F.obj i)
y✝ : (forget C).obj (F.obj j)
E : Cocone (F ⋙ forget C) := (forget C).mapCocone D
hE : IsColimit E := isColimitOfPreserves (forget C) hD
G : Cocone (F ⋙ forget C) := Types.colimitCocone (F ⋙ forget C)
hG : IsColimit (Types.colimitCocone (F ⋙ forget C)) := Types.colimitCoconeIsColimit (F ⋙ forget C)
T : E ≅ G := IsColimit.uniqueUpToIso hE hG
TX : E.pt ≅ G.pt := (Cocones.forget (F ⋙ forget C)).mapIso T
h : EqvGen (Types.Quot.Rel (F ⋙ forget C)) { fst := i, snd := x✝ } { fst := j, snd := y✝ }
a b x y z : (j : J) × (forget C).obj (F.obj j)
a✝¹ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) x y
a✝ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) y z
k1 : J
f1 : x.fst ⟶ k1
g1 : y.fst ⟶ k1
h1 : (F.map f1) x.snd = (F.map g1) y.snd
k2 : J
f2 : y.fst ⟶ k2
g2 : z.fst ⟶ k2
h2 : (F.map f2) y.snd = (F.map g2) z.snd
k0 : J := IsFiltered.max k1 k2
e1 : k1 ⟶ k0 := IsFiltered.leftToMax k1 k2
e2 : k2 ⟶ k0 := IsFiltered.rightToMax k1 k2
k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
e : k0 ⟶ k := IsFiltered.coeqHom (g1 ≫ e1) (f2 ≫ e2)
⊢ ∃ k f g, (F.map f) x.snd = (F.map g) z.snd

Next tactic:
use k, f1 ≫ e1 ≫ e, g2 ≫ e2 ≫ e
theorem Concrete.isColimit_exists_of_rep_eq {D : Cocone F} {i j : J} (hD : IsColimit D)
    (x : F.obj i) (y : F.obj j) (h : D.ι.app _ x = D.ι.app _ y) :
    ∃ (k : _) (f : i ⟶ k) (g : j ⟶ k), F.map f x = F.map g y := by
  let E := (forget C).mapCocone D
  let hE : IsColimit E := isColimitOfPreserves _ hD
  let G := Types.colimitCocone.{v, v} (F ⋙ forget C)
  let hG := Types.colimitCoconeIsColimit.{v, v} (F ⋙ forget C)
  let T : E ≅ G := hE.uniqueUpToIso hG
  let TX : E.pt ≅ G.pt := (Cocones.forget _).mapIso T
  apply_fun TX.hom at h
  change (E.ι.app i ≫ TX.hom) x = (E.ι.app j ≫ TX.hom) y at h
  erw [T.hom.w, T.hom.w] at h
  replace h := Quot.exact _ h
  suffices
    ∀ (a b : Σj, F.obj j) (_ : EqvGen (Limits.Types.Quot.Rel.{v, v} (F ⋙ forget C)) a b),
      ∃ (k : _) (f : a.1 ⟶ k) (g : b.1 ⟶ k), F.map f a.2 = F.map g b.2
    by exact this ⟨i, x⟩ ⟨j, y⟩ h
  intro a b h
  induction h
  case rel x y hh =>
    obtain ⟨e, he⟩ := hh
    use y.1, e, 𝟙 _
    simpa using he.symm
  case refl x =>
    exact ⟨x.1, 𝟙 _, 𝟙 _, rfl⟩
  case symm x y _ hh =>
    obtain ⟨k, f, g, hh⟩ := hh
    exact ⟨k, g, f, hh.symm⟩
  case trans x y z _ _ hh1 hh2 =>
    obtain ⟨k1, f1, g1, h1⟩ := hh1
    obtain ⟨k2, f2, g2, h2⟩ := hh2
    let k0 : J := IsFiltered.max k1 k2
    let e1 : k1 ⟶ k0 := IsFiltered.leftToMax _ _
    let e2 : k2 ⟶ k0 := IsFiltered.rightToMax _ _
    let k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
    let e : k0 ⟶ k := IsFiltered.coeqHom _ _
    use k, f1 ≫ e1 ≫ e, g2 ≫ e2 ≫ e
    

Proof state:
case h
C : Type u
inst✝⁴ : Category.{v, u} C
inst✝³ : ConcreteCategory C
J : Type v
inst✝² : SmallCategory J
F : J ⥤ C
inst✝¹ : PreservesColimit F (forget C)
inst✝ : IsFiltered J
D : Cocone F
i j : J
hD : IsColimit D
x✝ : (forget C).obj (F.obj i)
y✝ : (forget C).obj (F.obj j)
E : Cocone (F ⋙ forget C) := (forget C).mapCocone D
hE : IsColimit E := isColimitOfPreserves (forget C) hD
G : Cocone (F ⋙ forget C) := Types.colimitCocone (F ⋙ forget C)
hG : IsColimit (Types.colimitCocone (F ⋙ forget C)) := Types.colimitCoconeIsColimit (F ⋙ forget C)
T : E ≅ G := IsColimit.uniqueUpToIso hE hG
TX : E.pt ≅ G.pt := (Cocones.forget (F ⋙ forget C)).mapIso T
h : EqvGen (Types.Quot.Rel (F ⋙ forget C)) { fst := i, snd := x✝ } { fst := j, snd := y✝ }
a b x y z : (j : J) × (forget C).obj (F.obj j)
a✝¹ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) x y
a✝ : EqvGen (Types.Quot.Rel (F ⋙ forget C)) y z
k1 : J
f1 : x.fst ⟶ k1
g1 : y.fst ⟶ k1
h1 : (F.map f1) x.snd = (F.map g1) y.snd
k2 : J
f2 : y.fst ⟶ k2
g2 : z.fst ⟶ k2
h2 : (F.map f2) y.snd = (F.map g2) z.snd
k0 : J := IsFiltered.max k1 k2
e1 : k1 ⟶ k0 := IsFiltered.leftToMax k1 k2
e2 : k2 ⟶ k0 := IsFiltered.rightToMax k1 k2
k : J := IsFiltered.coeq (g1 ≫ e1) (f2 ≫ e2)
e : k0 ⟶ k := IsFiltered.coeqHom (g1 ≫ e1) (f2 ≫ e2)
⊢ (F.map (f1 ≫ e1 ≫ e)) x.snd = (F.map (g2 ≫ e2 ≫ e)) z.snd

Next tactic:
simp only [F.map_comp, comp_apply, h1, ← h2]
theorem toSeminorm_ball_zero {f : E →ₗ[𝕜] 𝕜} {r : ℝ} :
    Seminorm.ball f.toSeminorm 0 r = { x : E | ‖f x‖ < r } := by
  

Proof state:
𝕜 : 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
f : E →ₗ[𝕜] 𝕜
r : ℝ
⊢ Seminorm.ball (toSeminorm f) 0 r = {x | ‖f x‖ < r}

Next tactic:
simp only [Seminorm.ball_zero_eq, toSeminorm_apply]
theorem toSeminorm_comp (f : F →ₗ[𝕜] 𝕜) (g : E →ₗ[𝕜] F) :
    f.toSeminorm.comp g = (f.comp g).toSeminorm := by
  

Proof state:
𝕜 : 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
f : F →ₗ[𝕜] 𝕜
g : E →ₗ[𝕜] F
⊢ Seminorm.comp (toSeminorm f) g = toSeminorm (f ∘ₗ g)

Next tactic:
ext
theorem toSeminorm_comp (f : F →ₗ[𝕜] 𝕜) (g : E →ₗ[𝕜] F) :
    f.toSeminorm.comp g = (f.comp g).toSeminorm := by
  ext
  

Proof state:
case h
𝕜 : 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
f : F →ₗ[𝕜] 𝕜
g : E →ₗ[𝕜] F
x✝ : E
⊢ (Seminorm.comp (toSeminorm f) g) x✝ = (toSeminorm (f ∘ₗ g)) x✝

Next tactic:
simp only [Seminorm.comp_apply, toSeminorm_apply, coe_comp, Function.comp_apply]
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  

Proof state:
𝕜 : 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 →ₗ[𝕜] 𝕜
⊢ Filter.HasBasis (𝓝 0) (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
let p := B.toSeminormFamily
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  

Proof state:
𝕜 : 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
⊢ Filter.HasBasis (𝓝 0) (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
rw [nhds_induced, nhds_pi]
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]
  

Proof state:
𝕜 : 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
⊢ Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun i => 𝓝 ((B 0) i)))
    (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
simp only [map_zero, LinearMap.zero_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]
  

Proof state:
𝕜 : 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
⊢ Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun i => 𝓝 0))
    (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
have h := @Metric.nhds_basis_ball 𝕜 _ 0
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
  

Proof state:
𝕜 : 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)
⊢ Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun i => 𝓝 0))
    (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
have h' := Filter.hasBasis_pi fun _ : F => h
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
  

Proof state:
𝕜 : 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)
⊢ Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun i => 𝓝 0))
    (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
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'
  

Proof state:
𝕜 : 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)
⊢ Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun i => 𝓝 0))
    (SeminormFamily.basisSets (toSeminormFamily B)) _root_.id

Next tactic:
refine' h''.to_hasBasis _ _
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 _ _
  · 

Proof state:
case refine'_1
𝕜 : 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)
⊢ ∀ (i : Set F × (F → ℝ)),
    (Set.Finite i.1 ∧ ∀ i_1 ∈ i.1, 0 < i.2 i_1) →
      ∃ i',
        SeminormFamily.basisSets (toSeminormFamily B) i' ∧
          _root_.id i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)

Next tactic:
rintro (U : Set F × (F → ℝ)) 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
    

Proof state:
case refine'_1
𝕜 : 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 ∧ ∀ i ∈ U.1, 0 < U.2 i
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      _root_.id i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi U.1 fun i => Metric.ball 0 (U.2 i)

Next tactic:
cases' hU with hU₁ 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₂
    

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
⊢ ∃ i',
    SeminormFamily.basisSets (toSeminormFamily B) i' ∧
      _root_.id i' ⊆ (fun x y => (B x) y) ⁻¹' Set.pi U.1 fun i => Metric.ball 0 (U.2 i)

Next tactic:
simp only [id.def]
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]
    

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
⊢ ∃ 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:
let U' := hU₁.toFinset