Skip to content

Commit

Permalink
Merge pull request #148 from leanprover-community/mathlib-bump
Browse files Browse the repository at this point in the history
Upgrade Lean and mathlib
  • Loading branch information
eric-wieser authored Oct 23, 2023
2 parents 9c5d579 + ff2330a commit e9538f9
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 62 deletions.
2 changes: 1 addition & 1 deletion leanpkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ lean_version = "leanprover-community/lean:3.50.3"
path = "src"

[dependencies]
mathlib = {git = "https://github.com/leanprover-community/mathlib", rev = "d1723c047a091ae3fca0af8aeab1743e1a898611"}
mathlib = {git = "https://github.com/leanprover-community/mathlib", rev = "9dba31df156d9d65b9d78db449542ca73d147c68"}
4 changes: 2 additions & 2 deletions src/demos/category_theory.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import category_theory.category.basic
import category_theory.functor
import category_theory.functor.basic

import algebra.category.Group.images
import algebra.category.Group.colimits
Expand All @@ -11,7 +11,7 @@ import category_theory.abelian.basic
import category_theory.limits.shapes.finite_limits

import topology.instances.real
import topology.category.Top
import topology.category.Top.limits
import topology.category.UniformSpace


Expand Down
14 changes: 7 additions & 7 deletions src/demos/linalg.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.module
import algebra.module.basic
import analysis.inner_product_space.basic
import data.matrix.notation
import data.matrix.dmatrix
Expand Down Expand Up @@ -213,14 +213,14 @@ are `fintype`s, and there is no restriction on the type `α` of the entries.
Like vectors in `n → R`, matrices are typically indexed over `fin k`.
To define a matrix, you map the indexes to the entry:
-/
def example_matrix : matrix (fin 2) (fin 3) ℤ := λ i j, i + j
def example_matrix : matrix (fin 2) (fin 3) ℤ := matrix.of (λ i j, (↑i + ↑j : ℤ))
#eval example_matrix 1 2

/- Like vectors, we can use `![...]` notation to define matrices: -/
/- Simiilarly to vectors, we can use `!![...]` notation to define matrices: -/
def other_example_matrix : matrix (fin 3) (fin 2) ℤ :=
![![0, 1],
![1, 2],
![2, 3]]
!![0, 1;
1, 2;
2, 3]

/- We have the 0 matrix and the sum of two matrices: -/
example (i j) : (0 : matrix m n R) i j = 0 := dmatrix.zero_apply i j
Expand Down Expand Up @@ -262,7 +262,7 @@ as long as you have chosen a basis for each module.
-/
variables [decidable_eq m] [decidable_eq n]
variables (v : basis m R M) (w : basis n R N)
#check linear_map.to_matrix v w -- (M →ₗ[R] N) [R] matrix n m R
#check linear_map.to_matrix v w -- (M →ₗ[R] N) [R] matrix n m R

/-
Invertible (i.e. nonsingular) matrices have an inverse operation denoted by `⁻¹`.
Expand Down
2 changes: 1 addition & 1 deletion src/exercises_sources/friday/analysis.lean
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace lftcm
noncomputable theory

open real
open_locale topological_space filter classical real
open_locale topology filter classical real

/-!
# Derivatives
Expand Down
16 changes: 11 additions & 5 deletions src/exercises_sources/friday/manifolds.lean
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,13 @@ be a smooth manifold. -/
-- the type `tangent_bundle 𝓡1 myℝ` makes sense
#check tangent_bundle 𝓡1 myℝ

/- The tangent space above a point of `myℝ` is just a one-dimensional vector space (identified with `ℝ`).
/- The tangent space above a point of `myℝ` is just a one-dimensional vector space
(identified with `ℝ`).
So, one can prescribe an element of the tangent bundle as a pair (more on this below) -/
example : tangent_bundle 𝓡1 myℝ := ⟨(4 : ℝ), 0

/- Construct the smooth manifold structure on the tangent bundle. Hint: the answer is a one-liner,
and this instance is not really needed. -/
instance tangent_bundle_myℝ : smooth_manifold_with_corners (𝓡1.prod 𝓡1) (tangent_bundle 𝓡1 myℝ) :=
/- Type-class inference can construct the smooth manifold structure on the tangent bundle. -/
example : smooth_manifold_with_corners (𝓡1.prod 𝓡1) (tangent_bundle 𝓡1 myℝ) :=
sorry

/-
Expand All @@ -472,7 +472,13 @@ NB: the model space for the tangent bundle to a product manifold or a tangent sp
structures with model `ℝ × ℝ`, the identity one and the product one, which are not definitionally
equal. And this would be bad.
-/
#check tangent_bundle.charted_space 𝓡1 myℝ
example : charted_space (model_prod ℝ ℝ) (tangent_bundle 𝓡1 myℝ) :=
sorry

/-
The charts of any smooth vector bundle are characterized by `fiber_bundle.charted_space_chart_at`
-/
#check @fiber_bundle.charted_space_chart_at

/- A smooth map between manifolds induces a map between their tangent bundles. In `mathlib` this is
called the `tangent_map` (you might instead know it as the "differential" or "pushforward" of the
Expand Down
2 changes: 1 addition & 1 deletion src/exercises_sources/friday/topology.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import topology.metric_space.basic

open_locale classical filter topological_space
open_locale classical filter topology

namespace lftcm
open filter set
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

/-!
Let's show that taking polynomials over a ring is functor `Ring ⥤ Ring`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.category.Ring
import algebra.category.Ring.basic
import category_theory.yoneda
import data.polynomial.algebra_map

Expand Down
1 change: 1 addition & 0 deletions src/exercises_sources/thursday/groups_rings_fields.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import linear_algebra.finite_dimensional
import ring_theory.algebraic
import data.zmod.basic
import data.real.basic
import data.nat.choose.dvd
import tactic

/-!
Expand Down
10 changes: 6 additions & 4 deletions src/exercises_sources/thursday/linear_algebra.lean
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import analysis.inner_product_space.basic
import data.matrix.notation
import linear_algebra.bilinear_form
import linear_algebra.matrix
import tactic

universes u v
Expand Down Expand Up @@ -134,7 +133,7 @@ Hints:
* Use the `simp` tactic to simplify `(x + y) i` to `x i + y i` and `(s • x) i` to `s * x i`.
* To deal with equalities containing many `+` and `*` symbols, use the `ring` tactic.
-/
def A : matrix (fin 2) (fin 2) R := ![![1, 0], ![-2, 1]]
def A : matrix (fin 2) (fin 2) R := !![1, 0; -2, 1]
def your_bilin_form : bilin_form R (fin 2 → R) :=
sorry

Expand Down Expand Up @@ -166,10 +165,13 @@ Hints:
* Try the lemmas `finset.sum_nonneg`, `finset.sum_eq_zero_iff_of_nonneg`,
`mul_self_nonneg` and `mul_self_eq_zero`.
-/
noncomputable instance : inner_product_space ℝ (n → ℝ) :=
inner_product_space.of_core
noncomputable instance : normed_add_comm_group (n → ℝ):=
@inner_product_space.of_core.to_normed_add_comm_group ℝ (n → ℝ) _ _ _
sorry

noncomputable instance : inner_product_space ℝ (n → ℝ) :=
inner_product_space.of_core _

end pi

end exercise3
Expand Down
2 changes: 1 addition & 1 deletion src/exercises_sources/tuesday/numbers.lean
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tactic
import data.real.basic
import data.int.gcd
import number_theory.padics
import number_theory.padics.padic_numbers
import data.nat.prime_norm_num

/-!
Expand Down
1 change: 1 addition & 0 deletions src/exercises_sources/tuesday/sets.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import data.set.basic data.set.lattice data.nat.parity
import data.nat.prime
import tactic.linarith

open set nat function
Expand Down
4 changes: 2 additions & 2 deletions src/for_mathlib/manifolds.lean
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include hp
lemma pi_Lp.norm_coord_le_norm (x : pi_Lp p α) (i : ι) : ‖x i‖ ≤ ‖x‖ :=
begin
unfreezingI { rcases p.trichotomy with (rfl | rfl | h) },
{ exact false.elim (lt_irrefl _ (ennreal.zero_lt_one.trans_le hp.out)) },
{ exact false.elim (lt_irrefl _ (zero_lt_one.trans_le hp.out)) },
{ rw pi_Lp.norm_eq_csupr,
exact le_cSup (finite_range _).bdd_above (mem_range_self _) },
{ calc
Expand Down Expand Up @@ -74,7 +74,7 @@ begin
begin
refine (F i).mk_continuous 1 (λ x, _),
unfreezingI { rcases p.trichotomy with (rfl | rfl | h) },
{ exact false.elim (lt_irrefl _ (ennreal.zero_lt_one.trans_le hp.out)) },
{ exact false.elim (lt_irrefl _ (zero_lt_one.trans_le hp.out)) },
{ haveI : nonempty ι := ⟨i⟩,
simp only [pi_Lp.norm_eq_csupr, linear_map.coe_mk, one_mul],
refine cSup_le (range_nonempty _) _,
Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint1.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint2.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint3.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint4.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint5.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint6.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise2/hint7.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

noncomputable theory -- the default implementation of polynomials is noncomputable

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise4/hint1.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.category.Ring
import algebra.category.Ring.basic
import category_theory.yoneda
import data.polynomial.algebra_map

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise4/hint2.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.category.Ring
import algebra.category.Ring.basic
import category_theory.yoneda
import data.polynomial.algebra_map

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise4/hint3.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.category.Ring
import algebra.category.Ring.basic
import category_theory.yoneda
import data.polynomial.algebra_map

Expand Down
2 changes: 1 addition & 1 deletion src/hints/category_theory/exercise4/hint4.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.category.Ring
import algebra.category.Ring.basic
import category_theory.yoneda
import data.polynomial.algebra_map

Expand Down
40 changes: 26 additions & 14 deletions src/solutions/friday/manifolds.lean
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,13 @@ be a smooth manifold. -/
-- the type `tangent_bundle 𝓡1 myℝ` makes sense
#check tangent_bundle 𝓡1 myℝ

/- The tangent space above a point of `myℝ` is just a one-dimensional vector space (identified with `ℝ`).
/- The tangent space above a point of `myℝ` is just a one-dimensional vector space
(identified with `ℝ`).
So, one can prescribe an element of the tangent bundle as a pair (more on this below) -/
example : tangent_bundle 𝓡1 myℝ := ⟨(4 : ℝ), 0

/- Construct the smooth manifold structure on the tangent bundle. Hint: the answer is a one-liner,
and this instance is not really needed. -/
instance tangent_bundle_myℝ : smooth_manifold_with_corners (𝓡1.prod 𝓡1) (tangent_bundle 𝓡1 myℝ) :=
/- Type-class inference can construct the smooth manifold structure on the tangent bundle. -/
example : smooth_manifold_with_corners (𝓡1.prod 𝓡1) (tangent_bundle 𝓡1 myℝ) :=
-- sorry
by apply_instance
-- sorry
Expand All @@ -527,7 +527,15 @@ NB: the model space for the tangent bundle to a product manifold or a tangent sp
structures with model `ℝ × ℝ`, the identity one and the product one, which are not definitionally
equal. And this would be bad.
-/
#check tangent_bundle.charted_space 𝓡1 myℝ
example : charted_space (model_prod ℝ ℝ) (tangent_bundle 𝓡1 myℝ) :=
-- sorry
by apply_instance
-- sorry

/-
The charts of any smooth vector bundle are characterized by `fiber_bundle.charted_space_chart_at`
-/
#check @fiber_bundle.charted_space_chart_at

/- A smooth map between manifolds induces a map between their tangent bundles. In `mathlib` this is
called the `tangent_map` (you might instead know it as the "differential" or "pushforward" of the
Expand Down Expand Up @@ -559,8 +567,11 @@ begin
let p : tangent_bundle 𝓡1 myℝ := ⟨(4 : ℝ), 0⟩,
let F := chart_at (model_prod ℝ ℝ) p,
have A : ¬ ((4 : ℝ) < 1), by norm_num,
have S : F.source = univ, by simp [F, chart_at, A, @local_homeomorph.refl_source ℝ _],
have T : F.target = univ, by simp [F, chart_at, A, @local_homeomorph.refl_target ℝ _],
have S : F.source = univ,
by simp [F, fiber_bundle.charted_space_chart_at, chart_at, A, local_homeomorph.refl_source ℝ],
have T : F.target = univ,
by simp [F, fiber_bundle.charted_space_chart_at, chart_at, A, local_homeomorph.refl_source ℝ,
local_homeomorph.refl_target ℝ],
exact F.to_homeomorph_of_source_eq_univ_target_eq_univ S T,
-- sorry
end
Expand Down Expand Up @@ -636,13 +647,14 @@ begin
-- are left with a statement speaking of derivatives of real functions, without any manifold code left.
-- sorry
have : ¬ ((3 : ℝ) < 1), by norm_num,
simp only [chart_at, this, mem_Ioo, if_false, and_false],
dsimp [tangent_bundle_core, basic_smooth_vector_bundle_core.chart, bundle.total_space.proj],
simp only [chart_at, fiber_bundle.charted_space_chart_at, this, mem_Ioo, if_false, and_false,
local_homeomorph.trans_apply, tangent_bundle.trivialization_at_apply, fderiv_within_univ]
with mfld_simps,
split_ifs,
{ simp only [chart_at, h, my_first_local_homeo, if_true, fderiv_within_univ, mem_Ioo, fderiv_id',
continuous_linear_map.coe_id', continuous_linear_map.neg_apply, fderiv_neg] with mfld_simps },
{ simp only [chart_at, h, fderiv_within_univ, mem_Ioo, if_false, @local_homeomorph.refl_symm ℝ,
fderiv_id, continuous_linear_map.coe_id'] with mfld_simps }
{ simp only [my_first_local_homeo, fderiv_neg, fderiv_id',
continuous_linear_map.coe_id', continuous_linear_map.neg_apply] with mfld_simps },
{ simp only [@local_homeomorph.refl_symm ℝ, fderiv_id,
continuous_linear_map.coe_id'] with mfld_simps }
-- sorry
end

Expand Down Expand Up @@ -946,7 +958,7 @@ def G : tangent_bundle (𝓡∂ 1) (Icc (0 : ℝ) 1) → (Icc (0 : ℝ) 1) ×
lemma continuous_G : continuous G :=
begin
-- sorry
apply continuous.prod_mk (tangent_bundle_proj_continuous _ _),
refine (continuous_proj (euclidean_space ℝ (fin 1)) (tangent_space (𝓡∂ 1))).prod_mk _,
refine continuous_snd.comp _,
apply continuous.comp (homeomorph.continuous _),
apply cont_mdiff.continuous_tangent_map cont_mdiff_g le_top,
Expand Down
2 changes: 1 addition & 1 deletion src/solutions/friday/topology.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import topology.metric_space.basic

open_locale classical filter topological_space
open_locale classical filter topology

namespace lftcm
open filter set
Expand Down
2 changes: 1 addition & 1 deletion src/solutions/thursday/category_theory/exercise2.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import algebra.category.Ring.basic
import data.polynomial
import data.polynomial.lifts

/-!
Let's show that taking polynomials over a ring is functor `Ring ⥤ Ring`.
Expand Down
2 changes: 1 addition & 1 deletion src/solutions/thursday/category_theory/exercise4.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import algebra.category.Ring
import algebra.category.Ring.basic
import category_theory.yoneda
import data.polynomial.algebra_map

Expand Down
4 changes: 2 additions & 2 deletions src/solutions/thursday/groups_rings_fields.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import linear_algebra.finite_dimensional
import ring_theory.algebraic
import data.zmod.basic
import data.real.basic
import data.nat.choose.dvd
import tactic

/-!
Expand Down Expand Up @@ -292,8 +293,7 @@ begin
{ intros i hi hi0,
convert mul_zero _,
rw char_p.cast_eq_zero_iff K p,
apply nat.prime.dvd_choose_self _ _ (fact.out p.prime),
{ rwa pos_iff_ne_zero },
apply nat.prime.dvd_choose_self (fact.out p.prime) hi0 _,
{ simpa using hi } },
{ intro h,
simp only [le_zero_iff, mem_range, not_lt] at h,
Expand Down
Loading

0 comments on commit e9538f9

Please sign in to comment.