[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.Group.GroupTopology).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem toTopologicalSpace_le {x y : GroupTopology α} :
    x.toTopologicalSpace ≤ y.toTopologicalSpace ↔ x ≤ y
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.continuous_mul' (L50-L57)
theorem continuous_mul' (g : GroupTopology α) :
    haveI := g.toTopologicalSpace
Continuous fun p : α × α => p.1 * p.2 := by
  letI := g.toTopologicalSpace
  haveI := g.toIsTopologicalGroup
  exact continuous_mul

/-- A version of the global `continuous_inv` suitable for dot notation. -/
```

-- snippet 2
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.continuous_inv' (L59-L65)
theorem continuous_inv' (g : GroupTopology α) :
    haveI := g.toTopologicalSpace
Continuous (Inv.inv : α → α) := by
  letI := g.toTopologicalSpace
  haveI := g.toIsTopologicalGroup
  exact continuous_inv
```

-- snippet 3
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_injective (L67-L73)
theorem toTopologicalSpace_injective :
    Function.Injective (toTopologicalSpace : GroupTopology α → TopologicalSpace α) :=
fun f g h => by
    cases f
    cases g
    congr
```

-- snippet 4
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.ext' (L75-L79)
theorem ext' {f g : GroupTopology α} (h : f.IsOpen = g.IsOpen) : f = g :=
toTopologicalSpace_injective <| TopologicalSpace.ext h

/-- The ordering on group topologies on the group `γ`. `t ≤ s` if every set open in `s` is also open
in `t` (`t` is finer than `s`). -/
```

-- snippet 5
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_top (L98-L100)
theorem toTopologicalSpace_top : (⊤ : GroupTopology α).toTopologicalSpace = ⊤ :=
rfl
```

-- snippet 6
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_bot (L110-L113)
theorem toTopologicalSpace_bot : (⊥ : GroupTopology α).toTopologicalSpace = ⊥ :=
rfl

set_option backward.isDefEq.respectTransparency false in
```

-- snippet 7
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_inf (L123-L126)
theorem toTopologicalSpace_inf (x y : GroupTopology α) :
    (x ⊓ y).toTopologicalSpace = x.toTopologicalSpace ⊓ y.toTopologicalSpace :=
rfl
```

-- snippet 8
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_sInf (L142-L144)
theorem toTopologicalSpace_sInf (s : Set (GroupTopology α)) :
    (sInf s).toTopologicalSpace = sInf (toTopologicalSpace '' s) := rfl
```

-- snippet 9
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_iInf (L146-L157)
theorem toTopologicalSpace_iInf {ι} (s : ι → GroupTopology α) :
    (⨅ i, s i).toTopologicalSpace = ⨅ i, (s i).toTopologicalSpace :=
congr_arg sInf (range_comp _ _).symm

/-- Group topologies on `γ` form a complete lattice, with `⊥` the discrete topology and `⊤` the
indiscrete topology.

The infimum of a collection of group topologies is the topology generated by all their open sets
(which is a group topology).

The supremum of two group topologies `s` and `t` is the infimum of the family of all group
topologies contained in the intersection of `s` and `t`. -/
```

-- snippet 10
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.coinduced (L184-L187)
def coinduced {α β : Type*} [t : TopologicalSpace α] [Group β] (f : α → β) : GroupTopology β :=
sInf { b : GroupTopology β | TopologicalSpace.coinduced f t ≤ b.toTopologicalSpace }

set_option backward.isDefEq.respectTransparency false in
```

-- snippet 11
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.coinduced_continuous (L189-L195)
theorem coinduced_continuous {α β : Type*} [t : TopologicalSpace α] [Group β] (f : α → β) :
    Continuous[t, (coinduced f).toTopologicalSpace] f := by
rw [continuous_sInf_rng]
  rintro _ ⟨t', ht', rfl⟩
  exact continuous_iff_coinduced_le.2 ht'

end GroupTopology
```

-- snippet 12
```lean
-- Mathlib.Topology.Algebra.Affine.continuous_linear_iff (L35-L45)
theorem continuous_linear_iff {f : P →ᵃ[R] Q} : Continuous f.linear ↔ Continuous f := by
inhabit P
  have :
    (f.linear : V → W) =
      (Homeomorph.vaddConst <| f default).symm ∘ f ∘ (Homeomorph.vaddConst default) := by
    ext v
    simp
  rw [this]
  simp only [Homeomorph.comp_continuous_iff, Homeomorph.comp_continuous_iff']

/-- If `f` is an affine map, then its linear part is an open map iff `f` is an open map. -/
```

-- snippet 13
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_coe (L104-L105)
theorem coe_coe (e : A ≃A[R] B) : ⇑(e : A →A[R] B) = e := rfl
```

-- snippet 14
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.surjective (L348-L353)
theorem surjective (e : A ≃A[R] B) : Function.Surjective e := e.toAlgEquiv.surjective
/-- `Equiv.cast (congrArg _ h)` as a continuous algebra equiv.

Note that unlike `Equiv.cast`, this takes an equality of indices rather than an equality of types,
to avoid having to deal with an equality of the algebraic structure itself. -/
```

-- snippet 15
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe (L78-L79)
instance coe : Coe (A ≃A[R] B) (A →A[R] B) := ⟨toContinuousAlgHom⟩
```

-- snippet 16
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.map_eq_zero_iff (L164-L166)
theorem map_eq_zero_iff (e : A ≃A[R] B) {a : A} : e a = 0 ↔ a = 0 :=
e.toAlgEquiv.toLinearEquiv.map_eq_zero_iff
```

-- snippet 17
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv_toLinearEquiv_eq (L144-L147)
theorem toContinuousLinearEquiv_toLinearEquiv_eq (e : A ≃A[R] B) :
    e.toContinuousLinearEquiv.toLinearEquiv
    = e.toAlgEquiv.toLinearEquiv := rfl
```

-- snippet 18
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_toAlgEquiv (L242-L243)
theorem symm_toAlgEquiv (e : A ≃A[R] B) : e.symm.toAlgEquiv = e.toAlgEquiv.symm := rfl
```

-- snippet 19
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_map_nhds_eq (L251-L254)
theorem symm_map_nhds_eq (e : A ≃A[R] B) (a : A) : Filter.map e.symm (𝓝 (e a)) = 𝓝 a :=
e.toHomeomorph.symm_map_nhds_eq a

/-- The composition of two continuous algebra equivalences. -/
```

-- snippet 20
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.comp_continuous_iff (L183-L186)
theorem comp_continuous_iff {α : Type*} [TopologicalSpace α] (e : A ≃A[R] B) {f : α → A} :
    Continuous (e ∘ f) ↔ Continuous f :=
e.toHomeomorph.comp_continuous_iff
```

-- snippet 21
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_bijective (L306-L308)
theorem symm_bijective : Function.Bijective (symm : (A ≃A[R] B) → _) :=
Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩
```

-- snippet 22
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousWithinAt (L179-L182)
theorem continuousWithinAt (e : A ≃A[R] B) {S : Set A} {a : A} :
    ContinuousWithinAt e S a :=
e.continuous.continuousWithinAt
```

-- snippet 23
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans_toAlgEquiv (L262-L265)
theorem trans_toAlgEquiv (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) :
    (e₁.trans e₂).toAlgEquiv = e₁.toAlgEquiv.trans e₂.toAlgEquiv :=
rfl
```

-- snippet 24
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.preimage_symm_preimage (L331-L333)
theorem preimage_symm_preimage (e : A ≃A[R] B) (S : Set A) : e ⁻¹' (e.symm ⁻¹' S) = S :=
e.symm.symm_preimage_preimage S
```

-- snippet 25
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.map_nhds_eq (L161-L163)
theorem map_nhds_eq (e : A ≃A[R] B) (a : A) : Filter.map e (𝓝 a) = 𝓝 (e a) :=
e.toHomeomorph.map_nhds_eq a
```

-- snippet 26
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousAt (L176-L178)
theorem continuousAt (e : A ≃A[R] B) {a : A} : ContinuousAt e a :=
e.continuous.continuousAt
```

-- snippet 27
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.self_comp_symm (L300-L302)
theorem self_comp_symm (e : A ≃A[R] B) : (e : A → B) ∘ e.symm = id :=
funext <| e.apply_symm_apply
```

-- snippet 28
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_image_image (L234-L236)
theorem symm_image_image (e : A ≃A[R] B) (S : Set A) : e.symm '' (e '' S) = S :=
e.toEquiv.symm_image_image S
```

-- snippet 29
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_symm_apply (L312-L313)
theorem symm_symm_apply (e : A ≃A[R] B) (a : A) : e.symm.symm a = e a := rfl
```

-- snippet 30
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl (L195-L199)
def refl : A ≃A[R] A where
  __ := AlgEquiv.refl
continuous_toFun := continuous_id
  continuous_invFun := continuous_id
```

-- snippet 31
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_apply_apply (L230-L232)
theorem symm_apply_apply (e : A ≃A[R] B) (a : A) : e.symm (e a) = a :=
e.1.left_inv a
```

-- snippet 32
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_symm_eq_preimage (L323-L325)
theorem image_symm_eq_preimage (e : A ≃A[R] B) (S : Set B) : e.symm '' S = e ⁻¹' S := by
rw [e.symm.image_eq_preimage_symm, e.symm_symm]
```

-- snippet 33
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.eq_symm_apply (L317-L319)
theorem eq_symm_apply (e : A ≃A[R] B) {a : A} {b : B} : a = e.symm b ↔ e a = b :=
e.toEquiv.eq_symm_apply
```

-- snippet 34
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv_apply (L137-L139)
theorem toContinuousLinearEquiv_apply (e : A ≃A[R] B) (a : A) :
    e.toContinuousLinearEquiv a = e a := rfl
```

-- snippet 35
```lean
-- Mathlib.Topology.Algebra.Algebra.continuous_algebraMap (L48-L51)
theorem continuous_algebraMap [ContinuousSMul R A] : Continuous (algebraMap R A) := by
rw [algebraMap_eq_smul_one']
  fun_prop
```

-- snippet 36
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_toHomeomorph (L245-L246)
theorem symm_toHomeomorph (e : A ≃A[R] B) : e.symm.toHomeomorph = e.toHomeomorph.symm := rfl
```

-- snippet 37
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_symm_comp_coe (L291-L294)
theorem coe_symm_comp_coe (e : A ≃A[R] B) :
    e.symm.toContinuousAlgHom.comp e = ContinuousAlgHom.id R A :=
ContinuousAlgHom.ext e.symm_apply_apply
```

-- snippet 38
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuous (L171-L172)
theorem continuous (e : A ≃A[R] B) : Continuous e := e.continuous_toFun
```

-- snippet 39
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm (L220-L224)
def symm (e : A ≃A[R] B) : B ≃A[R] A where
  __ := e.toAlgEquiv.symm
continuous_toFun := e.continuous_invFun
  continuous_invFun := e.continuous_toFun
```

-- snippet 40
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coeCLE_refl (L207-L208)
theorem coeCLE_refl : (refl R A).toContinuousLinearEquiv = ContinuousLinearEquiv.refl R A := rfl
```

-- snippet 41
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_isOpenMap (L146-L152)
theorem homothety_isOpenMap (x : P) (t : R) (ht : t ≠ 0) : IsOpenMap <| homothety x t := by
apply IsOpenMap.of_inverse (homothety_continuous x t⁻¹) <;> intro e <;>
    simp [← AffineMap.comp_apply, ← homothety_mul, ht]

end Field

end AffineMap
```

-- snippet 42
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.equivLike (L80-L91)
instance equivLike : EquivLike (A ≃A[R] B) A B where
  coe f := f.toFun
inv f := f.invFun
  coe_injective' f g h₁ h₂ := by
    obtain ⟨f', _⟩ := f
    obtain ⟨g', _⟩ := g
    rcases f' with ⟨⟨_, _⟩, _⟩
    rcases g' with ⟨⟨_, _⟩, _⟩
    congr
  left_inv f := f.left_inv
  right_inv f := f.right_inv
```

-- snippet 43
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.cast (L354-L360)
def cast {ι : Type*} {A : ι → Type*} [(i : ι) → Semiring (A i)] [(i : ι) → Algebra R (A i)]
    [(i : ι) → TopologicalSpace (A i)] {i j : ι} (h : i = j) :
    A i ≃A[R] A j where
  __ := AlgEquiv.cast h
continuous_toFun := by cases h; exact continuous_id
  continuous_invFun := by cases h; exact continuous_id
```

-- snippet 44
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.ext (L111-L113)
theorem ext {f g : A ≃A[R] B} (h : ⇑f = ⇑g) : f = g :=
toAlgEquiv_injective <| AlgEquiv.ext <| congr_fun h
```

-- snippet 45
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous (L66-L75)
theorem lineMap_continuous {p q : P} :
    Continuous (lineMap p q : R →ᵃ[R] P) := by
fun_prop

open Topology Filter

section Tendsto

variable {α : Type*} {l : Filter α}
```

-- snippet 46
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_inj (L118-L120)
theorem coe_inj {f g : A ≃A[R] B} : (f : A →A[R] B) = g ↔ f = g :=
coe_injective.eq_iff
```

-- snippet 47
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.cast_symm_apply (L367-L371)
theorem cast_symm_apply {ι : Type*} {A : ι → Type*} [(i : ι) → Semiring (A i)]
    [(i : ι) → Algebra R (A i)] [(i : ι) → TopologicalSpace (A i)] {i j : ι} (h : i = j)
    (x : A j) : (cast (R := R) h).symm x = Equiv.cast (congrArg A h.symm) x := rfl
end ContinuousAlgEquiv
```

-- snippet 48
```lean
-- Mathlib.Topology.Algebra.Affine.isOpenMap_linear_iff (L46-L58)
theorem isOpenMap_linear_iff {f : P →ᵃ[R] Q} : IsOpenMap f.linear ↔ IsOpenMap f := by
inhabit P
  have :
    (f.linear : V → W) =
      (Homeomorph.vaddConst <| f default).symm ∘ f ∘ (Homeomorph.vaddConst default) := by
    ext v
    simp
  rw [this]
  simp only [Homeomorph.comp_isOpenMap_iff, Homeomorph.comp_isOpenMap_iff']

variable [TopologicalSpace R] [ContinuousSMul R V]

/-- The line map is continuous in all arguments. -/
```

-- snippet 49
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans_apply (L272-L275)
theorem trans_apply (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) (a : A) :
    (e₁.trans e₂) a = e₂ (e₁ a) :=
rfl
```

-- snippet 50
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans (L256-L260)
def trans (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) : A ≃A[R] C where
  __ := e₁.toAlgEquiv.trans e₂.toAlgEquiv
continuous_toFun := e₂.continuous_toFun.comp e₁.continuous_toFun
  continuous_invFun := e₁.continuous_invFun.comp e₂.continuous_invFun
```

-- snippet 51
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.apply_symm_apply (L226-L228)
theorem apply_symm_apply (e : A ≃A[R] B) (b : B) : e (e.symm b) = b :=
e.1.right_inv b
```

-- snippet 52
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_trans_apply (L277-L280)
theorem symm_trans_apply (e₁ : B ≃A[R] A) (e₂ : C ≃A[R] B) (a : A) :
    (e₂.trans e₁).symm a = e₂.symm (e₁.symm a) :=
rfl
```

-- snippet 53
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_preimage_preimage (L327-L329)
theorem symm_preimage_preimage (e : A ≃A[R] B) (S : Set B) : e.symm ⁻¹' (e ⁻¹' S) = S :=
e.toEquiv.symm_preimage_preimage S
```

-- snippet 54
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.comp_continuous_iff' (L187-L193)
theorem comp_continuous_iff' {β : Type*} [TopologicalSpace β] (e : A ≃A[R] B) {g : B → β} :
    Continuous (g ∘ e) ↔ Continuous g :=
e.toHomeomorph.comp_continuous_iff'

variable (R A)

/-- The identity isomorphism as a continuous `R`-algebra equivalence. -/
```

-- snippet 55
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toAlgEquiv_injective (L106-L109)
theorem toAlgEquiv_injective : Function.Injective (toAlgEquiv : (A ≃A[R] B) → A ≃ₐ[R] B) := by
rintro ⟨e, _, _⟩ ⟨e', _, _⟩ rfl
  rfl
```

-- snippet 56
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousOn (L173-L175)
theorem continuousOn (e : A ≃A[R] B) {S : Set A} : ContinuousOn e S :=
e.continuous.continuousOn
```

-- snippet 57
```lean
-- Mathlib.Topology.Algebra.AffineSubspace.isClosed_direction_iff (L54-L61)
theorem isClosed_direction_iff [T1Space V] (s : AffineSubspace R P) :
    IsClosed (s.direction : Set V) ↔ IsClosed (s : Set P) := by
rcases s.eq_bot_or_nonempty with (rfl | ⟨x, hx⟩); · simp
  rw [← (Homeomorph.vaddConst x).symm.isClosed_image,
    AffineSubspace.coe_direction_eq_vsub_set_right hx]
  simp only [Homeomorph.vaddConst_symm_apply]

end AffineSubspace
```

-- snippet 58
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_symm_image (L238-L240)
theorem image_symm_image (e : A ≃A[R] B) (S : Set B) : e '' (e.symm '' S) = S :=
e.symm.symm_image_image S
```

-- snippet 59
```lean
-- Mathlib.Topology.Algebra.Algebra.Rat.DivisionRing (L26-L30)
instance DivisionRing.continuousConstSMul_rat {A} [DivisionRing A] [TopologicalSpace A]
    [SeparatelyContinuousMul A] [CharZero A] : ContinuousConstSMul ℚ A :=
⟨fun r => by simpa only [Algebra.smul_def] using continuous_id.const_mul _⟩

end DivisionRing
```

-- snippet 60
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_refl' (L210-L211)
theorem coe_refl' : ⇑(refl R A) = id := rfl
```

-- snippet 61
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousAlgHom (L74-L77)
def toContinuousAlgHom (e : A ≃A[R] B) : A →A[R] B where
  __ := e.toAlgHom
cont := e.continuous_toFun
```

-- snippet 62
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearMap_toContinuousLinearEquiv_eq (L140-L143)
theorem toContinuousLinearMap_toContinuousLinearEquiv_eq (e : A ≃A[R] B) :
    e.toContinuousLinearEquiv.toContinuousLinearMap
    = e.toContinuousAlgHom.toContinuousLinearMap := rfl
```

-- snippet 63
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_apply (L99-L100)
theorem coe_apply (e : A ≃A[R] B) (a : A) : (e : A →A[R] B) a = e a := rfl
```

-- snippet 64
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.isOpenMap (L148-L150)
theorem isOpenMap (e : A ≃A[R] B) : IsOpenMap e :=
e.toHomeomorph.isOpenMap
```

-- snippet 65
```lean
-- Mathlib.Topology.Algebra.Algebra.continuous_algebraMap_iff_smul (L52-L57)
theorem continuous_algebraMap_iff_smul [ContinuousMul A] :
    Continuous (algebraMap R A) ↔ Continuous fun p : R × A => p.1 • p.2 := by
refine ⟨fun h => ?_, fun h => have : ContinuousSMul R A := ⟨h⟩; continuous_algebraMap _ _⟩
  simp only [Algebra.smul_def]
  exact (h.comp continuous_fst).mul continuous_snd
```

-- snippet 66
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousAlgEquivClass (L92-L98)
instance continuousAlgEquivClass : ContinuousAlgEquivClass (A ≃A[R] B) R A B where
  map_add f := f.map_add'
map_mul f := f.map_mul'
  commutes f := f.commutes'
  map_continuous := continuous_toFun
  inv_continuous := continuous_invFun
```

-- snippet 67
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_eq_preimage_symm (L320-L322)
theorem image_eq_preimage_symm (e : A ≃A[R] B) (S : Set A) : e '' S = e.symm ⁻¹' S :=
e.toEquiv.image_eq_preimage_symm S
```

-- snippet 68
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_apply_eq (L314-L316)
theorem symm_apply_eq (e : A ≃A[R] B) {a : A} {b : B} : e.symm b = a ↔ b = e a :=
e.toEquiv.symm_apply_eq
```

-- snippet 69
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_comp_self (L296-L298)
theorem symm_comp_self (e : A ≃A[R] B) : (e.symm : B → A) ∘ e = id := by
exact funext <| e.symm_apply_apply
```

-- snippet 70
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_refl (L204-L205)
theorem coe_refl : refl R A = ContinuousAlgHom.id R A := rfl
```

-- snippet 71
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.isUniformEmbedding (L334-L339)
theorem isUniformEmbedding {E₁ E₂ : Type*} [UniformSpace E₁] [UniformSpace E₂] [Ring E₁]
    [IsUniformAddGroup E₁] [Algebra R E₁] [Ring E₂] [IsUniformAddGroup E₂] [Algebra R E₂]
    (e : E₁ ≃A[R] E₂) : IsUniformEmbedding e :=
e.toAlgEquiv.isUniformEmbedding e.toContinuousAlgHom.uniformContinuous
    e.symm.toContinuousAlgHom.uniformContinuous
```

-- snippet 72
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_symm (L304-L305)
theorem symm_symm (e : A ≃A[R] B) : e.symm.symm = e := rfl
```

-- snippet 73
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous_uncurry (L60-L65)
theorem lineMap_continuous_uncurry :
    Continuous (fun pqt : P × P × R ↦ lineMap pqt.1 pqt.2.1 pqt.2.2) := by
simp only [coe_lineMap]
  fun_prop

/-- The line map is continuous. -/
```

-- snippet 74
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv (L127-L129)
def toContinuousLinearEquiv (e : A ≃A[R] B) : A ≃L[R] B :=
{ e with __ := e.toLinearEquiv }
```

-- snippet 75
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl_toContinuousLinearEquiv (L213-L218)
theorem refl_toContinuousLinearEquiv :
    (refl R A).toContinuousLinearEquiv = .refl R A := rfl
variable {R A}

/-- The inverse of a continuous algebra equivalence. -/
```

-- snippet 76
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans_toContinuousLinearEquiv (L267-L270)
theorem trans_toContinuousLinearEquiv (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) :
    (e₁.trans e₂).toContinuousLinearEquiv
    = e₁.toContinuousLinearEquiv.trans e₂.toContinuousLinearEquiv := rfl
```

-- snippet 77
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_injective (L114-L116)
theorem coe_injective : Function.Injective ((↑) : (A ≃A[R] B) → A →A[R] B) :=
fun _ _ h => ext <| funext <| ContinuousAlgHom.ext_iff.1 h
```

-- snippet 78
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv_symm (L248-L250)
theorem toContinuousLinearEquiv_symm (e : A ≃A[R] B) :
    e.symm.toContinuousLinearEquiv = e.toContinuousLinearEquiv.symm := rfl
```

-- snippet 79
```lean
-- Mathlib.Topology.Algebra.Algebra.Subalgebra (L62-L65)
instance Subalgebra.continuousSMul (S : Subalgebra R A) (X) [TopologicalSpace X] [MulAction A X]
    [ContinuousSMul A X] : ContinuousSMul S X :=
Subsemiring.continuousSMul S.toSubsemiring X
```

-- snippet 80
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_continuous (L118-L125)
theorem homothety_continuous (x : P) (t : R) : Continuous <| homothety x t := by
rw [coe_homothety]
  fun_prop

variable (R) [TopologicalSpace R] [Module R W] [ContinuousSMul R W] (x : Q) {s : Set Q}

open Topology
```

-- snippet 81
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_closure (L151-L153)
theorem image_closure (e : A ≃A[R] B) (S : Set A) : e '' closure S = closure (e '' S) :=
e.toHomeomorph.image_closure S
```

-- snippet 82
```lean
-- Mathlib.Topology.Algebra.Algebra.continuousSMul_of_algebraMap (L58-L61)
theorem continuousSMul_of_algebraMap [ContinuousMul A] (h : Continuous (algebraMap R A)) :
    ContinuousSMul R A :=
⟨(continuous_algebraMap_iff_smul R A).1 h⟩
```

-- snippet 83
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.comp_coe (L281-L284)
theorem comp_coe (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) :
    e₂.toAlgHom.comp e₁.toAlgHom = e₁.trans e₂ := by
rfl
```

-- snippet 84
```lean
-- Mathlib.Topology.Algebra.AffineSubspace.subtypeA (L33-L36)
def subtypeA (s : AffineSubspace R P) [Nonempty s] : s →ᴬ[R] P where
  toAffineMap := s.subtype
cont := continuous_subtype_val
```

-- snippet 85
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_comp_coe_symm (L286-L289)
theorem coe_comp_coe_symm (e : A ≃A[R] B) :
    e.toContinuousAlgHom.comp e.symm = ContinuousAlgHom.id R B :=
ContinuousAlgHom.ext e.apply_symm_apply
```

-- snippet 86
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.preimage_closure (L154-L156)
theorem preimage_closure (e : A ≃A[R] B) (S : Set B) : e ⁻¹' closure S = closure (e ⁻¹' S) :=
e.toHomeomorph.preimage_closure S
```

-- snippet 87
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.isClosed_image (L158-L160)
theorem isClosed_image (e : A ≃A[R] B) {S : Set A} : IsClosed (e '' S) ↔ IsClosed S :=
e.toHomeomorph.isClosed_image
```

-- snippet 88
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_toAlgEquiv (L122-L125)
theorem coe_toAlgEquiv (e : A ≃A[R] B) : ⇑e.toAlgEquiv = e := rfl
/-- The natural coercion from a continuous algebra isomorphism
to a continuous linear isomorphism. -/
```

-- snippet 89
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl_symm (L310-L311)
theorem refl_symm : (refl R A).symm = refl R A := rfl
```

-- snippet 90
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.cast_apply (L362-L365)
theorem cast_apply {ι : Type*} {A : ι → Type*} [(i : ι) → Semiring (A i)]
    [(i : ι) → Algebra R (A i)] [(i : ι) → TopologicalSpace (A i)] {i j : ι} (h : i = j) (x : A i) :
    cast (R := R) h x = Equiv.cast (congrArg A h) x := rfl
```

-- snippet 91
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl_apply (L201-L202)
theorem refl_apply (a : A) : refl R A a = a := rfl
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.Group.GroupTopology).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem toTopologicalSpace_le {x y : GroupTopology α} :
    x.toTopologicalSpace ≤ y.toTopologicalSpace ↔ x ≤ y
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.continuous_mul' (L50-L57)
theorem continuous_mul' (g : GroupTopology α) :
    haveI := g.toTopologicalSpace
Continuous fun p : α × α => p.1 * p.2 := by
  letI := g.toTopologicalSpace
  haveI := g.toIsTopologicalGroup
  exact continuous_mul

/-- A version of the global `continuous_inv` suitable for dot notation. -/
```

-- snippet 2
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.continuous_inv' (L59-L65)
theorem continuous_inv' (g : GroupTopology α) :
    haveI := g.toTopologicalSpace
Continuous (Inv.inv : α → α) := by
  letI := g.toTopologicalSpace
  haveI := g.toIsTopologicalGroup
  exact continuous_inv
```

-- snippet 3
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_injective (L67-L73)
theorem toTopologicalSpace_injective :
    Function.Injective (toTopologicalSpace : GroupTopology α → TopologicalSpace α) :=
fun f g h => by
    cases f
    cases g
    congr
```

-- snippet 4
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.ext' (L75-L79)
theorem ext' {f g : GroupTopology α} (h : f.IsOpen = g.IsOpen) : f = g :=
toTopologicalSpace_injective <| TopologicalSpace.ext h

/-- The ordering on group topologies on the group `γ`. `t ≤ s` if every set open in `s` is also open
in `t` (`t` is finer than `s`). -/
```

-- snippet 5
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_top (L98-L100)
theorem toTopologicalSpace_top : (⊤ : GroupTopology α).toTopologicalSpace = ⊤ :=
rfl
```

-- snippet 6
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_bot (L110-L113)
theorem toTopologicalSpace_bot : (⊥ : GroupTopology α).toTopologicalSpace = ⊥ :=
rfl

set_option backward.isDefEq.respectTransparency false in
```

-- snippet 7
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_inf (L123-L126)
theorem toTopologicalSpace_inf (x y : GroupTopology α) :
    (x ⊓ y).toTopologicalSpace = x.toTopologicalSpace ⊓ y.toTopologicalSpace :=
rfl
```

-- snippet 8
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_sInf (L142-L144)
theorem toTopologicalSpace_sInf (s : Set (GroupTopology α)) :
    (sInf s).toTopologicalSpace = sInf (toTopologicalSpace '' s) := rfl
```

-- snippet 9
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.toTopologicalSpace_iInf (L146-L157)
theorem toTopologicalSpace_iInf {ι} (s : ι → GroupTopology α) :
    (⨅ i, s i).toTopologicalSpace = ⨅ i, (s i).toTopologicalSpace :=
congr_arg sInf (range_comp _ _).symm

/-- Group topologies on `γ` form a complete lattice, with `⊥` the discrete topology and `⊤` the
indiscrete topology.

The infimum of a collection of group topologies is the topology generated by all their open sets
(which is a group topology).

The supremum of two group topologies `s` and `t` is the infimum of the family of all group
topologies contained in the intersection of `s` and `t`. -/
```

-- snippet 10
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.coinduced (L184-L187)
def coinduced {α β : Type*} [t : TopologicalSpace α] [Group β] (f : α → β) : GroupTopology β :=
sInf { b : GroupTopology β | TopologicalSpace.coinduced f t ≤ b.toTopologicalSpace }

set_option backward.isDefEq.respectTransparency false in
```

-- snippet 11
```lean
-- Mathlib.Topology.Algebra.Group.GroupTopology.coinduced_continuous (L189-L195)
theorem coinduced_continuous {α β : Type*} [t : TopologicalSpace α] [Group β] (f : α → β) :
    Continuous[t, (coinduced f).toTopologicalSpace] f := by
rw [continuous_sInf_rng]
  rintro _ ⟨t', ht', rfl⟩
  exact continuous_iff_coinduced_le.2 ht'

end GroupTopology
```

-- snippet 12
```lean
-- Mathlib.Topology.Algebra.Affine.continuous_linear_iff (L35-L45)
theorem continuous_linear_iff {f : P →ᵃ[R] Q} : Continuous f.linear ↔ Continuous f := by
inhabit P
  have :
    (f.linear : V → W) =
      (Homeomorph.vaddConst <| f default).symm ∘ f ∘ (Homeomorph.vaddConst default) := by
    ext v
    simp
  rw [this]
  simp only [Homeomorph.comp_continuous_iff, Homeomorph.comp_continuous_iff']

/-- If `f` is an affine map, then its linear part is an open map iff `f` is an open map. -/
```

-- snippet 13
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_coe (L104-L105)
theorem coe_coe (e : A ≃A[R] B) : ⇑(e : A →A[R] B) = e := rfl
```

-- snippet 14
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.surjective (L348-L353)
theorem surjective (e : A ≃A[R] B) : Function.Surjective e := e.toAlgEquiv.surjective
/-- `Equiv.cast (congrArg _ h)` as a continuous algebra equiv.

Note that unlike `Equiv.cast`, this takes an equality of indices rather than an equality of types,
to avoid having to deal with an equality of the algebraic structure itself. -/
```

-- snippet 15
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe (L78-L79)
instance coe : Coe (A ≃A[R] B) (A →A[R] B) := ⟨toContinuousAlgHom⟩
```

-- snippet 16
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.map_eq_zero_iff (L164-L166)
theorem map_eq_zero_iff (e : A ≃A[R] B) {a : A} : e a = 0 ↔ a = 0 :=
e.toAlgEquiv.toLinearEquiv.map_eq_zero_iff
```

-- snippet 17
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv_toLinearEquiv_eq (L144-L147)
theorem toContinuousLinearEquiv_toLinearEquiv_eq (e : A ≃A[R] B) :
    e.toContinuousLinearEquiv.toLinearEquiv
    = e.toAlgEquiv.toLinearEquiv := rfl
```

-- snippet 18
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_toAlgEquiv (L242-L243)
theorem symm_toAlgEquiv (e : A ≃A[R] B) : e.symm.toAlgEquiv = e.toAlgEquiv.symm := rfl
```

-- snippet 19
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_map_nhds_eq (L251-L254)
theorem symm_map_nhds_eq (e : A ≃A[R] B) (a : A) : Filter.map e.symm (𝓝 (e a)) = 𝓝 a :=
e.toHomeomorph.symm_map_nhds_eq a

/-- The composition of two continuous algebra equivalences. -/
```

-- snippet 20
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.comp_continuous_iff (L183-L186)
theorem comp_continuous_iff {α : Type*} [TopologicalSpace α] (e : A ≃A[R] B) {f : α → A} :
    Continuous (e ∘ f) ↔ Continuous f :=
e.toHomeomorph.comp_continuous_iff
```

-- snippet 21
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_bijective (L306-L308)
theorem symm_bijective : Function.Bijective (symm : (A ≃A[R] B) → _) :=
Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩
```

-- snippet 22
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousWithinAt (L179-L182)
theorem continuousWithinAt (e : A ≃A[R] B) {S : Set A} {a : A} :
    ContinuousWithinAt e S a :=
e.continuous.continuousWithinAt
```

-- snippet 23
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans_toAlgEquiv (L262-L265)
theorem trans_toAlgEquiv (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) :
    (e₁.trans e₂).toAlgEquiv = e₁.toAlgEquiv.trans e₂.toAlgEquiv :=
rfl
```

-- snippet 24
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.preimage_symm_preimage (L331-L333)
theorem preimage_symm_preimage (e : A ≃A[R] B) (S : Set A) : e ⁻¹' (e.symm ⁻¹' S) = S :=
e.symm.symm_preimage_preimage S
```

-- snippet 25
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.map_nhds_eq (L161-L163)
theorem map_nhds_eq (e : A ≃A[R] B) (a : A) : Filter.map e (𝓝 a) = 𝓝 (e a) :=
e.toHomeomorph.map_nhds_eq a
```

-- snippet 26
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousAt (L176-L178)
theorem continuousAt (e : A ≃A[R] B) {a : A} : ContinuousAt e a :=
e.continuous.continuousAt
```

-- snippet 27
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.self_comp_symm (L300-L302)
theorem self_comp_symm (e : A ≃A[R] B) : (e : A → B) ∘ e.symm = id :=
funext <| e.apply_symm_apply
```

-- snippet 28
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_image_image (L234-L236)
theorem symm_image_image (e : A ≃A[R] B) (S : Set A) : e.symm '' (e '' S) = S :=
e.toEquiv.symm_image_image S
```

-- snippet 29
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_symm_apply (L312-L313)
theorem symm_symm_apply (e : A ≃A[R] B) (a : A) : e.symm.symm a = e a := rfl
```

-- snippet 30
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl (L195-L199)
def refl : A ≃A[R] A where
  __ := AlgEquiv.refl
continuous_toFun := continuous_id
  continuous_invFun := continuous_id
```

-- snippet 31
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_apply_apply (L230-L232)
theorem symm_apply_apply (e : A ≃A[R] B) (a : A) : e.symm (e a) = a :=
e.1.left_inv a
```

-- snippet 32
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_symm_eq_preimage (L323-L325)
theorem image_symm_eq_preimage (e : A ≃A[R] B) (S : Set B) : e.symm '' S = e ⁻¹' S := by
rw [e.symm.image_eq_preimage_symm, e.symm_symm]
```

-- snippet 33
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.eq_symm_apply (L317-L319)
theorem eq_symm_apply (e : A ≃A[R] B) {a : A} {b : B} : a = e.symm b ↔ e a = b :=
e.toEquiv.eq_symm_apply
```

-- snippet 34
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv_apply (L137-L139)
theorem toContinuousLinearEquiv_apply (e : A ≃A[R] B) (a : A) :
    e.toContinuousLinearEquiv a = e a := rfl
```

-- snippet 35
```lean
-- Mathlib.Topology.Algebra.Algebra.continuous_algebraMap (L48-L51)
theorem continuous_algebraMap [ContinuousSMul R A] : Continuous (algebraMap R A) := by
rw [algebraMap_eq_smul_one']
  fun_prop
```

-- snippet 36
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_toHomeomorph (L245-L246)
theorem symm_toHomeomorph (e : A ≃A[R] B) : e.symm.toHomeomorph = e.toHomeomorph.symm := rfl
```

-- snippet 37
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_symm_comp_coe (L291-L294)
theorem coe_symm_comp_coe (e : A ≃A[R] B) :
    e.symm.toContinuousAlgHom.comp e = ContinuousAlgHom.id R A :=
ContinuousAlgHom.ext e.symm_apply_apply
```

-- snippet 38
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuous (L171-L172)
theorem continuous (e : A ≃A[R] B) : Continuous e := e.continuous_toFun
```

-- snippet 39
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm (L220-L224)
def symm (e : A ≃A[R] B) : B ≃A[R] A where
  __ := e.toAlgEquiv.symm
continuous_toFun := e.continuous_invFun
  continuous_invFun := e.continuous_toFun
```

-- snippet 40
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coeCLE_refl (L207-L208)
theorem coeCLE_refl : (refl R A).toContinuousLinearEquiv = ContinuousLinearEquiv.refl R A := rfl
```

-- snippet 41
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_isOpenMap (L146-L152)
theorem homothety_isOpenMap (x : P) (t : R) (ht : t ≠ 0) : IsOpenMap <| homothety x t := by
apply IsOpenMap.of_inverse (homothety_continuous x t⁻¹) <;> intro e <;>
    simp [← AffineMap.comp_apply, ← homothety_mul, ht]

end Field

end AffineMap
```

-- snippet 42
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.equivLike (L80-L91)
instance equivLike : EquivLike (A ≃A[R] B) A B where
  coe f := f.toFun
inv f := f.invFun
  coe_injective' f g h₁ h₂ := by
    obtain ⟨f', _⟩ := f
    obtain ⟨g', _⟩ := g
    rcases f' with ⟨⟨_, _⟩, _⟩
    rcases g' with ⟨⟨_, _⟩, _⟩
    congr
  left_inv f := f.left_inv
  right_inv f := f.right_inv
```

-- snippet 43
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.cast (L354-L360)
def cast {ι : Type*} {A : ι → Type*} [(i : ι) → Semiring (A i)] [(i : ι) → Algebra R (A i)]
    [(i : ι) → TopologicalSpace (A i)] {i j : ι} (h : i = j) :
    A i ≃A[R] A j where
  __ := AlgEquiv.cast h
continuous_toFun := by cases h; exact continuous_id
  continuous_invFun := by cases h; exact continuous_id
```

-- snippet 44
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.ext (L111-L113)
theorem ext {f g : A ≃A[R] B} (h : ⇑f = ⇑g) : f = g :=
toAlgEquiv_injective <| AlgEquiv.ext <| congr_fun h
```

-- snippet 45
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous (L66-L75)
theorem lineMap_continuous {p q : P} :
    Continuous (lineMap p q : R →ᵃ[R] P) := by
fun_prop

open Topology Filter

section Tendsto

variable {α : Type*} {l : Filter α}
```

-- snippet 46
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_inj (L118-L120)
theorem coe_inj {f g : A ≃A[R] B} : (f : A →A[R] B) = g ↔ f = g :=
coe_injective.eq_iff
```

-- snippet 47
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.cast_symm_apply (L367-L371)
theorem cast_symm_apply {ι : Type*} {A : ι → Type*} [(i : ι) → Semiring (A i)]
    [(i : ι) → Algebra R (A i)] [(i : ι) → TopologicalSpace (A i)] {i j : ι} (h : i = j)
    (x : A j) : (cast (R := R) h).symm x = Equiv.cast (congrArg A h.symm) x := rfl
end ContinuousAlgEquiv
```

-- snippet 48
```lean
-- Mathlib.Topology.Algebra.Affine.isOpenMap_linear_iff (L46-L58)
theorem isOpenMap_linear_iff {f : P →ᵃ[R] Q} : IsOpenMap f.linear ↔ IsOpenMap f := by
inhabit P
  have :
    (f.linear : V → W) =
      (Homeomorph.vaddConst <| f default).symm ∘ f ∘ (Homeomorph.vaddConst default) := by
    ext v
    simp
  rw [this]
  simp only [Homeomorph.comp_isOpenMap_iff, Homeomorph.comp_isOpenMap_iff']

variable [TopologicalSpace R] [ContinuousSMul R V]

/-- The line map is continuous in all arguments. -/
```

-- snippet 49
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans_apply (L272-L275)
theorem trans_apply (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) (a : A) :
    (e₁.trans e₂) a = e₂ (e₁ a) :=
rfl
```

-- snippet 50
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans (L256-L260)
def trans (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) : A ≃A[R] C where
  __ := e₁.toAlgEquiv.trans e₂.toAlgEquiv
continuous_toFun := e₂.continuous_toFun.comp e₁.continuous_toFun
  continuous_invFun := e₁.continuous_invFun.comp e₂.continuous_invFun
```

-- snippet 51
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.apply_symm_apply (L226-L228)
theorem apply_symm_apply (e : A ≃A[R] B) (b : B) : e (e.symm b) = b :=
e.1.right_inv b
```

-- snippet 52
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_trans_apply (L277-L280)
theorem symm_trans_apply (e₁ : B ≃A[R] A) (e₂ : C ≃A[R] B) (a : A) :
    (e₂.trans e₁).symm a = e₂.symm (e₁.symm a) :=
rfl
```

-- snippet 53
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_preimage_preimage (L327-L329)
theorem symm_preimage_preimage (e : A ≃A[R] B) (S : Set B) : e.symm ⁻¹' (e ⁻¹' S) = S :=
e.toEquiv.symm_preimage_preimage S
```

-- snippet 54
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.comp_continuous_iff' (L187-L193)
theorem comp_continuous_iff' {β : Type*} [TopologicalSpace β] (e : A ≃A[R] B) {g : B → β} :
    Continuous (g ∘ e) ↔ Continuous g :=
e.toHomeomorph.comp_continuous_iff'

variable (R A)

/-- The identity isomorphism as a continuous `R`-algebra equivalence. -/
```

-- snippet 55
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toAlgEquiv_injective (L106-L109)
theorem toAlgEquiv_injective : Function.Injective (toAlgEquiv : (A ≃A[R] B) → A ≃ₐ[R] B) := by
rintro ⟨e, _, _⟩ ⟨e', _, _⟩ rfl
  rfl
```

-- snippet 56
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousOn (L173-L175)
theorem continuousOn (e : A ≃A[R] B) {S : Set A} : ContinuousOn e S :=
e.continuous.continuousOn
```

-- snippet 57
```lean
-- Mathlib.Topology.Algebra.AffineSubspace.isClosed_direction_iff (L54-L61)
theorem isClosed_direction_iff [T1Space V] (s : AffineSubspace R P) :
    IsClosed (s.direction : Set V) ↔ IsClosed (s : Set P) := by
rcases s.eq_bot_or_nonempty with (rfl | ⟨x, hx⟩); · simp
  rw [← (Homeomorph.vaddConst x).symm.isClosed_image,
    AffineSubspace.coe_direction_eq_vsub_set_right hx]
  simp only [Homeomorph.vaddConst_symm_apply]

end AffineSubspace
```

-- snippet 58
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_symm_image (L238-L240)
theorem image_symm_image (e : A ≃A[R] B) (S : Set B) : e '' (e.symm '' S) = S :=
e.symm.symm_image_image S
```

-- snippet 59
```lean
-- Mathlib.Topology.Algebra.Algebra.Rat.DivisionRing (L26-L30)
instance DivisionRing.continuousConstSMul_rat {A} [DivisionRing A] [TopologicalSpace A]
    [SeparatelyContinuousMul A] [CharZero A] : ContinuousConstSMul ℚ A :=
⟨fun r => by simpa only [Algebra.smul_def] using continuous_id.const_mul _⟩

end DivisionRing
```

-- snippet 60
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_refl' (L210-L211)
theorem coe_refl' : ⇑(refl R A) = id := rfl
```

-- snippet 61
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousAlgHom (L74-L77)
def toContinuousAlgHom (e : A ≃A[R] B) : A →A[R] B where
  __ := e.toAlgHom
cont := e.continuous_toFun
```

-- snippet 62
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearMap_toContinuousLinearEquiv_eq (L140-L143)
theorem toContinuousLinearMap_toContinuousLinearEquiv_eq (e : A ≃A[R] B) :
    e.toContinuousLinearEquiv.toContinuousLinearMap
    = e.toContinuousAlgHom.toContinuousLinearMap := rfl
```

-- snippet 63
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_apply (L99-L100)
theorem coe_apply (e : A ≃A[R] B) (a : A) : (e : A →A[R] B) a = e a := rfl
```

-- snippet 64
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.isOpenMap (L148-L150)
theorem isOpenMap (e : A ≃A[R] B) : IsOpenMap e :=
e.toHomeomorph.isOpenMap
```

-- snippet 65
```lean
-- Mathlib.Topology.Algebra.Algebra.continuous_algebraMap_iff_smul (L52-L57)
theorem continuous_algebraMap_iff_smul [ContinuousMul A] :
    Continuous (algebraMap R A) ↔ Continuous fun p : R × A => p.1 • p.2 := by
refine ⟨fun h => ?_, fun h => have : ContinuousSMul R A := ⟨h⟩; continuous_algebraMap _ _⟩
  simp only [Algebra.smul_def]
  exact (h.comp continuous_fst).mul continuous_snd
```

-- snippet 66
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.continuousAlgEquivClass (L92-L98)
instance continuousAlgEquivClass : ContinuousAlgEquivClass (A ≃A[R] B) R A B where
  map_add f := f.map_add'
map_mul f := f.map_mul'
  commutes f := f.commutes'
  map_continuous := continuous_toFun
  inv_continuous := continuous_invFun
```

-- snippet 67
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_eq_preimage_symm (L320-L322)
theorem image_eq_preimage_symm (e : A ≃A[R] B) (S : Set A) : e '' S = e.symm ⁻¹' S :=
e.toEquiv.image_eq_preimage_symm S
```

-- snippet 68
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_apply_eq (L314-L316)
theorem symm_apply_eq (e : A ≃A[R] B) {a : A} {b : B} : e.symm b = a ↔ b = e a :=
e.toEquiv.symm_apply_eq
```

-- snippet 69
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_comp_self (L296-L298)
theorem symm_comp_self (e : A ≃A[R] B) : (e.symm : B → A) ∘ e = id := by
exact funext <| e.symm_apply_apply
```

-- snippet 70
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_refl (L204-L205)
theorem coe_refl : refl R A = ContinuousAlgHom.id R A := rfl
```

-- snippet 71
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.isUniformEmbedding (L334-L339)
theorem isUniformEmbedding {E₁ E₂ : Type*} [UniformSpace E₁] [UniformSpace E₂] [Ring E₁]
    [IsUniformAddGroup E₁] [Algebra R E₁] [Ring E₂] [IsUniformAddGroup E₂] [Algebra R E₂]
    (e : E₁ ≃A[R] E₂) : IsUniformEmbedding e :=
e.toAlgEquiv.isUniformEmbedding e.toContinuousAlgHom.uniformContinuous
    e.symm.toContinuousAlgHom.uniformContinuous
```

-- snippet 72
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.symm_symm (L304-L305)
theorem symm_symm (e : A ≃A[R] B) : e.symm.symm = e := rfl
```

-- snippet 73
```lean
-- Mathlib.Topology.Algebra.Affine.lineMap_continuous_uncurry (L60-L65)
theorem lineMap_continuous_uncurry :
    Continuous (fun pqt : P × P × R ↦ lineMap pqt.1 pqt.2.1 pqt.2.2) := by
simp only [coe_lineMap]
  fun_prop

/-- The line map is continuous. -/
```

-- snippet 74
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv (L127-L129)
def toContinuousLinearEquiv (e : A ≃A[R] B) : A ≃L[R] B :=
{ e with __ := e.toLinearEquiv }
```

-- snippet 75
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl_toContinuousLinearEquiv (L213-L218)
theorem refl_toContinuousLinearEquiv :
    (refl R A).toContinuousLinearEquiv = .refl R A := rfl
variable {R A}

/-- The inverse of a continuous algebra equivalence. -/
```

-- snippet 76
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.trans_toContinuousLinearEquiv (L267-L270)
theorem trans_toContinuousLinearEquiv (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) :
    (e₁.trans e₂).toContinuousLinearEquiv
    = e₁.toContinuousLinearEquiv.trans e₂.toContinuousLinearEquiv := rfl
```

-- snippet 77
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_injective (L114-L116)
theorem coe_injective : Function.Injective ((↑) : (A ≃A[R] B) → A →A[R] B) :=
fun _ _ h => ext <| funext <| ContinuousAlgHom.ext_iff.1 h
```

-- snippet 78
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.toContinuousLinearEquiv_symm (L248-L250)
theorem toContinuousLinearEquiv_symm (e : A ≃A[R] B) :
    e.symm.toContinuousLinearEquiv = e.toContinuousLinearEquiv.symm := rfl
```

-- snippet 79
```lean
-- Mathlib.Topology.Algebra.Algebra.Subalgebra (L62-L65)
instance Subalgebra.continuousSMul (S : Subalgebra R A) (X) [TopologicalSpace X] [MulAction A X]
    [ContinuousSMul A X] : ContinuousSMul S X :=
Subsemiring.continuousSMul S.toSubsemiring X
```

-- snippet 80
```lean
-- Mathlib.Topology.Algebra.Affine.homothety_continuous (L118-L125)
theorem homothety_continuous (x : P) (t : R) : Continuous <| homothety x t := by
rw [coe_homothety]
  fun_prop

variable (R) [TopologicalSpace R] [Module R W] [ContinuousSMul R W] (x : Q) {s : Set Q}

open Topology
```

-- snippet 81
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.image_closure (L151-L153)
theorem image_closure (e : A ≃A[R] B) (S : Set A) : e '' closure S = closure (e '' S) :=
e.toHomeomorph.image_closure S
```

-- snippet 82
```lean
-- Mathlib.Topology.Algebra.Algebra.continuousSMul_of_algebraMap (L58-L61)
theorem continuousSMul_of_algebraMap [ContinuousMul A] (h : Continuous (algebraMap R A)) :
    ContinuousSMul R A :=
⟨(continuous_algebraMap_iff_smul R A).1 h⟩
```

-- snippet 83
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.comp_coe (L281-L284)
theorem comp_coe (e₁ : A ≃A[R] B) (e₂ : B ≃A[R] C) :
    e₂.toAlgHom.comp e₁.toAlgHom = e₁.trans e₂ := by
rfl
```

-- snippet 84
```lean
-- Mathlib.Topology.Algebra.AffineSubspace.subtypeA (L33-L36)
def subtypeA (s : AffineSubspace R P) [Nonempty s] : s →ᴬ[R] P where
  toAffineMap := s.subtype
cont := continuous_subtype_val
```

-- snippet 85
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_comp_coe_symm (L286-L289)
theorem coe_comp_coe_symm (e : A ≃A[R] B) :
    e.toContinuousAlgHom.comp e.symm = ContinuousAlgHom.id R B :=
ContinuousAlgHom.ext e.apply_symm_apply
```

-- snippet 86
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.preimage_closure (L154-L156)
theorem preimage_closure (e : A ≃A[R] B) (S : Set B) : e ⁻¹' closure S = closure (e ⁻¹' S) :=
e.toHomeomorph.preimage_closure S
```

-- snippet 87
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.isClosed_image (L158-L160)
theorem isClosed_image (e : A ≃A[R] B) {S : Set A} : IsClosed (e '' S) ↔ IsClosed S :=
e.toHomeomorph.isClosed_image
```

-- snippet 88
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.coe_toAlgEquiv (L122-L125)
theorem coe_toAlgEquiv (e : A ≃A[R] B) : ⇑e.toAlgEquiv = e := rfl
/-- The natural coercion from a continuous algebra isomorphism
to a continuous linear isomorphism. -/
```

-- snippet 89
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl_symm (L310-L311)
theorem refl_symm : (refl R A).symm = refl R A := rfl
```

-- snippet 90
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.cast_apply (L362-L365)
theorem cast_apply {ι : Type*} {A : ι → Type*} [(i : ι) → Semiring (A i)]
    [(i : ι) → Algebra R (A i)] [(i : ι) → TopologicalSpace (A i)] {i j : ι} (h : i = j) (x : A i) :
    cast (R := R) h x = Equiv.cast (congrArg A h) x := rfl
```

-- snippet 91
```lean
-- Mathlib.Topology.Algebra.Algebra.Equiv.refl_apply (L201-L202)
theorem refl_apply (a : A) : refl R A a = a := rfl
```
[/INST]