analysis.calculus.deriv.starMathlib.Analysis.Calculus.Deriv.Star

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
 import Analysis.Calculus.Deriv.Basic
-import Analysis.Calculus.Fderiv.Star
+import Analysis.Calculus.FDeriv.Star
 
 #align_import analysis.calculus.deriv.star from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
 
Diff
@@ -85,13 +85,13 @@ protected theorem HasStrictDerivAt.star (h : HasStrictDerivAt f f' x) :
 #print derivWithin.star /-
 protected theorem derivWithin.star (hxs : UniqueDiffWithinAt 𝕜 s x) :
     derivWithin (fun y => star (f y)) s x = star (derivWithin f s x) :=
-  FunLike.congr_fun (fderivWithin_star hxs) _
+  DFunLike.congr_fun (fderivWithin_star hxs) _
 #align deriv_within.star derivWithin.star
 -/
 
 #print deriv.star /-
 protected theorem deriv.star : deriv (fun y => star (f y)) x = star (deriv f x) :=
-  FunLike.congr_fun fderiv_star _
+  DFunLike.congr_fun fderiv_star _
 #align deriv.star deriv.star
 -/
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.Analysis.Calculus.Deriv.Basic
-import Mathbin.Analysis.Calculus.Fderiv.Star
+import Analysis.Calculus.Deriv.Basic
+import Analysis.Calculus.Fderiv.Star
 
 #align_import analysis.calculus.deriv.star from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.star
-! leanprover-community/mathlib commit f60c6087a7275b72d5db3c5a1d0e19e35a429c0a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.Deriv.Basic
 import Mathbin.Analysis.Calculus.Fderiv.Star
 
+#align_import analysis.calculus.deriv.star from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
+
 /-!
 # Star operations on derivatives
 
Diff
@@ -58,33 +58,45 @@ variable [StarRing 𝕜] [TrivialStar 𝕜] [StarAddMonoid F] [ContinuousStar F]
 
 variable [StarModule 𝕜 F]
 
+#print HasDerivAtFilter.star /-
 protected theorem HasDerivAtFilter.star (h : HasDerivAtFilter f f' x L) :
     HasDerivAtFilter (fun x => star (f x)) (star f') x L := by
   simpa using h.star.has_deriv_at_filter
 #align has_deriv_at_filter.star HasDerivAtFilter.star
+-/
 
+#print HasDerivWithinAt.star /-
 protected theorem HasDerivWithinAt.star (h : HasDerivWithinAt f f' s x) :
     HasDerivWithinAt (fun x => star (f x)) (star f') s x :=
   h.unit
 #align has_deriv_within_at.star HasDerivWithinAt.star
+-/
 
+#print HasDerivAt.star /-
 protected theorem HasDerivAt.star (h : HasDerivAt f f' x) :
     HasDerivAt (fun x => star (f x)) (star f') x :=
   h.unit
 #align has_deriv_at.star HasDerivAt.star
+-/
 
+#print HasStrictDerivAt.star /-
 protected theorem HasStrictDerivAt.star (h : HasStrictDerivAt f f' x) :
     HasStrictDerivAt (fun x => star (f x)) (star f') x := by simpa using h.star.has_strict_deriv_at
 #align has_strict_deriv_at.star HasStrictDerivAt.star
+-/
 
+#print derivWithin.star /-
 protected theorem derivWithin.star (hxs : UniqueDiffWithinAt 𝕜 s x) :
     derivWithin (fun y => star (f y)) s x = star (derivWithin f s x) :=
   FunLike.congr_fun (fderivWithin_star hxs) _
 #align deriv_within.star derivWithin.star
+-/
 
+#print deriv.star /-
 protected theorem deriv.star : deriv (fun y => star (f y)) x = star (deriv f x) :=
   FunLike.congr_fun fderiv_star _
 #align deriv.star deriv.star
+-/
 
 #print deriv.star' /-
 @[simp]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module analysis.calculus.deriv.star
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
+! leanprover-community/mathlib commit f60c6087a7275b72d5db3c5a1d0e19e35a429c0a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.Calculus.Fderiv.Star
 /-!
 # Star operations on derivatives
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file contains the usual formulas (and existence assertions) for the derivative of the star
 operation. Note that these only apply when the field that the derivative is respect to has a trivial
 star operation; which as should be expected rules out `𝕜 = ℂ`.
@@ -83,10 +86,12 @@ protected theorem deriv.star : deriv (fun y => star (f y)) x = star (deriv f x)
   FunLike.congr_fun fderiv_star _
 #align deriv.star deriv.star
 
+#print deriv.star' /-
 @[simp]
 protected theorem deriv.star' : (deriv fun y => star (f y)) = fun x => star (deriv f x) :=
   funext fun x => deriv.star
 #align deriv.star' deriv.star'
+-/
 
 end Star
 
Diff
@@ -24,7 +24,7 @@ universe u v w
 
 noncomputable section
 
-open Classical Topology BigOperators Filter ENNReal
+open scoped Classical Topology BigOperators Filter ENNReal
 
 open Filter Asymptotics Set
 

Changes in mathlib4

mathlib3
mathlib4
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
@@ -19,16 +19,13 @@ star operation; which as should be expected rules out `𝕜 = ℂ`.
 universe u v w
 
 variable {𝕜 : Type u} [NontriviallyNormedField 𝕜]
-
 variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
-
 variable {f : 𝕜 → F}
 
 /-! ### Derivative of `x ↦ star x` -/
 
 
 variable [StarRing 𝕜] [TrivialStar 𝕜] [StarAddMonoid F] [ContinuousStar F]
-
 variable [StarModule 𝕜 F] {f' : F} {s : Set 𝕜} {x : 𝕜} {L : Filter 𝕜}
 
 protected nonrec theorem HasDerivAtFilter.star (h : HasDerivAtFilter f f' x L) :
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
@@ -52,11 +52,11 @@ protected nonrec theorem HasStrictDerivAt.star (h : HasStrictDerivAt f f' x) :
 
 protected theorem derivWithin.star (hxs : UniqueDiffWithinAt 𝕜 s x) :
     derivWithin (fun y => star (f y)) s x = star (derivWithin f s x) :=
-  FunLike.congr_fun (fderivWithin_star hxs) _
+  DFunLike.congr_fun (fderivWithin_star hxs) _
 #align deriv_within.star derivWithin.star
 
 protected theorem deriv.star : deriv (fun y => star (f y)) x = star (deriv f x) :=
-  FunLike.congr_fun fderiv_star _
+  DFunLike.congr_fun fderiv_star _
 #align deriv.star deriv.star
 
 @[simp]
chore(Analysis,Geometry): remove almost all autoImplicit (#9691)

After this PR, no file in Geometry uses autoImplicit, and in Analysis it's scoped to six declarations.

Diff
@@ -16,9 +16,6 @@ operation. Note that these only apply when the field that the derivative is resp
 star operation; which as should be expected rules out `𝕜 = ℂ`.
 -/
 
-set_option autoImplicit true
-
-
 universe u v w
 
 variable {𝕜 : Type u} [NontriviallyNormedField 𝕜]
@@ -32,7 +29,7 @@ variable {f : 𝕜 → F}
 
 variable [StarRing 𝕜] [TrivialStar 𝕜] [StarAddMonoid F] [ContinuousStar F]
 
-variable [StarModule 𝕜 F]
+variable [StarModule 𝕜 F] {f' : F} {s : Set 𝕜} {x : 𝕜} {L : Filter 𝕜}
 
 protected nonrec theorem HasDerivAtFilter.star (h : HasDerivAtFilter f f' x L) :
     HasDerivAtFilter (fun x => star (f x)) (star f') x L := by
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -16,6 +16,8 @@ operation. Note that these only apply when the field that the derivative is resp
 star operation; which as should be expected rules out `𝕜 = ℂ`.
 -/
 
+set_option autoImplicit true
+
 
 universe u v w
 
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,15 +2,12 @@
 Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.star
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Calculus.Deriv.Basic
 import Mathlib.Analysis.Calculus.FDeriv.Star
 
+#align_import analysis.calculus.deriv.star from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
 /-!
 # Star operations on derivatives
 
feat: port Analysis.Calculus.Deriv.Star (#4452)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Dependencies 10 + 688

689 files ported (98.6%)
305080 lines ported (98.3%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file