diff --git a/leanpkg.toml b/leanpkg.toml index e872c5b..8258331 100644 --- a/leanpkg.toml +++ b/leanpkg.toml @@ -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 = "5aa3c1de9f3c642eac76e11071c852766f220fd0"} diff --git a/src/demos/category_theory.lean b/src/demos/category_theory.lean index 02e9a9c..bc628f0 100644 --- a/src/demos/category_theory.lean +++ b/src/demos/category_theory.lean @@ -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 @@ -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 diff --git a/src/demos/linalg.lean b/src/demos/linalg.lean index e369b5e..0a4a84f 100644 --- a/src/demos/linalg.lean +++ b/src/demos/linalg.lean @@ -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 @@ -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 @@ -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 `⁻¹`. diff --git a/src/exercises_sources/friday/analysis.lean b/src/exercises_sources/friday/analysis.lean index cc01529..439e8a7 100644 --- a/src/exercises_sources/friday/analysis.lean +++ b/src/exercises_sources/friday/analysis.lean @@ -14,7 +14,7 @@ namespace lftcm noncomputable theory open real -open_locale topological_space filter classical real +open_locale topology filter classical real /-! # Derivatives diff --git a/src/exercises_sources/friday/topology.lean b/src/exercises_sources/friday/topology.lean index aa1d1f1..1d20917 100644 --- a/src/exercises_sources/friday/topology.lean +++ b/src/exercises_sources/friday/topology.lean @@ -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 diff --git a/src/exercises_sources/thursday/category_theory/exercise2.lean b/src/exercises_sources/thursday/category_theory/exercise2.lean index 4038686..f04b7d3 100644 --- a/src/exercises_sources/thursday/category_theory/exercise2.lean +++ b/src/exercises_sources/thursday/category_theory/exercise2.lean @@ -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`. diff --git a/src/exercises_sources/thursday/category_theory/exercise4.lean b/src/exercises_sources/thursday/category_theory/exercise4.lean index f481ab3..27ac1a9 100644 --- a/src/exercises_sources/thursday/category_theory/exercise4.lean +++ b/src/exercises_sources/thursday/category_theory/exercise4.lean @@ -1,4 +1,4 @@ -import algebra.category.Ring +import algebra.category.Ring.basic import category_theory.yoneda import data.polynomial.algebra_map diff --git a/src/exercises_sources/thursday/groups_rings_fields.lean b/src/exercises_sources/thursday/groups_rings_fields.lean index cd69f03..dce8623 100644 --- a/src/exercises_sources/thursday/groups_rings_fields.lean +++ b/src/exercises_sources/thursday/groups_rings_fields.lean @@ -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 /-! diff --git a/src/exercises_sources/thursday/linear_algebra.lean b/src/exercises_sources/thursday/linear_algebra.lean index 798a675..387f663 100644 --- a/src/exercises_sources/thursday/linear_algebra.lean +++ b/src/exercises_sources/thursday/linear_algebra.lean @@ -1,7 +1,7 @@ import analysis.inner_product_space.basic import data.matrix.notation import linear_algebra.bilinear_form -import linear_algebra.matrix +-- import linear_algebra.matrix.basic import tactic universes u v @@ -166,10 +166,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 diff --git a/src/exercises_sources/tuesday/sets.lean b/src/exercises_sources/tuesday/sets.lean index 0ef1bd0..7dcbf1c 100644 --- a/src/exercises_sources/tuesday/sets.lean +++ b/src/exercises_sources/tuesday/sets.lean @@ -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 diff --git a/src/for_mathlib/manifolds.lean b/src/for_mathlib/manifolds.lean index 4ec8607..accf4a4 100644 --- a/src/for_mathlib/manifolds.lean +++ b/src/for_mathlib/manifolds.lean @@ -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 @@ -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 _) _, diff --git a/src/hints/category_theory/exercise2/hint1.lean b/src/hints/category_theory/exercise2/hint1.lean index 33b5617..db512dd 100644 --- a/src/hints/category_theory/exercise2/hint1.lean +++ b/src/hints/category_theory/exercise2/hint1.lean @@ -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 diff --git a/src/hints/category_theory/exercise2/hint2.lean b/src/hints/category_theory/exercise2/hint2.lean index 179c100..43e85db 100644 --- a/src/hints/category_theory/exercise2/hint2.lean +++ b/src/hints/category_theory/exercise2/hint2.lean @@ -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 diff --git a/src/hints/category_theory/exercise2/hint3.lean b/src/hints/category_theory/exercise2/hint3.lean index 87fd544..c7d646c 100644 --- a/src/hints/category_theory/exercise2/hint3.lean +++ b/src/hints/category_theory/exercise2/hint3.lean @@ -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 diff --git a/src/hints/category_theory/exercise2/hint4.lean b/src/hints/category_theory/exercise2/hint4.lean index c793042..882e12e 100644 --- a/src/hints/category_theory/exercise2/hint4.lean +++ b/src/hints/category_theory/exercise2/hint4.lean @@ -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 diff --git a/src/hints/category_theory/exercise2/hint5.lean b/src/hints/category_theory/exercise2/hint5.lean index e47eb15..ca671b8 100644 --- a/src/hints/category_theory/exercise2/hint5.lean +++ b/src/hints/category_theory/exercise2/hint5.lean @@ -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 diff --git a/src/hints/category_theory/exercise2/hint6.lean b/src/hints/category_theory/exercise2/hint6.lean index 5a2f55f..e0ec859 100644 --- a/src/hints/category_theory/exercise2/hint6.lean +++ b/src/hints/category_theory/exercise2/hint6.lean @@ -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 diff --git a/src/hints/category_theory/exercise2/hint7.lean b/src/hints/category_theory/exercise2/hint7.lean index 30b9ad7..9986204 100644 --- a/src/hints/category_theory/exercise2/hint7.lean +++ b/src/hints/category_theory/exercise2/hint7.lean @@ -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 diff --git a/src/hints/category_theory/exercise4/hint1.lean b/src/hints/category_theory/exercise4/hint1.lean index 738ba52..95847a6 100644 --- a/src/hints/category_theory/exercise4/hint1.lean +++ b/src/hints/category_theory/exercise4/hint1.lean @@ -1,4 +1,4 @@ -import algebra.category.Ring +import algebra.category.Ring.basic import category_theory.yoneda import data.polynomial.algebra_map diff --git a/src/hints/category_theory/exercise4/hint2.lean b/src/hints/category_theory/exercise4/hint2.lean index 373a14a..4985d82 100644 --- a/src/hints/category_theory/exercise4/hint2.lean +++ b/src/hints/category_theory/exercise4/hint2.lean @@ -1,4 +1,4 @@ -import algebra.category.Ring +import algebra.category.Ring.basic import category_theory.yoneda import data.polynomial.algebra_map diff --git a/src/hints/category_theory/exercise4/hint3.lean b/src/hints/category_theory/exercise4/hint3.lean index 149cf8c..147c90d 100644 --- a/src/hints/category_theory/exercise4/hint3.lean +++ b/src/hints/category_theory/exercise4/hint3.lean @@ -1,4 +1,4 @@ -import algebra.category.Ring +import algebra.category.Ring.basic import category_theory.yoneda import data.polynomial.algebra_map diff --git a/src/hints/category_theory/exercise4/hint4.lean b/src/hints/category_theory/exercise4/hint4.lean index 3a74356..205747f 100644 --- a/src/hints/category_theory/exercise4/hint4.lean +++ b/src/hints/category_theory/exercise4/hint4.lean @@ -1,4 +1,4 @@ -import algebra.category.Ring +import algebra.category.Ring.basic import category_theory.yoneda import data.polynomial.algebra_map diff --git a/src/solutions/friday/topology.lean b/src/solutions/friday/topology.lean index 2be793b..62599e6 100644 --- a/src/solutions/friday/topology.lean +++ b/src/solutions/friday/topology.lean @@ -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 diff --git a/src/solutions/thursday/category_theory/exercise2.lean b/src/solutions/thursday/category_theory/exercise2.lean index 745d2fd..b34191c 100644 --- a/src/solutions/thursday/category_theory/exercise2.lean +++ b/src/solutions/thursday/category_theory/exercise2.lean @@ -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`. diff --git a/src/solutions/thursday/category_theory/exercise4.lean b/src/solutions/thursday/category_theory/exercise4.lean index f818987..838bb4b 100644 --- a/src/solutions/thursday/category_theory/exercise4.lean +++ b/src/solutions/thursday/category_theory/exercise4.lean @@ -1,4 +1,4 @@ -import algebra.category.Ring +import algebra.category.Ring.basic import category_theory.yoneda import data.polynomial.algebra_map diff --git a/src/solutions/thursday/groups_rings_fields.lean b/src/solutions/thursday/groups_rings_fields.lean index 634f3b8..e240b56 100644 --- a/src/solutions/thursday/groups_rings_fields.lean +++ b/src/solutions/thursday/groups_rings_fields.lean @@ -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 /-! @@ -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, diff --git a/src/solutions/thursday/linear_algebra.lean b/src/solutions/thursday/linear_algebra.lean index 5e07ed7..eca86d8 100644 --- a/src/solutions/thursday/linear_algebra.lean +++ b/src/solutions/thursday/linear_algebra.lean @@ -1,7 +1,7 @@ import analysis.inner_product_space.basic import data.matrix.notation import linear_algebra.bilinear_form -import linear_algebra.matrix +-- import linear_algebra.matrix.basic import tactic universes u v @@ -235,18 +235,21 @@ 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 { inner := dot_product, nonneg_re := λ x, finset.sum_nonneg (λ i _, mul_self_nonneg _), definite := λ x hx, funext (λ i, mul_self_eq_zero.mp ((finset.sum_eq_zero_iff_of_nonneg (λ i _, mul_self_nonneg (x i))).mp hx i (finset.mem_univ i))), - conj_sym := λ x y, dot_product_comm _ _, + conj_symm := λ x y, dot_product_comm _ _, add_left := λ x y z, add_dot_product _ _ _, smul_left := λ s x y, smul_dot_product _ _ _ } -- sorry +noncomputable instance : inner_product_space ℝ (n → ℝ) := +inner_product_space.of_core _ + end pi end exercise3 diff --git a/src/solutions/tuesday/numbers.lean b/src/solutions/tuesday/numbers.lean index 5968613..4868b23 100644 --- a/src/solutions/tuesday/numbers.lean +++ b/src/solutions/tuesday/numbers.lean @@ -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 /-! diff --git a/src/solutions/tuesday/sets.lean b/src/solutions/tuesday/sets.lean index 31a072c..825d80b 100644 --- a/src/solutions/tuesday/sets.lean +++ b/src/solutions/tuesday/sets.lean @@ -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