Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore(data/matrix/notation): split into 2 files #10199

Closed
wants to merge 5 commits into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Nov 6, 2021

I want to use ![a, b] notation in some files that don't need to import data.matrix.basic.


Open in Gitpod

@urkud urkud added the awaiting-review The author would like community review of the PR label Nov 6, 2021
import data.matrix.notation
import data.fin.vec_notation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you look through the other 13 files that import this and see if they can be relaxed too?

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors d+

@bors
Copy link

bors bot commented Nov 6, 2021

✌️ urkud can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Nov 6, 2021
@eric-wieser
Copy link
Member

CI is failing because these two lemmas need to move to the fin file:

@[simp] lemma smul_empty (x : α) (v : fin 0 → α) : x • v = ![] := empty_eq _

@[simp] lemma smul_cons (x y : α) (v : fin n → α) :
x • vec_cons y v = vec_cons (x * y) (x • v) :=
by { ext i, refine fin.cases _ _ i; simp }

-/
instance [has_repr α] : has_repr (fin n → α) :=
{ repr := λ f, "![" ++ (string.intercalate ", " ((list.fin_range n).map (λ n, repr (f n)))) ++ "]" }

/-- Use `![...]` notation for displaying a `fin`-indexed matrix, for example:

```
#eval ![![1, 2], ![3, 4]] + ![![3, 4], ![5, 6]] -- ![![4, 6], ![8, 10]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is weird, because lean doesn't even know this has type matrix so doesn't use this instance. Out of scope I guess though, since it was here before.

@urkud
Copy link
Member Author

urkud commented Nov 6, 2021

CI is failing because these two lemmas need to move to the fin file:

Then it will have to import algebra.module.pi

@eric-wieser
Copy link
Member

I think that's fine. If it becomes a problem in future, then I'd argue the solution is to split a group_theory.group_action.pi module out of algebra.module.pi, to match group_theory.group_action.prod.

@eric-wieser
Copy link
Member

bors d+

The CI failure is weird

@bors
Copy link

bors bot commented Nov 6, 2021

✌️ urkud can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@urkud
Copy link
Member Author

urkud commented Nov 7, 2021

bors merge

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Nov 7, 2021
bors bot pushed a commit that referenced this pull request Nov 7, 2021
I want to use `![a, b]` notation in some files that don't need to import `data.matrix.basic`.
@bors
Copy link

bors bot commented Nov 7, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(data/matrix/notation): split into 2 files [Merged by Bors] - chore(data/matrix/notation): split into 2 files Nov 7, 2021
@bors bors bot closed this Nov 7, 2021
@bors bors bot deleted the YK-vec-notation branch November 7, 2021 06:08
ericrbg pushed a commit that referenced this pull request Nov 9, 2021
I want to use `![a, b]` notation in some files that don't need to import `data.matrix.basic`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants