Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
import topology.algebra.ring | |
import topology.algebra.open_subgroup | |
import ring_theory.subring | |
import ring_theory.ideal_operations | |
import for_mathlib.topological_groups | |
import for_mathlib.topology | |
universes u v | |
local prefix π:100 := nhds | |
local infixr ` ΓαΆ `:51 := filter.prod | |
variables {A : Type u} {B : Type v} | |
variables [comm_ring A] [topological_space A] [topological_ring A] | |
variables [comm_ring B] [topological_space B] [topological_ring B] | |
open set topological_ring | |
instance subring_has_zero (R : Type u) [comm_ring R] (S : set R) [HS : is_subring S] : has_zero S := | |
β¨β¨0, is_add_submonoid.zero_mem Sβ©β© | |
instance topological_subring (Aβ : set A) [is_subring Aβ] : topological_ring Aβ := | |
{ continuous_neg := continuous_subtype_mk _ $ (continuous_neg A).comp continuous_subtype_val, | |
continuous_add := continuous_subtype_mk _ $ | |
(continuous_subtype_val.comp continuous_fst).add | |
( continuous_subtype_val.comp continuous_snd), | |
continuous_mul := continuous_subtype_mk _ $ | |
(continuous_subtype_val.comp continuous_fst).mul | |
(continuous_subtype_val.comp continuous_snd) } | |
lemma half_nhds {s : set A} (hs : s β (nhds (0 : A))) : | |
β V β (nhds (0 : A)), β v w β V, v * w β s := | |
begin | |
have : ((Ξ»a:AΓA, a.1 * a.2) β»ΒΉ' s) β (nhds ((0, 0) : A Γ A)) := | |
tendsto_mul (by simpa using hs), | |
rw nhds_prod_eq at this, | |
rcases filter.mem_prod_iff.1 this with β¨Vβ, Hβ, Vβ, Hβ, Hβ©, | |
exact β¨Vβ β© Vβ, filter.inter_mem_sets Hβ Hβ, assume v w β¨hv, _β© β¨_, hwβ©, @H (v, w) β¨hv, hwβ©β© | |
end | |
-- lemma continuous_mul_left (a : A) : continuous (Ξ» x, a * x) := | |
-- continuous_mul continuous_const continuous_id | |
-- | |
-- lemma continuous_mul_right (a : A) : continuous (Ξ» x, x * a) := | |
-- continuous_mul continuous_id continuous_const | |
lemma is_open_ideal_map_open_embedding {f : A β B} [is_ring_hom f] | |
(emb : open_embedding f) (I : ideal A) (hI : is_open (βI : set A)) : | |
is_open (β(I.map f) : set B) := | |
open_add_subgroup.is_open_of_open_add_subgroup | |
β¨β¨f '' I, emb.is_open_map _ hI, by apply_instanceβ©, ideal.subset_spanβ© | |
instance pi_topological_ring {I : Type*} {R : I β Type*} [β i, comm_ring (R i)] [β i, topological_space (R i)] | |
[h : β i, topological_ring (R i)] : topological_ring (Ξ (i : I), R i) := | |
{ continuous_add := continuous_piβ (Ξ» i, (h i).continuous_add), | |
continuous_mul := continuous_piβ (Ξ» i, (h i).continuous_mul), | |
continuous_neg := continuous_piβ (Ξ» i, (h i).continuous_neg) } | |
section | |
open function filter | |
lemma topological_ring.of_nice_nhds_zero (Ξ± : Type u) [ring Ξ±] [topological_space Ξ±] | |
(hadd : tendsto (uncurry' ((+) : Ξ± β Ξ± β Ξ±)) (π 0 ΓαΆ π 0) π 0) | |
(hneg : tendsto (Ξ» x, -x : Ξ± β Ξ±) π 0 π 0) | |
(hmul : tendsto (uncurry' ((*) : Ξ± β Ξ± β Ξ±)) (π 0 ΓαΆ π 0) π 0) | |
(hmul_left : β (xβ : Ξ±), tendsto (Ξ» x : Ξ±, xβ * x) π 0 π 0) | |
(hmul_right : β (xβ : Ξ±), tendsto (Ξ» x : Ξ±, x * xβ) π 0 π 0) | |
(hleft : β xβ : Ξ±, π xβ = map (Ξ» x, xβ+x) π 0) : topological_ring Ξ± := | |
begin | |
refine {..topological_add_group.of_nice_nhds_zero Ξ± hadd hneg hleft, ..}, | |
rw continuous_iff_continuous_at, | |
rintro β¨xβ, yββ©, | |
rw [continuous_at, nhds_prod_eq, hleft xβ, hleft yβ, hleft (xβ*yβ), filter.prod_map_map_eq, | |
tendsto_map'_iff], | |
suffices : | |
tendsto ((Ξ» (x : Ξ±), x + xβ * yβ) β (Ξ» (p : Ξ± Γ Ξ±), p.1 + p.2) β | |
(Ξ» (p : Ξ± Γ Ξ±), (p.1*yβ + xβ*p.2, p.1*p.2))) | |
(π 0 ΓαΆ π 0) (map (Ξ» (x : Ξ±), x + xβ * yβ) π 0), | |
{ convert this using 1, | |
{ ext, simp only [comp_app, mul_add, add_mul], abel }, | |
{ simp only [add_comm] } }, | |
refine tendsto_map.comp (hadd.comp (tendsto.prod_mk _ hmul)), | |
{ change tendsto ((Ξ» p : Ξ± Γ Ξ±, p.1 + p.2) β Ξ» (x : Ξ± Γ Ξ±), (x.1 * yβ, xβ * x.2)) (π 0 ΓαΆ π 0) π 0, | |
exact hadd.comp (tendsto.prod_mk ((hmul_right yβ).comp tendsto_fst) | |
((hmul_left xβ).comp tendsto_snd)) } | |
end | |
end | |
local attribute [instance] pointwise_mul pointwise_add | |
class ring_filter_basis (Ξ± : Type u) [ring Ξ±] extends add_group_filter_basis Ξ± := | |
(mul : β {U}, U β sets β β V β sets, V * V β U) | |
(mul_left : β (xβ : Ξ±) {U}, U β sets β β V β sets, V β (Ξ» x, xβ*x) β»ΒΉ' U) | |
(mul_right : β (xβ : Ξ±) {U}, U β sets β β V β sets, V β (Ξ» x, x*xβ) β»ΒΉ' U) | |
namespace ring_filter_basis | |
lemma is_top_ring {Ξ± : Type u} [ring Ξ±] [t : topological_space Ξ±] (b : ring_filter_basis Ξ±) | |
(hnhds : β xβ : Ξ±, π xβ = b.to_add_group_filter_basis.N xβ) : topological_ring Ξ± := | |
begin | |
let basis := b.to_filter_basis, | |
have hnhds0 : π 0 = basis.filter, by rw [hnhds, b.to_add_group_filter_basis.N_zero], | |
apply topological_ring.of_nice_nhds_zero, | |
{ rw [hnhds0, β basis.prod_filter, filter_basis.tendsto_both], | |
intros V V_in, | |
rcases add_group_filter_basis.add V_in with β¨W, W_in, hWβ©, | |
use [set.prod W W, filter_basis.mem_prod_of_mem W_in W_in], | |
rwa [pointwise_add_eq_image, image_subset_iff] at hW }, | |
{ rw [hnhds0, basis.tendsto_both], | |
exact b.neg }, | |
{ rw [hnhds0, β basis.prod_filter, filter_basis.tendsto_both], | |
intros V V_in, | |
rcases ring_filter_basis.mul V_in with β¨W, W_in, hWβ©, | |
use [set.prod W W, filter_basis.mem_prod_of_mem W_in W_in], | |
rwa [pointwise_mul_eq_image, image_subset_iff] at hW }, | |
{ simp only [hnhds0, basis.tendsto_both], | |
exact b.mul_left }, | |
{ simp only [hnhds0, basis.tendsto_both], | |
exact b.mul_right }, | |
{ exact hnhds0.symm βΈ hnhds } | |
end | |
lemma is_topological_ring (Ξ± : Type u) [ring Ξ±] [t : topological_space Ξ±] [b : ring_filter_basis Ξ±] | |
(h : t = b.to_add_group_filter_basis.topology) : topological_ring Ξ± := | |
begin | |
let nice := b.to_add_group_filter_basis.N_is_nice, | |
apply b.is_top_ring, | |
rw h, | |
intro xβ, | |
exact topological_space.nhds_mk_of_nhds _ _ nice.1 nice.2, | |
end | |
local attribute [instance] add_group_filter_basis.topology | |
--meta instance cut_trace : has_bind tactic := by apply_instance | |
def workaround (Ξ± : Type u) [ring Ξ±] [ring_filter_basis Ξ±] : topological_space Ξ± := | |
begin | |
apply add_group_filter_basis.topology, | |
apply_instance, | |
end | |
local attribute [instance] workaround | |
lemma topological_ring (Ξ± : Type u) [ring Ξ±] [b : ring_filter_basis Ξ±] : topological_ring Ξ± := | |
is_topological_ring Ξ± rfl | |
end ring_filter_basis | |
lemma discrete_top_ring {R : Type*} [ring R] [topological_space R] [discrete_topology R] : | |
topological_ring R := | |
{ continuous_mul := continuous_of_discrete_topology, | |
continuous_add := continuous_of_discrete_topology, | |
continuous_neg := continuous_of_discrete_topology } | |