topology.algebra.valued_fieldMathlib.Topology.Algebra.ValuedField

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -212,7 +212,7 @@ noncomputable def extension : hat K → Γ₀ :=
 #align valued.extension Valued.extension
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x y «expr ∈ » V') -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x y «expr ∈ » V') -/
 #print Valued.continuous_extension /-
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
   by
Diff
@@ -62,7 +62,7 @@ theorem Valuation.inversion_estimate {x y : K} {γ : Γ₀ˣ} (y_ne : y ≠ 0)
   have x_ne : x ≠ 0 := by
     intro h
     apply y_ne
-    rw [h, v.map_zero] at key 
+    rw [h, v.map_zero] at key
     exact v.zero_iff.1 key.symm
   have decomp : x⁻¹ - y⁻¹ = x⁻¹ * (y - x) * y⁻¹ := by
     rw [mul_sub_left_distrib, sub_mul, mul_assoc, show y * y⁻¹ = 1 from mul_inv_cancel y_ne,
@@ -98,17 +98,17 @@ instance (priority := 100) Valued.topologicalDivisionRing [Valued K Γ₀] :
       use min (γ * (γ' * γ')) γ'
       intro y y_in
       apply hs
-      simp only [mem_set_of_eq] at y_in 
-      rw [Units.min_val, Units.val_mul, Units.val_mul] at y_in 
+      simp only [mem_set_of_eq] at y_in
+      rw [Units.min_val, Units.val_mul, Units.val_mul] at y_in
       exact Valuation.inversion_estimate _ x_ne y_in }
 #align valued.topological_division_ring Valued.topologicalDivisionRing
 -/
 
 #print ValuedRing.separated /-
 /-- A valued division ring is separated. -/
-instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpace K :=
+instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : T0Space K :=
   by
-  rw [separated_iff_t2]
+  rw [R1Space.t2Space_iff_t0Space]
   apply TopologicalAddGroup.t2Space_of_zero_sep
   intro x x_ne
   refine' ⟨{k | v k < v x}, _, fun h => lt_irrefl _ h⟩
@@ -170,7 +170,7 @@ instance (priority := 100) completable : CompletableTopField K :=
         apply le_of_not_lt _
         intro hyp
         have : x ∈ U ∩ M := ⟨hU hyp, xM⟩
-        rwa [H] at this 
+        rwa [H] at this
       rcases this with ⟨γ₀, M₀, M₀_in, H₀⟩
       rw [Valued.cauchy_iff] at hF ⊢
       refine' ⟨hF.1.map _, _⟩
@@ -188,7 +188,7 @@ instance (priority := 100) completable : CompletableTopField K :=
         replace x_in₀ := H₀ x x_in₀
         replace y_in₀ := H₀ y y_in₀; clear H₀
         apply Valuation.inversion_estimate
-        · have : (v x : Γ₀) ≠ 0 := by intro h; rw [h] at x_in₀ ; simpa using x_in₀
+        · have : (v x : Γ₀) ≠ 0 := by intro h; rw [h] at x_in₀; simpa using x_in₀
           exact (Valuation.ne_zero_iff _).mp this
         · refine' lt_of_lt_of_le H₁ _
           rw [Units.min_val]
@@ -229,7 +229,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       ext x
       rw [Valuation.map_one, mem_preimage, mem_singleton_iff, mem_set_of_eq]
     obtain ⟨V, V_in, hV⟩ : ∃ V ∈ 𝓝 (1 : hat K), ∀ x : K, (x : hat K) ∈ V → (v x : Γ₀) = 1 := by
-      rwa [completion.dense_inducing_coe.nhds_eq_comap, mem_comap] at preimage_one 
+      rwa [completion.dense_inducing_coe.nhds_eq_comap, mem_comap] at preimage_one
     have :
       ∃ V' ∈ 𝓝 (1 : hat K), (0 : hat K) ∉ V' ∧ ∀ (x) (_ : x ∈ V') (y) (_ : y ∈ V'), x * y⁻¹ ∈ V :=
       by
@@ -251,7 +251,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       use U ∩ hatKstar, Filter.inter_mem U_in this
       constructor
       · rintro ⟨h, h'⟩
-        rw [mem_compl_singleton_iff] at h' 
+        rw [mem_compl_singleton_iff] at h'
         exact h' rfl
       · rintro x ⟨hx, _⟩ y ⟨hy, _⟩
         apply hU <;> assumption
@@ -268,7 +268,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
         simp only [mul_assoc, inv_mul_cancel h, mul_one]
       have c : Continuous fun x : hat K => x * x₀⁻¹ := continuous_id.mul continuous_const
       rw [image_eq_preimage_of_inverse l r]
-      rw [← mul_inv_cancel h] at V'_in 
+      rw [← mul_inv_cancel h] at V'_in
       exact c.continuous_at V'_in
     have : ∃ z₀ : K, ∃ y₀ ∈ V', coe z₀ = y₀ * x₀ ∧ z₀ ≠ 0 :=
       by
@@ -366,7 +366,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     rwa [← hy₂]
   · obtain ⟨y, hy₁, hy₂ : ↑y ∈ s⟩ := completion.dense_range_coe.mem_nhds (inter_mem hγ₀ hs)
     replace hy₁ : v y = γ₀; · simpa using hy₁
-    rw [← hy₁] at hx 
+    rw [← hy₁] at hx
     exact ⟨⟨y, ⟨y, hx, rfl⟩⟩, hy₂⟩
 #align valued.closure_coe_completion_v_lt Valued.closure_coe_completion_v_lt
 -/
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Patrick Massot. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Patrick Massot
 -/
-import Mathbin.Topology.Algebra.Valuation
-import Mathbin.Topology.Algebra.WithZeroTopology
-import Mathbin.Topology.Algebra.UniformField
+import Topology.Algebra.Valuation
+import Topology.Algebra.WithZeroTopology
+import Topology.Algebra.UniformField
 
 #align_import topology.algebra.valued_field from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
 
@@ -212,7 +212,7 @@ noncomputable def extension : hat K → Γ₀ :=
 #align valued.extension Valued.extension
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » V') -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x y «expr ∈ » V') -/
 #print Valued.continuous_extension /-
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
   by
Diff
@@ -177,7 +177,7 @@ instance (priority := 100) completable : CompletableTopField K :=
       replace hF := hF.2
       intro γ
       rcases hF (min (γ * γ₀ * γ₀) γ₀) with ⟨M₁, M₁_in, H₁⟩; clear hF
-      use (fun x : K => x⁻¹) '' (M₀ ∩ M₁)
+      use(fun x : K => x⁻¹) '' (M₀ ∩ M₁)
       constructor
       · rw [mem_map]
         apply mem_of_superset (Filter.inter_mem M₀_in M₁_in)
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Patrick Massot. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Patrick Massot
-
-! This file was ported from Lean 3 source module topology.algebra.valued_field
-! leanprover-community/mathlib commit 2ebc1d6c2fed9f54c95bbc3998eaa5570527129a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Topology.Algebra.Valuation
 import Mathbin.Topology.Algebra.WithZeroTopology
 import Mathbin.Topology.Algebra.UniformField
 
+#align_import topology.algebra.valued_field from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
+
 /-!
 # Valued fields and their completions
 
@@ -215,7 +212,7 @@ noncomputable def extension : hat K → Γ₀ :=
 #align valued.extension Valued.extension
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x y «expr ∈ » V') -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » V') -/
 #print Valued.continuous_extension /-
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
   by
Diff
@@ -50,6 +50,7 @@ section InversionEstimate
 
 variable (v : Valuation K Γ₀)
 
+#print Valuation.inversion_estimate /-
 -- The following is the main technical lemma ensuring that inversion is continuous
 -- in the topology induced by a valuation on a division ring (ie the next instance)
 -- and the fact that a valued field is completable
@@ -78,6 +79,7 @@ theorem Valuation.inversion_estimate {x y : K} {γ : Γ₀ˣ} (y_ne : y ≠ 0)
     _ = (v <| x - y) * (v y * v y)⁻¹ := by rw [Valuation.map_sub_swap]
     _ < γ := hyp1'
 #align valuation.inversion_estimate Valuation.inversion_estimate
+-/
 
 end InversionEstimate
 
@@ -126,6 +128,7 @@ open scoped WithZeroTopology
 
 open Valued
 
+#print Valued.continuous_valuation /-
 theorem Valued.continuous_valuation [Valued K Γ₀] : Continuous (v : K → Γ₀) :=
   by
   rw [continuous_iff_continuousAt]
@@ -139,6 +142,7 @@ theorem Valued.continuous_valuation [Valued K Γ₀] : Continuous (v : K → Γ
     rw [ContinuousAt, WithZeroTopology.tendsto_of_ne_zero v_ne]
     apply Valued.loc_const v_ne
 #align valued.continuous_valuation Valued.continuous_valuation
+-/
 
 end
 
@@ -152,9 +156,6 @@ open UniformSpace
 
 variable {K : Type _} [Field K] {Γ₀ : Type _} [LinearOrderedCommGroupWithZero Γ₀] [hv : Valued K Γ₀]
 
-include hv
-
--- mathport name: exprhat
 local notation "hat " => Completion
 
 #print Valued.completable /-
@@ -215,6 +216,7 @@ noncomputable def extension : hat K → Γ₀ :=
 -/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x y «expr ∈ » V') -/
+#print Valued.continuous_extension /-
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
   by
   refine' completion.dense_inducing_coe.continuous_extend _
@@ -294,7 +296,9 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       _ = v (a * z₀⁻¹) * v z₀ := (Valuation.map_mul _ _ _)
       _ = v z₀ := by rw [this, one_mul]
 #align valued.continuous_extension Valued.continuous_extension
+-/
 
+#print Valued.extension_extends /-
 @[simp, norm_cast]
 theorem extension_extends (x : K) : extension (x : hat K) = v x :=
   by
@@ -302,6 +306,7 @@ theorem extension_extends (x : K) : extension (x : hat K) = v x :=
   rw [← completion.dense_inducing_coe.nhds_eq_comap]
   exact valued.continuous_valuation.continuous_at
 #align valued.extension_extends Valued.extension_extends
+-/
 
 #print Valued.extensionValuation /-
 /-- the extension of a valuation on a division ring to its completion. -/
@@ -338,6 +343,7 @@ noncomputable def extensionValuation : Valuation (hat K) Γ₀
 #align valued.extension_valuation Valued.extensionValuation
 -/
 
+#print Valued.closure_coe_completion_v_lt /-
 -- Bourbaki CA VI §5 no.3 Proposition 5 (d)
 theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     closure (coe '' {x : K | v x < (γ : Γ₀)}) = {x : hat K | extensionValuation x < (γ : Γ₀)} :=
@@ -366,6 +372,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     rw [← hy₁] at hx 
     exact ⟨⟨y, ⟨y, hx, rfl⟩⟩, hy₂⟩
 #align valued.closure_coe_completion_v_lt Valued.closure_coe_completion_v_lt
+-/
 
 #print Valued.valuedCompletion /-
 noncomputable instance valuedCompletion : Valued (hat K) Γ₀
@@ -383,10 +390,12 @@ noncomputable instance valuedCompletion : Valued (hat K) Γ₀
 #align valued.valued_completion Valued.valuedCompletion
 -/
 
+#print Valued.valuedCompletion_apply /-
 @[simp, norm_cast]
 theorem valuedCompletion_apply (x : K) : Valued.v (x : hat K) = v x :=
   extension_extends x
 #align valued.valued_completion_apply Valued.valuedCompletion_apply
+-/
 
 end Valued
 
Diff
@@ -77,7 +77,6 @@ theorem Valuation.inversion_estimate {x y : K} {γ : Γ₀ˣ} (y_ne : y ≠ 0)
     _ = (v <| y - x) * (v y * v y)⁻¹ := rfl
     _ = (v <| x - y) * (v y * v y)⁻¹ := by rw [Valuation.map_sub_swap]
     _ < γ := hyp1'
-    
 #align valuation.inversion_estimate Valuation.inversion_estimate
 
 end InversionEstimate
@@ -201,7 +200,6 @@ instance (priority := 100) completable : CompletableTopField K :=
             calc
               ↑γ₀ * ↑γ₀ ≤ ↑γ₀ * v x := mul_le_mul_left' x_in₀ ↑γ₀
               _ ≤ _ := mul_le_mul_right' x_in₀ (v x)
-              
           rw [Units.val_mul]
           exact mul_le_mul_left' this γ }
 #align valued.completable Valued.completable
@@ -295,7 +293,6 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       v a = v (a * z₀⁻¹ * z₀) := by rw [mul_assoc, inv_mul_cancel z₀_ne, mul_one]
       _ = v (a * z₀⁻¹) * v z₀ := (Valuation.map_mul _ _ _)
       _ = v z₀ := by rw [this, one_mul]
-      
 #align valued.continuous_extension Valued.continuous_extension
 
 @[simp, norm_cast]
Diff
@@ -216,7 +216,7 @@ noncomputable def extension : hat K → Γ₀ :=
 #align valued.extension Valued.extension
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » V') -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x y «expr ∈ » V') -/
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
   by
   refine' completion.dense_inducing_coe.continuous_extend _
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Patrick Massot
 
 ! This file was ported from Lean 3 source module topology.algebra.valued_field
-! leanprover-community/mathlib commit 3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064
+! leanprover-community/mathlib commit 2ebc1d6c2fed9f54c95bbc3998eaa5570527129a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Topology.Algebra.UniformField
 /-!
 # Valued fields and their completions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we study the topology of a field `K` endowed with a valuation (in our application
 to adic spaces, `K` will be the valuation field associated to some valuation on a ring, defined in
 valuation.basic).
@@ -91,7 +94,7 @@ instance (priority := 100) Valued.topologicalDivisionRing [Valued K Γ₀] :
       intro x x_ne s s_in
       cases' valued.mem_nhds.mp s_in with γ hs; clear s_in
       rw [mem_map, Valued.mem_nhds]
-      change ∃ γ : Γ₀ˣ, { y : K | (v (y - x) : Γ₀) < γ } ⊆ { x : K | x⁻¹ ∈ s }
+      change ∃ γ : Γ₀ˣ, {y : K | (v (y - x) : Γ₀) < γ} ⊆ {x : K | x⁻¹ ∈ s}
       have vx_ne := (Valuation.ne_zero_iff <| v).mpr x_ne
       let γ' := Units.mk0 _ vx_ne
       use min (γ * (γ' * γ')) γ'
@@ -110,7 +113,7 @@ instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpac
   rw [separated_iff_t2]
   apply TopologicalAddGroup.t2Space_of_zero_sep
   intro x x_ne
-  refine' ⟨{ k | v k < v x }, _, fun h => lt_irrefl _ h⟩
+  refine' ⟨{k | v k < v x}, _, fun h => lt_irrefl _ h⟩
   rw [Valued.mem_nhds]
   have vx_ne := (Valuation.ne_zero_iff <| v).mpr x_ne
   let γ' := Units.mk0 _ vx_ne
@@ -280,7 +283,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
     have vz₀_ne : (v z₀ : Γ₀) ≠ 0 := by rwa [Valuation.ne_zero_iff]
     refine' ⟨v z₀, _⟩
     rw [WithZeroTopology.tendsto_of_ne_zero vz₀_ne, eventually_comap]
-    filter_upwards [nhds_right]with x x_in a ha
+    filter_upwards [nhds_right] with x x_in a ha
     rcases x_in with ⟨y, y_in, rfl⟩
     have : (v (a * z₀⁻¹) : Γ₀) = 1 := by
       apply hV
@@ -340,11 +343,11 @@ noncomputable def extensionValuation : Valuation (hat K) Γ₀
 
 -- Bourbaki CA VI §5 no.3 Proposition 5 (d)
 theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
-    closure (coe '' { x : K | v x < (γ : Γ₀) }) = { x : hat K | extensionValuation x < (γ : Γ₀) } :=
+    closure (coe '' {x : K | v x < (γ : Γ₀)}) = {x : hat K | extensionValuation x < (γ : Γ₀)} :=
   by
   ext x
   let γ₀ := extension_valuation x
-  suffices γ₀ ≠ 0 → (x ∈ closure (coe '' { x : K | v x < (γ : Γ₀) }) ↔ γ₀ < (γ : Γ₀))
+  suffices γ₀ ≠ 0 → (x ∈ closure (coe '' {x : K | v x < (γ : Γ₀)}) ↔ γ₀ < (γ : Γ₀))
     by
     cases eq_or_ne γ₀ 0
     · simp only [h, (Valuation.zero_iff _).mp h, mem_set_of_eq, Valuation.map_zero, Units.zero_lt,
@@ -374,7 +377,7 @@ noncomputable instance valuedCompletion : Valued (hat K) Γ₀
   is_topological_valuation s :=
     by
     suffices
-      has_basis (𝓝 (0 : hat K)) (fun _ => True) fun γ : Γ₀ˣ => { x | extension_valuation x < γ }
+      has_basis (𝓝 (0 : hat K)) (fun _ => True) fun γ : Γ₀ˣ => {x | extension_valuation x < γ}
       by
       rw [this.mem_iff]
       exact exists_congr fun γ => by simp
Diff
@@ -81,6 +81,7 @@ end InversionEstimate
 
 open Valued
 
+#print Valued.topologicalDivisionRing /-
 /-- The topology coming from a valuation on a division ring makes it a topological division ring
     [BouAC, VI.5.1 middle of Proposition 1] -/
 instance (priority := 100) Valued.topologicalDivisionRing [Valued K Γ₀] :
@@ -100,7 +101,9 @@ instance (priority := 100) Valued.topologicalDivisionRing [Valued K Γ₀] :
       rw [Units.min_val, Units.val_mul, Units.val_mul] at y_in 
       exact Valuation.inversion_estimate _ x_ne y_in }
 #align valued.topological_division_ring Valued.topologicalDivisionRing
+-/
 
+#print ValuedRing.separated /-
 /-- A valued division ring is separated. -/
 instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpace K :=
   by
@@ -113,6 +116,7 @@ instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpac
   let γ' := Units.mk0 _ vx_ne
   exact ⟨γ', fun y hy => by simpa using hy⟩
 #align valued_ring.separated ValuedRing.separated
+-/
 
 section
 
@@ -151,6 +155,7 @@ include hv
 -- mathport name: exprhat
 local notation "hat " => Completion
 
+#print Valued.completable /-
 /-- A valued field is completable. -/
 instance (priority := 100) completable : CompletableTopField K :=
   { ValuedRing.separated with
@@ -197,13 +202,16 @@ instance (priority := 100) completable : CompletableTopField K :=
           rw [Units.val_mul]
           exact mul_le_mul_left' this γ }
 #align valued.completable Valued.completable
+-/
 
 open scoped WithZeroTopology
 
+#print Valued.extension /-
 /-- The extension of the valuation of a valued field to the completion of the field. -/
 noncomputable def extension : hat K → Γ₀ :=
   Completion.denseInducing_coe.extend (v : K → Γ₀)
 #align valued.extension Valued.extension
+-/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » V') -/
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
@@ -295,6 +303,7 @@ theorem extension_extends (x : K) : extension (x : hat K) = v x :=
   exact valued.continuous_valuation.continuous_at
 #align valued.extension_extends Valued.extension_extends
 
+#print Valued.extensionValuation /-
 /-- the extension of a valuation on a division ring to its completion. -/
 noncomputable def extensionValuation : Valuation (hat K) Γ₀
     where
@@ -327,6 +336,7 @@ noncomputable def extensionValuation : Valuation (hat K) Γ₀
       rw [← le_max_iff]
       exact v.map_add x y
 #align valued.extension_valuation Valued.extensionValuation
+-/
 
 -- Bourbaki CA VI §5 no.3 Proposition 5 (d)
 theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
@@ -357,6 +367,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     exact ⟨⟨y, ⟨y, hx, rfl⟩⟩, hy₂⟩
 #align valued.closure_coe_completion_v_lt Valued.closure_coe_completion_v_lt
 
+#print Valued.valuedCompletion /-
 noncomputable instance valuedCompletion : Valued (hat K) Γ₀
     where
   V := extensionValuation
@@ -370,6 +381,7 @@ noncomputable instance valuedCompletion : Valued (hat K) Γ₀
     simp_rw [← closure_coe_completion_v_lt]
     exact (has_basis_nhds_zero K Γ₀).hasBasis_of_denseInducing completion.dense_inducing_coe
 #align valued.valued_completion Valued.valuedCompletion
+-/
 
 @[simp, norm_cast]
 theorem valuedCompletion_apply (x : K) : Valued.v (x : hat K) = v x :=
Diff
@@ -61,7 +61,7 @@ theorem Valuation.inversion_estimate {x y : K} {γ : Γ₀ˣ} (y_ne : y ≠ 0)
   have x_ne : x ≠ 0 := by
     intro h
     apply y_ne
-    rw [h, v.map_zero] at key
+    rw [h, v.map_zero] at key 
     exact v.zero_iff.1 key.symm
   have decomp : x⁻¹ - y⁻¹ = x⁻¹ * (y - x) * y⁻¹ := by
     rw [mul_sub_left_distrib, sub_mul, mul_assoc, show y * y⁻¹ = 1 from mul_inv_cancel y_ne,
@@ -96,8 +96,8 @@ instance (priority := 100) Valued.topologicalDivisionRing [Valued K Γ₀] :
       use min (γ * (γ' * γ')) γ'
       intro y y_in
       apply hs
-      simp only [mem_set_of_eq] at y_in
-      rw [Units.min_val, Units.val_mul, Units.val_mul] at y_in
+      simp only [mem_set_of_eq] at y_in 
+      rw [Units.min_val, Units.val_mul, Units.val_mul] at y_in 
       exact Valuation.inversion_estimate _ x_ne y_in }
 #align valued.topological_division_ring Valued.topologicalDivisionRing
 
@@ -165,9 +165,9 @@ instance (priority := 100) completable : CompletableTopField K :=
         apply le_of_not_lt _
         intro hyp
         have : x ∈ U ∩ M := ⟨hU hyp, xM⟩
-        rwa [H] at this
+        rwa [H] at this 
       rcases this with ⟨γ₀, M₀, M₀_in, H₀⟩
-      rw [Valued.cauchy_iff] at hF⊢
+      rw [Valued.cauchy_iff] at hF ⊢
       refine' ⟨hF.1.map _, _⟩
       replace hF := hF.2
       intro γ
@@ -183,7 +183,7 @@ instance (priority := 100) completable : CompletableTopField K :=
         replace x_in₀ := H₀ x x_in₀
         replace y_in₀ := H₀ y y_in₀; clear H₀
         apply Valuation.inversion_estimate
-        · have : (v x : Γ₀) ≠ 0 := by intro h; rw [h] at x_in₀; simpa using x_in₀
+        · have : (v x : Γ₀) ≠ 0 := by intro h; rw [h] at x_in₀ ; simpa using x_in₀
           exact (Valuation.ne_zero_iff _).mp this
         · refine' lt_of_lt_of_le H₁ _
           rw [Units.min_val]
@@ -221,7 +221,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       ext x
       rw [Valuation.map_one, mem_preimage, mem_singleton_iff, mem_set_of_eq]
     obtain ⟨V, V_in, hV⟩ : ∃ V ∈ 𝓝 (1 : hat K), ∀ x : K, (x : hat K) ∈ V → (v x : Γ₀) = 1 := by
-      rwa [completion.dense_inducing_coe.nhds_eq_comap, mem_comap] at preimage_one
+      rwa [completion.dense_inducing_coe.nhds_eq_comap, mem_comap] at preimage_one 
     have :
       ∃ V' ∈ 𝓝 (1 : hat K), (0 : hat K) ∉ V' ∧ ∀ (x) (_ : x ∈ V') (y) (_ : y ∈ V'), x * y⁻¹ ∈ V :=
       by
@@ -243,7 +243,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       use U ∩ hatKstar, Filter.inter_mem U_in this
       constructor
       · rintro ⟨h, h'⟩
-        rw [mem_compl_singleton_iff] at h'
+        rw [mem_compl_singleton_iff] at h' 
         exact h' rfl
       · rintro x ⟨hx, _⟩ y ⟨hy, _⟩
         apply hU <;> assumption
@@ -260,7 +260,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
         simp only [mul_assoc, inv_mul_cancel h, mul_one]
       have c : Continuous fun x : hat K => x * x₀⁻¹ := continuous_id.mul continuous_const
       rw [image_eq_preimage_of_inverse l r]
-      rw [← mul_inv_cancel h] at V'_in
+      rw [← mul_inv_cancel h] at V'_in 
       exact c.continuous_at V'_in
     have : ∃ z₀ : K, ∃ y₀ ∈ V', coe z₀ = y₀ * x₀ ∧ z₀ ≠ 0 :=
       by
@@ -340,7 +340,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     · simp only [h, (Valuation.zero_iff _).mp h, mem_set_of_eq, Valuation.map_zero, Units.zero_lt,
         iff_true_iff]
       apply subset_closure
-      exact ⟨0, by simpa only [mem_set_of_eq, Valuation.map_zero, Units.zero_lt, true_and_iff] ⟩
+      exact ⟨0, by simpa only [mem_set_of_eq, Valuation.map_zero, Units.zero_lt, true_and_iff]⟩
     · exact this h
   intro h
   have hγ₀ : extension ⁻¹' {γ₀} ∈ 𝓝 x :=
@@ -353,7 +353,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     rwa [← hy₂]
   · obtain ⟨y, hy₁, hy₂ : ↑y ∈ s⟩ := completion.dense_range_coe.mem_nhds (inter_mem hγ₀ hs)
     replace hy₁ : v y = γ₀; · simpa using hy₁
-    rw [← hy₁] at hx
+    rw [← hy₁] at hx 
     exact ⟨⟨y, ⟨y, hx, rfl⟩⟩, hy₂⟩
 #align valued.closure_coe_completion_v_lt Valued.closure_coe_completion_v_lt
 
Diff
@@ -35,7 +35,7 @@ Then we extend the valuation given on `K` to a valuation on `hat K`.
 
 open Filter Set
 
-open Topology
+open scoped Topology
 
 section DivisionRing
 
@@ -116,7 +116,7 @@ instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpac
 
 section
 
-open WithZeroTopology
+open scoped WithZeroTopology
 
 open Valued
 
@@ -198,7 +198,7 @@ instance (priority := 100) completable : CompletableTopField K :=
           exact mul_le_mul_left' this γ }
 #align valued.completable Valued.completable
 
-open WithZeroTopology
+open scoped WithZeroTopology
 
 /-- The extension of the valuation of a valued field to the completion of the field. -/
 noncomputable def extension : hat K → Γ₀ :=
Diff
@@ -171,8 +171,7 @@ instance (priority := 100) completable : CompletableTopField K :=
       refine' ⟨hF.1.map _, _⟩
       replace hF := hF.2
       intro γ
-      rcases hF (min (γ * γ₀ * γ₀) γ₀) with ⟨M₁, M₁_in, H₁⟩
-      clear hF
+      rcases hF (min (γ * γ₀ * γ₀) γ₀) with ⟨M₁, M₁_in, H₁⟩; clear hF
       use (fun x : K => x⁻¹) '' (M₀ ∩ M₁)
       constructor
       · rw [mem_map]
@@ -182,13 +181,9 @@ instance (priority := 100) completable : CompletableTopField K :=
         simp only [mem_set_of_eq]
         specialize H₁ x x_in₁ y y_in₁
         replace x_in₀ := H₀ x x_in₀
-        replace y_in₀ := H₀ y y_in₀
-        clear H₀
+        replace y_in₀ := H₀ y y_in₀; clear H₀
         apply Valuation.inversion_estimate
-        · have : (v x : Γ₀) ≠ 0 := by
-            intro h
-            rw [h] at x_in₀
-            simpa using x_in₀
+        · have : (v x : Γ₀) ≠ 0 := by intro h; rw [h] at x_in₀; simpa using x_in₀
           exact (Valuation.ne_zero_iff _).mp this
         · refine' lt_of_lt_of_le H₁ _
           rw [Units.min_val]
@@ -221,9 +216,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
     exact valued.continuous_valuation.tendsto' 0 0 (map_zero v)
   · have preimage_one : v ⁻¹' {(1 : Γ₀)} ∈ 𝓝 (1 : K) :=
       by
-      have : (v (1 : K) : Γ₀) ≠ 0 := by
-        rw [Valuation.map_one]
-        exact zero_ne_one.symm
+      have : (v (1 : K) : Γ₀) ≠ 0 := by rw [Valuation.map_one]; exact zero_ne_one.symm
       convert Valued.loc_const this
       ext x
       rw [Valuation.map_one, mem_preimage, mem_singleton_iff, mem_set_of_eq]
@@ -306,9 +299,7 @@ theorem extension_extends (x : K) : extension (x : hat K) = v x :=
 noncomputable def extensionValuation : Valuation (hat K) Γ₀
     where
   toFun := Valued.extension
-  map_zero' := by
-    rw [← v.map_zero, ← Valued.extension_extends (0 : K)]
-    rfl
+  map_zero' := by rw [← v.map_zero, ← Valued.extension_extends (0 : K)]; rfl
   map_one' := by
     rw [← completion.coe_one, Valued.extension_extends (1 : K)]
     exact Valuation.map_one _
@@ -358,12 +349,10 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
   rw [mem_closure_iff_nhds']
   refine' ⟨fun hx => _, fun hx s hs => _⟩
   · obtain ⟨⟨-, y, hy₁ : v y < (γ : Γ₀), rfl⟩, hy₂⟩ := hx _ hγ₀
-    replace hy₂ : v y = γ₀
-    · simpa using hy₂
+    replace hy₂ : v y = γ₀; · simpa using hy₂
     rwa [← hy₂]
   · obtain ⟨y, hy₁, hy₂ : ↑y ∈ s⟩ := completion.dense_range_coe.mem_nhds (inter_mem hγ₀ hs)
-    replace hy₁ : v y = γ₀
-    · simpa using hy₁
+    replace hy₁ : v y = γ₀; · simpa using hy₁
     rw [← hy₁] at hx
     exact ⟨⟨y, ⟨y, hx, rfl⟩⟩, hy₂⟩
 #align valued.closure_coe_completion_v_lt Valued.closure_coe_completion_v_lt
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Patrick Massot
 
 ! This file was ported from Lean 3 source module topology.algebra.valued_field
-! leanprover-community/mathlib commit a8e7ac804fc39df0340c64906075787e0c90fa60
+! leanprover-community/mathlib commit 3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -116,7 +116,7 @@ instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpac
 
 section
 
-attribute [local instance] LinearOrderedCommGroupWithZero.topologicalSpace
+open WithZeroTopology
 
 open Valued
 
@@ -125,12 +125,12 @@ theorem Valued.continuous_valuation [Valued K Γ₀] : Continuous (v : K → Γ
   rw [continuous_iff_continuousAt]
   intro x
   rcases eq_or_ne x 0 with (rfl | h)
-  · rw [ContinuousAt, map_zero, LinearOrderedCommGroupWithZero.tendsto_zero]
+  · rw [ContinuousAt, map_zero, WithZeroTopology.tendsto_zero]
     intro γ hγ
     rw [Filter.Eventually, Valued.mem_nhds_zero]
     use Units.mk0 γ hγ, subset.rfl
   · have v_ne : (v x : Γ₀) ≠ 0 := (Valuation.ne_zero_iff _).mpr h
-    rw [ContinuousAt, LinearOrderedCommGroupWithZero.tendsto_of_ne_zero v_ne]
+    rw [ContinuousAt, WithZeroTopology.tendsto_of_ne_zero v_ne]
     apply Valued.loc_const v_ne
 #align valued.continuous_valuation Valued.continuous_valuation
 
@@ -203,7 +203,7 @@ instance (priority := 100) completable : CompletableTopField K :=
           exact mul_le_mul_left' this γ }
 #align valued.completable Valued.completable
 
-attribute [local instance] LinearOrderedCommGroupWithZero.topologicalSpace
+open WithZeroTopology
 
 /-- The extension of the valuation of a valued field to the completion of the field. -/
 noncomputable def extension : hat K → Γ₀ :=
@@ -278,7 +278,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
     rcases this with ⟨z₀, y₀, y₀_in, hz₀, z₀_ne⟩
     have vz₀_ne : (v z₀ : Γ₀) ≠ 0 := by rwa [Valuation.ne_zero_iff]
     refine' ⟨v z₀, _⟩
-    rw [LinearOrderedCommGroupWithZero.tendsto_of_ne_zero vz₀_ne, eventually_comap]
+    rw [WithZeroTopology.tendsto_of_ne_zero vz₀_ne, eventually_comap]
     filter_upwards [nhds_right]with x x_in a ha
     rcases x_in with ⟨y, y_in, rfl⟩
     have : (v (a * z₀⁻¹) : Γ₀) = 1 := by
@@ -354,7 +354,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
   intro h
   have hγ₀ : extension ⁻¹' {γ₀} ∈ 𝓝 x :=
     continuous_extension.continuous_at.preimage_mem_nhds
-      (LinearOrderedCommGroupWithZero.singleton_mem_nhds_of_ne_zero h)
+      (WithZeroTopology.singleton_mem_nhds_of_ne_zero h)
   rw [mem_closure_iff_nhds']
   refine' ⟨fun hx => _, fun hx s hs => _⟩
   · obtain ⟨⟨-, y, hy₁ : v y < (γ : Γ₀), rfl⟩, hy₂⟩ := hx _ hγ₀
Diff
@@ -210,7 +210,7 @@ noncomputable def extension : hat K → Γ₀ :=
   Completion.denseInducing_coe.extend (v : K → Γ₀)
 #align valued.extension Valued.extension
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x y «expr ∈ » V') -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » V') -/
 theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :=
   by
   refine' completion.dense_inducing_coe.continuous_extend _
@@ -289,7 +289,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       solve_by_elim
     calc
       v a = v (a * z₀⁻¹ * z₀) := by rw [mul_assoc, inv_mul_cancel z₀_ne, mul_one]
-      _ = v (a * z₀⁻¹) * v z₀ := Valuation.map_mul _ _ _
+      _ = v (a * z₀⁻¹) * v z₀ := (Valuation.map_mul _ _ _)
       _ = v z₀ := by rw [this, one_mul]
       
 #align valued.continuous_extension Valued.continuous_extension
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Patrick Massot
 
 ! This file was ported from Lean 3 source module topology.algebra.valued_field
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit a8e7ac804fc39df0340c64906075787e0c90fa60
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -382,5 +382,10 @@ noncomputable instance valuedCompletion : Valued (hat K) Γ₀
     exact (has_basis_nhds_zero K Γ₀).hasBasis_of_denseInducing completion.dense_inducing_coe
 #align valued.valued_completion Valued.valuedCompletion
 
+@[simp, norm_cast]
+theorem valuedCompletion_apply (x : K) : Valued.v (x : hat K) = v x :=
+  extension_extends x
+#align valued.valued_completion_apply Valued.valuedCompletion_apply
+
 end Valued
 

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -268,7 +268,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
       solve_by_elim
     calc
       v a = v (a * z₀⁻¹ * z₀) := by rw [mul_assoc, inv_mul_cancel z₀_ne, mul_one]
-      _ = v (a * z₀⁻¹) * v z₀ := (Valuation.map_mul _ _ _)
+      _ = v (a * z₀⁻¹) * v z₀ := Valuation.map_mul _ _ _
       _ = v z₀ := by rw [this, one_mul]
 #align valued.continuous_extension Valued.continuous_extension
 
refactor(UniformSpace): drop separationRel (#10644)

We had duplicated API between topological spaces and uniform spaces. In this PR I mostly deduplicate it with some exceptions:

  • SeparationQuotient.lift' and SeparationQuotient.map are leftovers from the old version that are designed to work with uniform spaces;
  • probably, some theorems/instances still assume UniformSpace when TopologicalSpace would work.

Outside of UniformSpace/Separation, I mostly changed SeparatedSpace to T0Space and separationRel to Inseparable. I also rewrote a few proofs that were broken by the API change.

Fixes #2031

Diff
@@ -97,8 +97,8 @@ instance (priority := 100) Valued.topologicalDivisionRing [Valued K Γ₀] :
 #align valued.topological_division_ring Valued.topologicalDivisionRing
 
 /-- A valued division ring is separated. -/
-instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : SeparatedSpace K := by
-  rw [separated_iff_t2]
+instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : T0Space K := by
+  suffices T2Space K by infer_instance
   apply TopologicalAddGroup.t2Space_of_zero_sep
   intro x x_ne
   refine' ⟨{ k | v k < v x }, _, fun h => lt_irrefl _ h⟩
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -335,12 +335,10 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
   rw [mem_closure_iff_nhds']
   refine' ⟨fun hx => _, fun hx s hs => _⟩
   · obtain ⟨⟨-, y, hy₁ : v y < (γ : Γ₀), rfl⟩, hy₂⟩ := hx _ hγ₀
-    replace hy₂ : v y = γ₀
-    · simpa using hy₂
+    replace hy₂ : v y = γ₀ := by simpa using hy₂
     rwa [← hy₂]
   · obtain ⟨y, hy₁, hy₂⟩ := Completion.denseRange_coe.mem_nhds (inter_mem hγ₀ hs)
-    replace hy₁ : v y = γ₀
-    · simpa using hy₁
+    replace hy₁ : v y = γ₀ := by simpa using hy₁
     rw [← hy₁] at hx
     exact ⟨⟨y, ⟨y, hx, rfl⟩⟩, hy₂⟩
 #align valued.closure_coe_completion_v_lt Valued.closure_coe_completion_v_lt
chore: uneven spacing for ⟨ ⟩ (#10014)

This cleans up instances of

⟨ foo, bar⟩

and

⟨foo, bar ⟩

where spaces a on the inside one side, but not on the other side. Fixing this by removing the extra space.

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -326,7 +326,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
     · simp only [h, (Valuation.zero_iff _).mp h, mem_setOf_eq, Valuation.map_zero, Units.zero_lt,
         iff_true_iff]
       apply subset_closure
-      exact ⟨0, by simp only [mem_setOf_eq, Valuation.map_zero, Units.zero_lt, true_and_iff]; rfl ⟩
+      exact ⟨0, by simp only [mem_setOf_eq, Valuation.map_zero, Units.zero_lt, true_and_iff]; rfl⟩
     · exact this h
   intro h
   have hγ₀ : extension ⁻¹' {γ₀} ∈ 𝓝 x :=
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -322,7 +322,7 @@ theorem closure_coe_completion_v_lt {γ : Γ₀ˣ} :
   ext x
   let γ₀ := extensionValuation x
   suffices γ₀ ≠ 0 → (x ∈ closure ((↑) '' { x : K | v x < (γ : Γ₀) }) ↔ γ₀ < (γ : Γ₀)) by
-    cases' eq_or_ne γ₀ 0 with h h
+    rcases eq_or_ne γ₀ 0 with h | h
     · simp only [h, (Valuation.zero_iff _).mp h, mem_setOf_eq, Valuation.map_zero, Units.zero_lt,
         iff_true_iff]
       apply subset_closure
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -167,11 +167,10 @@ instance (priority := 100) completable : CompletableTopField K :=
       · rw [mem_map]
         apply mem_of_superset (Filter.inter_mem M₀_in M₁_in)
         exact subset_preimage_image _ _
-      · rintro _ ⟨x, ⟨x_in₀, x_in₁⟩, rfl⟩ _ ⟨y, ⟨y_in₀, y_in₁⟩, rfl⟩
+      · rintro _ ⟨x, ⟨x_in₀, x_in₁⟩, rfl⟩ _ ⟨y, ⟨_, y_in₁⟩, rfl⟩
         simp only [mem_setOf_eq]
         specialize H₁ x x_in₁ y y_in₁
         replace x_in₀ := H₀ x x_in₀
-        replace := H₀ y y_in₀
         clear H₀
         apply Valuation.inversion_estimate
         · have : (v x : Γ₀) ≠ 0 := by
chore: cleanup typo in filter_upwards (#7719)

mathport was forgetting a space in filter_upwards [...]with instead of filter_upwards [...] with.

Diff
@@ -259,7 +259,7 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
     have vz₀_ne : (v z₀ : Γ₀) ≠ 0 := by rwa [Valuation.ne_zero_iff]
     refine' ⟨v z₀, _⟩
     rw [WithZeroTopology.tendsto_of_ne_zero vz₀_ne, eventually_comap]
-    filter_upwards [nhds_right]with x x_in a ha
+    filter_upwards [nhds_right] with x x_in a ha
     rcases x_in with ⟨y, y_in, rfl⟩
     have : (v (a * z₀⁻¹) : Γ₀) = 1 := by
       apply hV
chore: fix nonterminal simps (#7497)

Fixes the nonterminal simps identified by #7496

Diff
@@ -287,7 +287,7 @@ noncomputable def extensionValuation : Valuation (hat K) Γ₀ where
     rw [← v.map_zero (R := K), ← Valued.extension_extends (0 : K)]
     rfl
   map_one' := by
-    simp
+    simp only
     rw [← Completion.coe_one, Valued.extension_extends (1 : K)]
     exact Valuation.map_one _
   map_mul' x y := by
style: fix multiple spaces before colon (#7411)

Purely cosmetic PR

Diff
@@ -171,7 +171,7 @@ instance (priority := 100) completable : CompletableTopField K :=
         simp only [mem_setOf_eq]
         specialize H₁ x x_in₁ y y_in₁
         replace x_in₀ := H₀ x x_in₀
-        replace  := H₀ y y_in₀
+        replace := H₀ y y_in₀
         clear H₀
         apply Valuation.inversion_estimate
         · have : (v x : Γ₀) ≠ 0 := by
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -311,7 +311,6 @@ noncomputable def extensionValuation : Valuation (hat K) Γ₀ where
         (isClosed_le (cont.comp continuous_add) <| cont.comp continuous_fst).union
           (isClosed_le (cont.comp continuous_add) <| cont.comp continuous_snd)
     · intro x y
-      dsimp
       norm_cast
       rw [← le_max_iff]
       exact v.map_add x y
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -36,7 +36,7 @@ open Topology
 
 section DivisionRing
 
-variable {K : Type _} [DivisionRing K] {Γ₀ : Type _} [LinearOrderedCommGroupWithZero Γ₀]
+variable {K : Type*} [DivisionRing K] {Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀]
 
 section ValuationTopologicalDivisionRing
 
@@ -137,7 +137,7 @@ namespace Valued
 
 open UniformSpace
 
-variable {K : Type _} [Field K] {Γ₀ : Type _} [LinearOrderedCommGroupWithZero Γ₀] [hv : Valued K Γ₀]
+variable {K : Type*} [Field K] {Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] [hv : Valued K Γ₀]
 
 local notation "hat " => Completion
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Patrick Massot. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Patrick Massot
-
-! This file was ported from Lean 3 source module topology.algebra.valued_field
-! leanprover-community/mathlib commit 3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Topology.Algebra.Valuation
 import Mathlib.Topology.Algebra.WithZeroTopology
 import Mathlib.Topology.Algebra.UniformField
 
+#align_import topology.algebra.valued_field from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064"
+
 /-!
 # Valued fields and their completions
 
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊢ -> some_tactic at h ⊢
  • some_tactic at h -> some_tactic at h
Diff
@@ -159,7 +159,7 @@ instance (priority := 100) completable : CompletableTopField K :=
         have : x ∈ U ∩ M := ⟨hU hyp, xM⟩
         rwa [H] at this
       rcases this with ⟨γ₀, M₀, M₀_in, H₀⟩
-      rw [Valued.cauchy_iff] at hF⊢
+      rw [Valued.cauchy_iff] at hF ⊢
       refine' ⟨hF.1.map _, _⟩
       replace hF := hF.2
       intro γ
chore: tidy various files (#5233)
Diff
@@ -48,7 +48,7 @@ section InversionEstimate
 variable (v : Valuation K Γ₀)
 
 -- The following is the main technical lemma ensuring that inversion is continuous
--- in the topology induced by a valuation on a division ring (ie the next instance)
+-- in the topology induced by a valuation on a division ring (i.e. the next instance)
 -- and the fact that a valued field is completable
 -- [BouAC, VI.5.1 Lemme 1]
 theorem Valuation.inversion_estimate {x y : K} {γ : Γ₀ˣ} (y_ne : y ≠ 0)
@@ -142,9 +142,6 @@ open UniformSpace
 
 variable {K : Type _} [Field K] {Γ₀ : Type _} [LinearOrderedCommGroupWithZero Γ₀] [hv : Valued K Γ₀]
 
---include hv
-
--- mathport name: exprhat
 local notation "hat " => Completion
 
 /-- A valued field is completable. -/
@@ -231,9 +228,9 @@ theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀) :
           rw [← one_mul (1 : hat K)]
         refine'
           Tendsto.mul continuous_fst.continuousAt (Tendsto.comp _ continuous_snd.continuousAt)
-        convert continuousAt_inv₀ (zero_ne_one.symm : 1 ≠ (0 : hat K))
-        -- Porting note: Added `ContinuousAt._eq_1`
-        rw [ContinuousAt._eq_1, inv_one]
+        -- Porting note: Added `ContinuousAt.tendsto`
+        convert (continuousAt_inv₀ (zero_ne_one.symm : 1 ≠ (0 : hat K))).tendsto
+        exact inv_one.symm
       rcases tendsto_prod_self_iff.mp this V V_in with ⟨U, U_in, hU⟩
       let hatKstar := ({0}ᶜ : Set <| hat K)
       have : hatKstar ∈ 𝓝 (1 : hat K) := compl_singleton_mem_nhds zero_ne_one.symm
feat: port Topology.Algebra.ValuedField (#3511)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: int-y1 <jason_yuen2007@hotmail.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com>

Dependencies 9 + 549

550 files ported (98.4%)
238846 lines ported (97.9%)
Show graph

The unported dependencies are