Skip to content

[Merged by Bors] - feat: add instances for intervals#5957

Closed
kim-em wants to merge 66 commits intomasterfrom
interval_instances
Closed

[Merged by Bors] - feat: add instances for intervals#5957
kim-em wants to merge 66 commits intomasterfrom
interval_instances

Conversation

@kim-em
Copy link
Copy Markdown
Contributor

@kim-em kim-em commented Jul 17, 2023

Don't mind at all if anyone would like to push refactors or golfs. My main requirement from this PR is that

import Mathlib

example : WellFoundedLT { x : ℕ // x ≤ 37 }ᵒᵈ := inferInstance

works out of the box.


Open in Gitpod

@kim-em kim-em added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Jul 17, 2023
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jul 17, 2023
@eric-wieser eric-wieser added t-order Order theory awaiting-author A reviewer has asked the author a question or requested changes. and removed awaiting-review labels Jul 31, 2023
@kim-em kim-em added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Aug 1, 2023
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Aug 1, 2023
tb65536 and others added 22 commits August 3, 2023 14:55
…v program (#6284)

The Cache program after detecting that LeanTar is old downloads it and attempts to place it in the `CACHEDIR` directory. It then attempts to rename it using the `mv` command it assumes is present on the platform. On windows `cmd` and `powershell` this does not work since `mv` is actually a shell built in and not an executable. (This will however work on MinGW based shells).

@digama0 added the function `IO.FS.rename` in Lean [Lean4#2345](leanprover/lean4#2345 (comment)) which calls the standard C/C++ function `rename`. This PR uses this function to move leantar instead of the runCmd command. When this fix succeeds the output looks like the following (in powershell).

```text
PS W:\LeanStuff\graveyard_mathlib4\LeanCacheFix> lake exe cache get
leantar is too old; downloading more recent version
Attempting to download 3614 file(s)
Downloaded: 3614 file(s) [attempted 3614/3614 = 100%] (100% success)
Decompressing 3614 file(s)
unpacked in 323 ms
```



Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Add the following result: 
```lean
theorem mem_span_integralBasis {x : K} :
    x ∈ Submodule.span ℤ (Set.range (integralBasis K)) ↔ x ∈ 𝓞 K
```
that is, `integralBasis` is indeed a `ℤ`-basis of the ring of integers. 

Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>



Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>
This was done once in #5063, then accidentally reverted in #5859.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
This file provides the basic definitions of matrices composed from columns and rows. The concatenation of two matrices with the same row indices can be expressed as `A = fromColumns A₁ A₂` the concatenation of two matrices with the same column indices can be expressed as `B = fromRows B₁ B₂`.

We then provide a few lemmas that deal with the products of these with each other and with block matrices. Two particular lemmas `fromColumns_mul_fromRows_eq_one_comm` and `equiv_compl_fromColumns_mul_fromRows_eq_one_comm` deal with the case of matrix multiplication that gives one as a result. This gives a crude (but usable) replacement for the `Invertible` type which can only be applied to square matrices (with the same index type for rows and columns).
Found while doing a larger refactor. This doesn't change any defeqs, and the new proofs make it obvious that there's nothing interesting going on here.
… n` (#6292)

This PR replaces `Fact ((n : ℕ) % 2 = 1)` with `Odd n`, as suggested in #6086.
…ic (#4595)

This is a first PR porting some of the functionality of the `extract_goal` tactic from mathlib3.



Co-authored-by: Alex J Best <alex.j.best@gmail.com>
…independence (#6294)

Independence is the special case of independence with respect to a kernel and a measure where the kernel is constant.
Modify `tauto` to throw an error message "tauto failed to solve some goals" if it fails.
This generalizes from `Algebra.lsmul R M : A →ₐ[R] Module.End R M` to `Algebra.lsmul R S M : A →ₐ[R] Module.End S M`.

This generalization was previously not possible because `Module.End S M` was not an `R`-algebra.

Notably this now allows things like `Algebra.lsmul R A A : Aᵐᵒᵖ →ₐ[R] Module.End A A` (right multiplication).

This doesn't bother attempting to generalize uses in downstream files, as most of them probably do not need the generality.
Instead, we just replace `Algebra.lsmul R` with `Algebra.lsmul R R`.
An R-derivation from `R[X]` is determined by its value on `X`. Joint work with Richard Hill, who needs this stuff for his work on power series. We followed `MvPolynomial.Derivation` .




Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Oliver Nash <github@olivernash.org>
…Equiv` (#6305)

This is consistent with `LinearIsometryEquiv` vs `LinearIsometry`. The motivation is to make room for `QuadraticForm.Isometry` as the homomorphism.
…6314)

This is easier to remove from the `classical` locale in future, and is arguably more readable
This removes the `with` pattern from the `Field` and `CommSemiGroupWithZero` instances on `Rat`.

The resulting term decreases in size by an order of magnitude (at least).



Co-authored-by: Matthew Robert Ballard <100034030+mattrobball@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
We define the torsion subgroup of the units of a number field and prove some results about it, mostly: it is finite, cyclic and 
an unit is torsion iff its value is 1 at all infinite places. Some results linking to `rootsOfUnity` are also proved. 

This PR also includes a direct coercion from `(𝓞 K)ˣ` to `K` that is very convenient, although I am not sure it's done properly.
@kim-em
Copy link
Copy Markdown
Contributor Author

kim-em commented Aug 3, 2023

bors merge

bors bot pushed a commit that referenced this pull request Aug 3, 2023
Don't mind at all if anyone would like to push refactors or golfs. My main requirement from this PR is that
```lean
import Mathlib

example : WellFoundedLT { x : ℕ // x ≤ 37 }ᵒᵈ := inferInstance
```
works out of the box.




Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Matthew Robert Ballard <matt@mrb.email>
Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Jz Pan <acme_pjz@hotmail.com>
Co-authored-by: Thomas Browning <tb65536@uw.edu>
Co-authored-by: Oliver Nash <github@olivernash.org>
Co-authored-by: Christopher Hoskin <christopher.hoskin@gmail.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com>
Co-authored-by: Matthew Robert Ballard <k.buzzard@imperial.ac.uk>
Co-authored-by: Peter Nelson <71660771+apnelson1@users.noreply.github.com>
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
Co-authored-by: MohanadAhmed <m.a.m.elhassan@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: damiano <adomani@gmail.com>
Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
Co-authored-by: Rémy Degenne <Remydegenne@gmail.com>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
@bors
Copy link
Copy Markdown

bors bot commented Aug 3, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: add instances for intervals [Merged by Bors] - feat: add instances for intervals Aug 3, 2023
@bors bors bot closed this Aug 3, 2023
@bors bors bot deleted the interval_instances branch August 3, 2023 06:42
kim-em added a commit that referenced this pull request Aug 3, 2023
Don't mind at all if anyone would like to push refactors or golfs. My main requirement from this PR is that
```lean
import Mathlib

example : WellFoundedLT { x : ℕ // x ≤ 37 }ᵒᵈ := inferInstance
```
works out of the box.




Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Matthew Robert Ballard <matt@mrb.email>
Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Jz Pan <acme_pjz@hotmail.com>
Co-authored-by: Thomas Browning <tb65536@uw.edu>
Co-authored-by: Oliver Nash <github@olivernash.org>
Co-authored-by: Christopher Hoskin <christopher.hoskin@gmail.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com>
Co-authored-by: Matthew Robert Ballard <k.buzzard@imperial.ac.uk>
Co-authored-by: Peter Nelson <71660771+apnelson1@users.noreply.github.com>
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
Co-authored-by: MohanadAhmed <m.a.m.elhassan@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: damiano <adomani@gmail.com>
Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
Co-authored-by: Rémy Degenne <Remydegenne@gmail.com>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
kim-em added a commit that referenced this pull request Aug 14, 2023
Don't mind at all if anyone would like to push refactors or golfs. My main requirement from this PR is that
```lean
import Mathlib

example : WellFoundedLT { x : ℕ // x ≤ 37 }ᵒᵈ := inferInstance
```
works out of the box.




Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Matthew Robert Ballard <matt@mrb.email>
Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Jz Pan <acme_pjz@hotmail.com>
Co-authored-by: Thomas Browning <tb65536@uw.edu>
Co-authored-by: Oliver Nash <github@olivernash.org>
Co-authored-by: Christopher Hoskin <christopher.hoskin@gmail.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com>
Co-authored-by: Matthew Robert Ballard <k.buzzard@imperial.ac.uk>
Co-authored-by: Peter Nelson <71660771+apnelson1@users.noreply.github.com>
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
Co-authored-by: MohanadAhmed <m.a.m.elhassan@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: damiano <adomani@gmail.com>
Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
Co-authored-by: Rémy Degenne <Remydegenne@gmail.com>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.