topology.algebra.continuous_affine_mapMathlib.Topology.Algebra.ContinuousAffineMap

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -65,13 +65,13 @@ theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g
 instance : ContinuousMapClass (P →A[R] Q) P Q
     where
   coe f := f.toAffineMap
-  coe_injective' f g h := to_affineMap_injective <| FunLike.coe_injective h
+  coe_injective' f g h := to_affineMap_injective <| DFunLike.coe_injective h
   map_continuous := cont
 
 /-- Helper instance for when there's too many metavariables to apply
 `fun_like.has_coe_to_fun` directly. -/
 instance : CoeFun (P →A[R] Q) fun _ => P → Q :=
-  FunLike.hasCoeToFun
+  DFunLike.hasCoeToFun
 
 #print ContinuousAffineMap.toFun_eq_coe /-
 theorem toFun_eq_coe (f : P →A[R] Q) : f.toFun = ⇑f :=
@@ -81,26 +81,26 @@ theorem toFun_eq_coe (f : P →A[R] Q) : f.toFun = ⇑f :=
 
 #print ContinuousAffineMap.coe_injective /-
 theorem coe_injective : @Function.Injective (P →A[R] Q) (P → Q) coeFn :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align continuous_affine_map.coe_injective ContinuousAffineMap.coe_injective
 -/
 
 #print ContinuousAffineMap.ext /-
 @[ext]
 theorem ext {f g : P →A[R] Q} (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext _ _ h
+  DFunLike.ext _ _ h
 #align continuous_affine_map.ext ContinuousAffineMap.ext
 -/
 
 #print ContinuousAffineMap.ext_iff /-
 theorem ext_iff {f g : P →A[R] Q} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align continuous_affine_map.ext_iff ContinuousAffineMap.ext_iff
 -/
 
 #print ContinuousAffineMap.congr_fun /-
 theorem congr_fun {f g : P →A[R] Q} (h : f = g) (x : P) : f x = g x :=
-  FunLike.congr_fun h _
+  DFunLike.congr_fun h _
 #align continuous_affine_map.congr_fun ContinuousAffineMap.congr_fun
 -/
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 -/
-import Mathbin.LinearAlgebra.AffineSpace.AffineMap
-import Mathbin.Topology.ContinuousFunction.Basic
-import Mathbin.Topology.Algebra.Module.Basic
+import LinearAlgebra.AffineSpace.AffineMap
+import Topology.ContinuousFunction.Basic
+import Topology.Algebra.Module.Basic
 
 #align_import topology.algebra.continuous_affine_map from "leanprover-community/mathlib"@"6b31d1eebd64eab86d5bd9936bfaada6ca8b5842"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
-
-! This file was ported from Lean 3 source module topology.algebra.continuous_affine_map
-! leanprover-community/mathlib commit 6b31d1eebd64eab86d5bd9936bfaada6ca8b5842
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.LinearAlgebra.AffineSpace.AffineMap
 import Mathbin.Topology.ContinuousFunction.Basic
 import Mathbin.Topology.Algebra.Module.Basic
 
+#align_import topology.algebra.continuous_affine_map from "leanprover-community/mathlib"@"6b31d1eebd64eab86d5bd9936bfaada6ca8b5842"
+
 /-!
 # Continuous affine maps.
 
Diff
@@ -46,7 +46,6 @@ structure ContinuousAffineMap (R : Type _) {V W : Type _} (P Q : Type _) [Ring R
 #align continuous_affine_map ContinuousAffineMap
 -/
 
--- mathport name: «expr →A[ ] »
 notation:25 P " →A[" R "] " Q => ContinuousAffineMap R P Q
 
 namespace ContinuousAffineMap
@@ -57,14 +56,14 @@ variable [AddCommGroup V] [Module R V] [TopologicalSpace P] [AddTorsor V P]
 
 variable [AddCommGroup W] [Module R W] [TopologicalSpace Q] [AddTorsor W Q]
 
-include V W
-
 instance : Coe (P →A[R] Q) (P →ᵃ[R] Q) :=
   ⟨toAffineMap⟩
 
+#print ContinuousAffineMap.to_affineMap_injective /-
 theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g : P →ᵃ[R] Q)) : f = g :=
   by cases f; cases g; congr
 #align continuous_affine_map.to_affine_map_injective ContinuousAffineMap.to_affineMap_injective
+-/
 
 instance : ContinuousMapClass (P →A[R] Q) P Q
     where
@@ -77,26 +76,36 @@ instance : ContinuousMapClass (P →A[R] Q) P Q
 instance : CoeFun (P →A[R] Q) fun _ => P → Q :=
   FunLike.hasCoeToFun
 
+#print ContinuousAffineMap.toFun_eq_coe /-
 theorem toFun_eq_coe (f : P →A[R] Q) : f.toFun = ⇑f :=
   rfl
 #align continuous_affine_map.to_fun_eq_coe ContinuousAffineMap.toFun_eq_coe
+-/
 
+#print ContinuousAffineMap.coe_injective /-
 theorem coe_injective : @Function.Injective (P →A[R] Q) (P → Q) coeFn :=
   FunLike.coe_injective
 #align continuous_affine_map.coe_injective ContinuousAffineMap.coe_injective
+-/
 
+#print ContinuousAffineMap.ext /-
 @[ext]
 theorem ext {f g : P →A[R] Q} (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext _ _ h
 #align continuous_affine_map.ext ContinuousAffineMap.ext
+-/
 
+#print ContinuousAffineMap.ext_iff /-
 theorem ext_iff {f g : P →A[R] Q} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align continuous_affine_map.ext_iff ContinuousAffineMap.ext_iff
+-/
 
+#print ContinuousAffineMap.congr_fun /-
 theorem congr_fun {f g : P →A[R] Q} (h : f = g) (x : P) : f x = g x :=
   FunLike.congr_fun h _
 #align continuous_affine_map.congr_fun ContinuousAffineMap.congr_fun
+-/
 
 #print ContinuousAffineMap.toContinuousMap /-
 /-- Forgetting its algebraic properties, a continuous affine map is a continuous map. -/
@@ -113,48 +122,66 @@ theorem toAffineMap_eq_coe (f : P →A[R] Q) : f.toAffineMap = ↑f :=
   rfl
 #align continuous_affine_map.to_affine_map_eq_coe ContinuousAffineMap.toAffineMap_eq_coe
 
+#print ContinuousAffineMap.toContinuousMap_coe /-
 @[simp]
 theorem toContinuousMap_coe (f : P →A[R] Q) : f.toContinuousMap = ↑f :=
   rfl
 #align continuous_affine_map.to_continuous_map_coe ContinuousAffineMap.toContinuousMap_coe
+-/
 
+#print ContinuousAffineMap.coe_to_affineMap /-
 @[simp, norm_cast]
 theorem coe_to_affineMap (f : P →A[R] Q) : ((f : P →ᵃ[R] Q) : P → Q) = f :=
   rfl
 #align continuous_affine_map.coe_to_affine_map ContinuousAffineMap.coe_to_affineMap
+-/
 
+#print ContinuousAffineMap.coe_to_continuousMap /-
 @[simp, norm_cast]
 theorem coe_to_continuousMap (f : P →A[R] Q) : ((f : C(P, Q)) : P → Q) = f :=
   rfl
 #align continuous_affine_map.coe_to_continuous_map ContinuousAffineMap.coe_to_continuousMap
+-/
 
+#print ContinuousAffineMap.to_continuousMap_injective /-
 theorem to_continuousMap_injective {f g : P →A[R] Q} (h : (f : C(P, Q)) = (g : C(P, Q))) : f = g :=
   by ext a; exact ContinuousMap.congr_fun h a
 #align continuous_affine_map.to_continuous_map_injective ContinuousAffineMap.to_continuousMap_injective
+-/
 
+#print ContinuousAffineMap.coe_affineMap_mk /-
 @[norm_cast]
 theorem coe_affineMap_mk (f : P →ᵃ[R] Q) (h) : ((⟨f, h⟩ : P →A[R] Q) : P →ᵃ[R] Q) = f :=
   rfl
 #align continuous_affine_map.coe_affine_map_mk ContinuousAffineMap.coe_affineMap_mk
+-/
 
+#print ContinuousAffineMap.coe_continuousMap_mk /-
 @[norm_cast]
 theorem coe_continuousMap_mk (f : P →ᵃ[R] Q) (h) : ((⟨f, h⟩ : P →A[R] Q) : C(P, Q)) = ⟨f, h⟩ :=
   rfl
 #align continuous_affine_map.coe_continuous_map_mk ContinuousAffineMap.coe_continuousMap_mk
+-/
 
+#print ContinuousAffineMap.coe_mk /-
 @[simp]
 theorem coe_mk (f : P →ᵃ[R] Q) (h) : ((⟨f, h⟩ : P →A[R] Q) : P → Q) = f :=
   rfl
 #align continuous_affine_map.coe_mk ContinuousAffineMap.coe_mk
+-/
 
+#print ContinuousAffineMap.mk_coe /-
 @[simp]
 theorem mk_coe (f : P →A[R] Q) (h) : (⟨(f : P →ᵃ[R] Q), h⟩ : P →A[R] Q) = f := by ext; rfl
 #align continuous_affine_map.mk_coe ContinuousAffineMap.mk_coe
+-/
 
+#print ContinuousAffineMap.continuous /-
 @[continuity]
 protected theorem continuous (f : P →A[R] Q) : Continuous f :=
   f.2
 #align continuous_affine_map.continuous ContinuousAffineMap.continuous
+-/
 
 variable (R P)
 
@@ -167,10 +194,12 @@ def const (q : Q) : P →A[R] Q :=
 #align continuous_affine_map.const ContinuousAffineMap.const
 -/
 
+#print ContinuousAffineMap.coe_const /-
 @[simp]
 theorem coe_const (q : Q) : (const R P q : P → Q) = Function.const P q :=
   rfl
 #align continuous_affine_map.coe_const ContinuousAffineMap.coe_const
+-/
 
 noncomputable instance : Inhabited (P →A[R] Q) :=
   ⟨const R P <| Nonempty.some (by infer_instance : Nonempty Q)⟩
@@ -179,8 +208,6 @@ variable {R P} {W₂ Q₂ : Type _}
 
 variable [AddCommGroup W₂] [Module R W₂] [TopologicalSpace Q₂] [AddTorsor W₂ Q₂]
 
-include W₂
-
 #print ContinuousAffineMap.comp /-
 /-- The composition of morphisms is a morphism. -/
 def comp (f : Q →A[R] Q₂) (g : P →A[R] Q) : P →A[R] Q₂ :=
@@ -188,17 +215,19 @@ def comp (f : Q →A[R] Q₂) (g : P →A[R] Q) : P →A[R] Q₂ :=
 #align continuous_affine_map.comp ContinuousAffineMap.comp
 -/
 
+#print ContinuousAffineMap.coe_comp /-
 @[simp, norm_cast]
 theorem coe_comp (f : Q →A[R] Q₂) (g : P →A[R] Q) :
     (f.comp g : P → Q₂) = (f : Q → Q₂) ∘ (g : P → Q) :=
   rfl
 #align continuous_affine_map.coe_comp ContinuousAffineMap.coe_comp
+-/
 
+#print ContinuousAffineMap.comp_apply /-
 theorem comp_apply (f : Q →A[R] Q₂) (g : P →A[R] Q) (x : P) : f.comp g x = f (g x) :=
   rfl
 #align continuous_affine_map.comp_apply ContinuousAffineMap.comp_apply
-
-omit W₂
+-/
 
 section ModuleValuedMaps
 
@@ -209,14 +238,18 @@ variable [TopologicalSpace W]
 instance : Zero (P →A[R] W) :=
   ⟨ContinuousAffineMap.const R P 0⟩
 
+#print ContinuousAffineMap.coe_zero /-
 @[norm_cast, simp]
 theorem coe_zero : ((0 : P →A[R] W) : P → W) = 0 :=
   rfl
 #align continuous_affine_map.coe_zero ContinuousAffineMap.coe_zero
+-/
 
+#print ContinuousAffineMap.zero_apply /-
 theorem zero_apply (x : P) : (0 : P →A[R] W) x = 0 :=
   rfl
 #align continuous_affine_map.zero_apply ContinuousAffineMap.zero_apply
+-/
 
 section MulAction
 
@@ -227,14 +260,18 @@ variable [ContinuousConstSMul S W]
 instance : SMul S (P →A[R] W)
     where smul t f := { t • (f : P →ᵃ[R] W) with cont := f.Continuous.const_smul t }
 
+#print ContinuousAffineMap.coe_smul /-
 @[norm_cast, simp]
 theorem coe_smul (t : S) (f : P →A[R] W) : ⇑(t • f) = t • f :=
   rfl
 #align continuous_affine_map.coe_smul ContinuousAffineMap.coe_smul
+-/
 
+#print ContinuousAffineMap.smul_apply /-
 theorem smul_apply (t : S) (f : P →A[R] W) (x : P) : (t • f) x = t • f x :=
   rfl
 #align continuous_affine_map.smul_apply ContinuousAffineMap.smul_apply
+-/
 
 instance [DistribMulAction Sᵐᵒᵖ W] [IsCentralScalar S W] : IsCentralScalar S (P →A[R] W)
     where op_smul_eq_smul t f := ext fun _ => op_smul_eq_smul _ _
@@ -250,38 +287,50 @@ instance : Add (P →A[R] W)
     where add f g :=
     { (f : P →ᵃ[R] W) + (g : P →ᵃ[R] W) with cont := f.Continuous.add g.Continuous }
 
+#print ContinuousAffineMap.coe_add /-
 @[norm_cast, simp]
 theorem coe_add (f g : P →A[R] W) : ⇑(f + g) = f + g :=
   rfl
 #align continuous_affine_map.coe_add ContinuousAffineMap.coe_add
+-/
 
+#print ContinuousAffineMap.add_apply /-
 theorem add_apply (f g : P →A[R] W) (x : P) : (f + g) x = f x + g x :=
   rfl
 #align continuous_affine_map.add_apply ContinuousAffineMap.add_apply
+-/
 
 instance : Sub (P →A[R] W)
     where sub f g :=
     { (f : P →ᵃ[R] W) - (g : P →ᵃ[R] W) with cont := f.Continuous.sub g.Continuous }
 
+#print ContinuousAffineMap.coe_sub /-
 @[norm_cast, simp]
 theorem coe_sub (f g : P →A[R] W) : ⇑(f - g) = f - g :=
   rfl
 #align continuous_affine_map.coe_sub ContinuousAffineMap.coe_sub
+-/
 
+#print ContinuousAffineMap.sub_apply /-
 theorem sub_apply (f g : P →A[R] W) (x : P) : (f - g) x = f x - g x :=
   rfl
 #align continuous_affine_map.sub_apply ContinuousAffineMap.sub_apply
+-/
 
 instance : Neg (P →A[R] W) where neg f := { -(f : P →ᵃ[R] W) with cont := f.Continuous.neg }
 
+#print ContinuousAffineMap.coe_neg /-
 @[norm_cast, simp]
 theorem coe_neg (f : P →A[R] W) : ⇑(-f) = -f :=
   rfl
 #align continuous_affine_map.coe_neg ContinuousAffineMap.coe_neg
+-/
 
+#print ContinuousAffineMap.neg_apply /-
 theorem neg_apply (f : P →A[R] W) (x : P) : (-f) x = -f x :=
   rfl
 #align continuous_affine_map.neg_apply ContinuousAffineMap.neg_apply
+-/
 
 instance : AddCommGroup (P →A[R] W) :=
   coe_injective.AddCommGroup _ coe_zero coe_add coe_neg coe_sub (fun _ _ => coe_smul _ _) fun _ _ =>
@@ -319,14 +368,18 @@ def toContinuousAffineMap (f : V →L[R] W) : V →A[R] W
 #align continuous_linear_map.to_continuous_affine_map ContinuousLinearMap.toContinuousAffineMap
 -/
 
+#print ContinuousLinearMap.coe_toContinuousAffineMap /-
 @[simp]
 theorem coe_toContinuousAffineMap (f : V →L[R] W) : ⇑f.toContinuousAffineMap = f :=
   rfl
 #align continuous_linear_map.coe_to_continuous_affine_map ContinuousLinearMap.coe_toContinuousAffineMap
+-/
 
+#print ContinuousLinearMap.toContinuousAffineMap_map_zero /-
 @[simp]
 theorem toContinuousAffineMap_map_zero (f : V →L[R] W) : f.toContinuousAffineMap 0 = 0 := by simp
 #align continuous_linear_map.to_continuous_affine_map_map_zero ContinuousLinearMap.toContinuousAffineMap_map_zero
+-/
 
 end ContinuousLinearMap
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module topology.algebra.continuous_affine_map
-! leanprover-community/mathlib commit bd1fc183335ea95a9519a1630bcf901fe9326d83
+! leanprover-community/mathlib commit 6b31d1eebd64eab86d5bd9936bfaada6ca8b5842
 ! 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.Module.Basic
 /-!
 # Continuous affine maps.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines a type of bundled continuous affine maps.
 
 Note that the definition and basic properties established here require minimal assumptions, and do
Diff
@@ -34,12 +34,14 @@ to the notation `E →L[R] F` for `continuous_linear_map R E F`.
 -/
 
 
+#print ContinuousAffineMap /-
 /-- A continuous map of affine spaces. -/
 structure ContinuousAffineMap (R : Type _) {V W : Type _} (P Q : Type _) [Ring R] [AddCommGroup V]
     [Module R V] [TopologicalSpace P] [AddTorsor V P] [AddCommGroup W] [Module R W]
     [TopologicalSpace Q] [AddTorsor W Q] extends P →ᵃ[R] Q where
   cont : Continuous to_fun
 #align continuous_affine_map ContinuousAffineMap
+-/
 
 -- mathport name: «expr →A[ ] »
 notation:25 P " →A[" R "] " Q => ContinuousAffineMap R P Q
@@ -93,10 +95,12 @@ theorem congr_fun {f g : P →A[R] Q} (h : f = g) (x : P) : f x = g x :=
   FunLike.congr_fun h _
 #align continuous_affine_map.congr_fun ContinuousAffineMap.congr_fun
 
+#print ContinuousAffineMap.toContinuousMap /-
 /-- Forgetting its algebraic properties, a continuous affine map is a continuous map. -/
 def toContinuousMap (f : P →A[R] Q) : C(P, Q) :=
   ⟨f, f.cont⟩
 #align continuous_affine_map.to_continuous_map ContinuousAffineMap.toContinuousMap
+-/
 
 instance : Coe (P →A[R] Q) C(P, Q) :=
   ⟨toContinuousMap⟩
@@ -151,12 +155,14 @@ protected theorem continuous (f : P →A[R] Q) : Continuous f :=
 
 variable (R P)
 
+#print ContinuousAffineMap.const /-
 /-- The constant map is a continuous affine map. -/
 def const (q : Q) : P →A[R] Q :=
   { AffineMap.const R P q with
     toFun := AffineMap.const R P q
     cont := continuous_const }
 #align continuous_affine_map.const ContinuousAffineMap.const
+-/
 
 @[simp]
 theorem coe_const (q : Q) : (const R P q : P → Q) = Function.const P q :=
@@ -172,10 +178,12 @@ variable [AddCommGroup W₂] [Module R W₂] [TopologicalSpace Q₂] [AddTorsor
 
 include W₂
 
+#print ContinuousAffineMap.comp /-
 /-- The composition of morphisms is a morphism. -/
 def comp (f : Q →A[R] Q₂) (g : P →A[R] Q) : P →A[R] Q₂ :=
   { (f : Q →ᵃ[R] Q₂).comp (g : P →ᵃ[R] Q) with cont := f.cont.comp g.cont }
 #align continuous_affine_map.comp ContinuousAffineMap.comp
+-/
 
 @[simp, norm_cast]
 theorem coe_comp (f : Q →A[R] Q₂) (g : P →A[R] Q) :
@@ -297,6 +305,7 @@ variable [AddCommGroup V] [Module R V] [TopologicalSpace V]
 
 variable [AddCommGroup W] [Module R W] [TopologicalSpace W]
 
+#print ContinuousLinearMap.toContinuousAffineMap /-
 /-- A continuous linear map can be regarded as a continuous affine map. -/
 def toContinuousAffineMap (f : V →L[R] W) : V →A[R] W
     where
@@ -305,6 +314,7 @@ def toContinuousAffineMap (f : V →L[R] W) : V →A[R] W
   map_vadd' := by simp
   cont := f.cont
 #align continuous_linear_map.to_continuous_affine_map ContinuousLinearMap.toContinuousAffineMap
+-/
 
 @[simp]
 theorem coe_toContinuousAffineMap (f : V →L[R] W) : ⇑f.toContinuousAffineMap = f :=
Diff
@@ -36,8 +36,8 @@ to the notation `E →L[R] F` for `continuous_linear_map R E F`.
 
 /-- A continuous map of affine spaces. -/
 structure ContinuousAffineMap (R : Type _) {V W : Type _} (P Q : Type _) [Ring R] [AddCommGroup V]
-  [Module R V] [TopologicalSpace P] [AddTorsor V P] [AddCommGroup W] [Module R W]
-  [TopologicalSpace Q] [AddTorsor W Q] extends P →ᵃ[R] Q where
+    [Module R V] [TopologicalSpace P] [AddTorsor V P] [AddCommGroup W] [Module R W]
+    [TopologicalSpace Q] [AddTorsor W Q] extends P →ᵃ[R] Q where
   cont : Continuous to_fun
 #align continuous_affine_map ContinuousAffineMap
 
Diff
@@ -58,10 +58,7 @@ instance : Coe (P →A[R] Q) (P →ᵃ[R] Q) :=
   ⟨toAffineMap⟩
 
 theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g : P →ᵃ[R] Q)) : f = g :=
-  by
-  cases f
-  cases g
-  congr
+  by cases f; cases g; congr
 #align continuous_affine_map.to_affine_map_injective ContinuousAffineMap.to_affineMap_injective
 
 instance : ContinuousMapClass (P →A[R] Q) P Q
@@ -125,9 +122,7 @@ theorem coe_to_continuousMap (f : P →A[R] Q) : ((f : C(P, Q)) : P → Q) = f :
 #align continuous_affine_map.coe_to_continuous_map ContinuousAffineMap.coe_to_continuousMap
 
 theorem to_continuousMap_injective {f g : P →A[R] Q} (h : (f : C(P, Q)) = (g : C(P, Q))) : f = g :=
-  by
-  ext a
-  exact ContinuousMap.congr_fun h a
+  by ext a; exact ContinuousMap.congr_fun h a
 #align continuous_affine_map.to_continuous_map_injective ContinuousAffineMap.to_continuousMap_injective
 
 @[norm_cast]
@@ -146,10 +141,7 @@ theorem coe_mk (f : P →ᵃ[R] Q) (h) : ((⟨f, h⟩ : P →A[R] Q) : P → Q)
 #align continuous_affine_map.coe_mk ContinuousAffineMap.coe_mk
 
 @[simp]
-theorem mk_coe (f : P →A[R] Q) (h) : (⟨(f : P →ᵃ[R] Q), h⟩ : P →A[R] Q) = f :=
-  by
-  ext
-  rfl
+theorem mk_coe (f : P →A[R] Q) (h) : (⟨(f : P →ᵃ[R] Q), h⟩ : P →A[R] Q) = f := by ext; rfl
 #align continuous_affine_map.mk_coe ContinuousAffineMap.mk_coe
 
 @[continuity]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module topology.algebra.continuous_affine_map
-! leanprover-community/mathlib commit 806bbb0132ba63b93d5edbe4789ea226f8329979
+! leanprover-community/mathlib commit bd1fc183335ea95a9519a1630bcf901fe9326d83
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -54,40 +54,48 @@ variable [AddCommGroup W] [Module R W] [TopologicalSpace Q] [AddTorsor W Q]
 
 include V W
 
-/-- see Note [function coercion] -/
+instance : Coe (P →A[R] Q) (P →ᵃ[R] Q) :=
+  ⟨toAffineMap⟩
+
+theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g : P →ᵃ[R] Q)) : f = g :=
+  by
+  cases f
+  cases g
+  congr
+#align continuous_affine_map.to_affine_map_injective ContinuousAffineMap.to_affineMap_injective
+
+instance : ContinuousMapClass (P →A[R] Q) P Q
+    where
+  coe f := f.toAffineMap
+  coe_injective' f g h := to_affineMap_injective <| FunLike.coe_injective h
+  map_continuous := cont
+
+/-- Helper instance for when there's too many metavariables to apply
+`fun_like.has_coe_to_fun` directly. -/
 instance : CoeFun (P →A[R] Q) fun _ => P → Q :=
-  ⟨fun f => f.toAffineMap.toFun⟩
+  FunLike.hasCoeToFun
 
 theorem toFun_eq_coe (f : P →A[R] Q) : f.toFun = ⇑f :=
   rfl
 #align continuous_affine_map.to_fun_eq_coe ContinuousAffineMap.toFun_eq_coe
 
 theorem coe_injective : @Function.Injective (P →A[R] Q) (P → Q) coeFn :=
-  by
-  rintro ⟨⟨f, ⟨f', hf₁, hf₂⟩, hf₀⟩, hf₁⟩ ⟨⟨g, ⟨g', hg₁, hg₂⟩, hg₀⟩, hg₁⟩ h
-  have : f = g ∧ f' = g' := by simpa only using AffineMap.coeFn_injective h
-  congr
-  exacts[this.1, this.2]
+  FunLike.coe_injective
 #align continuous_affine_map.coe_injective ContinuousAffineMap.coe_injective
 
 @[ext]
 theorem ext {f g : P →A[R] Q} (h : ∀ x, f x = g x) : f = g :=
-  coe_injective <| funext h
+  FunLike.ext _ _ h
 #align continuous_affine_map.ext ContinuousAffineMap.ext
 
 theorem ext_iff {f g : P →A[R] Q} : f = g ↔ ∀ x, f x = g x :=
-  ⟨by
-    rintro rfl x
-    rfl, ext⟩
+  FunLike.ext_iff
 #align continuous_affine_map.ext_iff ContinuousAffineMap.ext_iff
 
 theorem congr_fun {f g : P →A[R] Q} (h : f = g) (x : P) : f x = g x :=
-  h ▸ rfl
+  FunLike.congr_fun h _
 #align continuous_affine_map.congr_fun ContinuousAffineMap.congr_fun
 
-instance : Coe (P →A[R] Q) (P →ᵃ[R] Q) :=
-  ⟨toAffineMap⟩
-
 /-- Forgetting its algebraic properties, a continuous affine map is a continuous map. -/
 def toContinuousMap (f : P →A[R] Q) : C(P, Q) :=
   ⟨f, f.cont⟩
@@ -116,12 +124,6 @@ theorem coe_to_continuousMap (f : P →A[R] Q) : ((f : C(P, Q)) : P → Q) = f :
   rfl
 #align continuous_affine_map.coe_to_continuous_map ContinuousAffineMap.coe_to_continuousMap
 
-theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g : P →ᵃ[R] Q)) : f = g :=
-  by
-  ext a
-  exact AffineMap.congr_fun h a
-#align continuous_affine_map.to_affine_map_injective ContinuousAffineMap.to_affineMap_injective
-
 theorem to_continuousMap_injective {f g : P →A[R] Q} (h : (f : C(P, Q)) = (g : C(P, Q))) : f = g :=
   by
   ext a

Changes in mathlib4

mathlib3
mathlib4
chore: remove mathport name: <expression> lines (#11928)

Quoting [@digama0](https://github.com/digama0):

These were actually never meant to go in the file, they are basically debugging information and only useful on significantly broken mathport files. You can safely remove all of them.

Diff
@@ -38,7 +38,6 @@ structure ContinuousAffineMap (R : Type*) {V W : Type*} (P Q : Type*) [Ring R] [
   cont : Continuous toFun
 #align continuous_affine_map ContinuousAffineMap
 
--- mathport name: «expr →A[ ] »
 notation:25 P " →A[" R "] " Q => ContinuousAffineMap R P Q
 
 namespace ContinuousAffineMap
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -44,9 +44,7 @@ notation:25 P " →A[" R "] " Q => ContinuousAffineMap R P Q
 namespace ContinuousAffineMap
 
 variable {R V W P Q : Type*} [Ring R]
-
 variable [AddCommGroup V] [Module R V] [TopologicalSpace P] [AddTorsor V P]
-
 variable [AddCommGroup W] [Module R W] [TopologicalSpace Q] [AddTorsor W Q]
 
 instance : Coe (P →A[R] Q) (P →ᵃ[R] Q) :=
@@ -152,7 +150,6 @@ noncomputable instance : Inhabited (P →A[R] Q) :=
   ⟨const R P <| Nonempty.some (by infer_instance : Nonempty Q)⟩
 
 variable {R P} {W₂ Q₂ : Type*}
-
 variable [AddCommGroup W₂] [Module R W₂] [TopologicalSpace Q₂] [AddTorsor W₂ Q₂]
 
 /-- The composition of morphisms is a morphism. -/
@@ -171,7 +168,6 @@ theorem comp_apply (f : Q →A[R] Q₂) (g : P →A[R] Q) (x : P) : f.comp g x =
 section ModuleValuedMaps
 
 variable {S : Type*}
-
 variable [TopologicalSpace W]
 
 instance : Zero (P →A[R] W) :=
@@ -187,7 +183,6 @@ theorem zero_apply (x : P) : (0 : P →A[R] W) x = 0 := rfl
 section MulAction
 
 variable [Monoid S] [DistribMulAction S W] [SMulCommClass R S W]
-
 variable [ContinuousConstSMul S W]
 
 instance : SMul S (P →A[R] W) where
@@ -260,9 +255,7 @@ end ContinuousAffineMap
 namespace ContinuousLinearMap
 
 variable {R V W : Type*} [Ring R]
-
 variable [AddCommGroup V] [Module R V] [TopologicalSpace V]
-
 variable [AddCommGroup W] [Module R W] [TopologicalSpace W]
 
 /-- A continuous linear map can be regarded as a continuous affine map. -/
refactor(Data/FunLike): use unbundled inheritance from FunLike (#8386)

The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike is EquivLike, since that has a custom coe_injective' field that is easier to implement. All other classes should take FunLike or EquivLike as a parameter.

Zulip thread

Important changes

Previously, morphism classes would be Type-valued and extend FunLike:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  extends FunLike F A B :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

After this PR, they should be Prop-valued and take FunLike as a parameter:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  [FunLike F A B] : Prop :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

(Note that A B stay marked as outParam even though they are not purely required to be so due to the FunLike parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam is slightly faster.)

Similarly, MyEquivClass should take EquivLike as a parameter.

As a result, every mention of [MyHomClass F A B] should become [FunLike F A B] [MyHomClass F A B].

Remaining issues

Slower (failing) search

While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul is more expensive. This is due to suboptimal processing of arguments. For example:

variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)

theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y

example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _

Before this PR, applying map_mul f gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Since M and N are out_params, [MulHomClass F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found.

After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Now [FunLike F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found, before trying MulHomClass F M N which fails. Since the Mul hierarchy is very big, this can be slow to fail, especially when there is no such Mul instance.

A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N] because MulHomClass fails or succeeds much faster than the others.

As a consequence, the simpNF linter is much slower since by design it tries and fails to apply many map_ lemmas. The same issue occurs a few times in existing calls to simp [map_mul], where map_mul is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.

simp not firing sometimes

This affects map_smulₛₗ and related definitions. For simp lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw can find every argument to map_smulₛₗ successfully but simp can't: leanprover/lean4#3701.

Missing instances due to unification failing

Especially in the category theory library, we might sometimes have a type A which is also accessible as a synonym (Bundled A hA).1. Instance synthesis doesn't always work if we have f : A →* B but x * y : (Bundled A hA).1 or vice versa. This seems to be mostly fixed by keeping A B as outParams in MulHomClass F A B. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1 instead of using the syntax in the discrimination tree.)

Workaround for issues

The timeouts can be worked around for now by specifying which map_mul we mean, either as map_mul f for some explicit f, or as e.g. MonoidHomClass.map_mul.

map_smulₛₗ not firing as simp lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulₛₗ a simp lemma instead of the generic map_smulₛₗ. Writing simp [map_smulₛₗ _] also works.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -59,15 +59,12 @@ theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g
   congr
 #align continuous_affine_map.to_affine_map_injective ContinuousAffineMap.to_affineMap_injective
 
-instance : ContinuousMapClass (P →A[R] Q) P Q where
+instance : FunLike (P →A[R] Q) P Q where
   coe f := f.toAffineMap
   coe_injective' _ _ h := to_affineMap_injective <| DFunLike.coe_injective h
-  map_continuous := cont
 
-/-- Helper instance for when there's too many metavariables to apply
-`DFunLike.hasCoeToFun` directly. -/
-instance : CoeFun (P →A[R] Q) fun _ ↦ P → Q :=
-  DFunLike.hasCoeToFun
+instance : ContinuousMapClass (P →A[R] Q) P Q where
+  map_continuous := cont
 
 theorem toFun_eq_coe (f : P →A[R] Q) : f.toFun = ⇑f := rfl
 #align continuous_affine_map.to_fun_eq_coe ContinuousAffineMap.toFun_eq_coe
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -61,32 +61,32 @@ theorem to_affineMap_injective {f g : P →A[R] Q} (h : (f : P →ᵃ[R] Q) = (g
 
 instance : ContinuousMapClass (P →A[R] Q) P Q where
   coe f := f.toAffineMap
-  coe_injective' _ _ h := to_affineMap_injective <| FunLike.coe_injective h
+  coe_injective' _ _ h := to_affineMap_injective <| DFunLike.coe_injective h
   map_continuous := cont
 
 /-- Helper instance for when there's too many metavariables to apply
-`FunLike.hasCoeToFun` directly. -/
+`DFunLike.hasCoeToFun` directly. -/
 instance : CoeFun (P →A[R] Q) fun _ ↦ P → Q :=
-  FunLike.hasCoeToFun
+  DFunLike.hasCoeToFun
 
 theorem toFun_eq_coe (f : P →A[R] Q) : f.toFun = ⇑f := rfl
 #align continuous_affine_map.to_fun_eq_coe ContinuousAffineMap.toFun_eq_coe
 
 theorem coe_injective : @Function.Injective (P →A[R] Q) (P → Q) (⇑) :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align continuous_affine_map.coe_injective ContinuousAffineMap.coe_injective
 
 @[ext]
 theorem ext {f g : P →A[R] Q} (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext _ _ h
+  DFunLike.ext _ _ h
 #align continuous_affine_map.ext ContinuousAffineMap.ext
 
 theorem ext_iff {f g : P →A[R] Q} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align continuous_affine_map.ext_iff ContinuousAffineMap.ext_iff
 
 theorem congr_fun {f g : P →A[R] Q} (h : f = g) (x : P) : f x = g x :=
-  FunLike.congr_fun h _
+  DFunLike.congr_fun h _
 #align continuous_affine_map.congr_fun ContinuousAffineMap.congr_fun
 
 /-- Forgetting its algebraic properties, a continuous affine map is a continuous map. -/
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
@@ -32,7 +32,7 @@ to the notation `E →L[R] F` for `ContinuousLinearMap R E F`.
 
 
 /-- A continuous map of affine spaces. -/
-structure ContinuousAffineMap (R : Type _) {V W : Type _} (P Q : Type _) [Ring R] [AddCommGroup V]
+structure ContinuousAffineMap (R : Type*) {V W : Type*} (P Q : Type*) [Ring R] [AddCommGroup V]
   [Module R V] [TopologicalSpace P] [AddTorsor V P] [AddCommGroup W] [Module R W]
   [TopologicalSpace Q] [AddTorsor W Q] extends P →ᵃ[R] Q where
   cont : Continuous toFun
@@ -43,7 +43,7 @@ notation:25 P " →A[" R "] " Q => ContinuousAffineMap R P Q
 
 namespace ContinuousAffineMap
 
-variable {R V W P Q : Type _} [Ring R]
+variable {R V W P Q : Type*} [Ring R]
 
 variable [AddCommGroup V] [Module R V] [TopologicalSpace P] [AddTorsor V P]
 
@@ -154,7 +154,7 @@ theorem coe_const (q : Q) : (const R P q : P → Q) = Function.const P q := rfl
 noncomputable instance : Inhabited (P →A[R] Q) :=
   ⟨const R P <| Nonempty.some (by infer_instance : Nonempty Q)⟩
 
-variable {R P} {W₂ Q₂ : Type _}
+variable {R P} {W₂ Q₂ : Type*}
 
 variable [AddCommGroup W₂] [Module R W₂] [TopologicalSpace Q₂] [AddTorsor W₂ Q₂]
 
@@ -173,7 +173,7 @@ theorem comp_apply (f : Q →A[R] Q₂) (g : P →A[R] Q) (x : P) : f.comp g x =
 
 section ModuleValuedMaps
 
-variable {S : Type _}
+variable {S : Type*}
 
 variable [TopologicalSpace W]
 
@@ -262,7 +262,7 @@ end ContinuousAffineMap
 
 namespace ContinuousLinearMap
 
-variable {R V W : Type _} [Ring R]
+variable {R V W : Type*} [Ring R]
 
 variable [AddCommGroup V] [Module R V] [TopologicalSpace V]
 
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 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
-
-! This file was ported from Lean 3 source module topology.algebra.continuous_affine_map
-! leanprover-community/mathlib commit bd1fc183335ea95a9519a1630bcf901fe9326d83
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.LinearAlgebra.AffineSpace.AffineMap
 import Mathlib.Topology.ContinuousFunction.Basic
 import Mathlib.Topology.Algebra.Module.Basic
 
+#align_import topology.algebra.continuous_affine_map from "leanprover-community/mathlib"@"bd1fc183335ea95a9519a1630bcf901fe9326d83"
+
 /-!
 # Continuous affine maps.
 
feat: port Topology.Algebra.ContinuousAffineMap (#3277)

Co-authored-by: Chris Hughes <chrishughes24@gmail.com> Co-authored-by: Moritz Doll <moritz.doll@googlemail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>

Dependencies 9 + 470

471 files ported (98.1%)
207533 lines ported (97.6%)
Show graph

The unported dependencies are