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] - refactor(linear_algebra/pi): add linear_map.single
to match add_monoid_hom.single
#6315
Conversation
…noid_hom.single` This changes the definition of `std_basis` to be exactly `linear_map.single`, but proves equality with the old definition. In future, it might make sense to remove `std_basis` entirely.
ada381d
to
c1581c0
Compare
@[simps] | ||
def single [decidable_eq ι] (i : ι) : φ i →ₗ[R] (Πi, φ i) := | ||
{ to_fun := pi.single i, | ||
map_smul' := λ r x, begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you simplify linear_map.single i x
to pi.single i x
, it makes sense to add a lemma pi.single_smul
somewhere near the definition of pi.semimodule
. BTW, function.update_eq_iff
gives a slightly shorter proof.
Otherwise LGTM.
bors d+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have pi.single_add
yet either, but I think we should - I'll leave adding all of those lemmas to a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I will have a go at golfing this proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came up with
map_smul' := λ r x, begin
ext j,
have := (function.apply_update (λ i, (•) r) 0 i x j).symm,
simp only [pi.zero_apply, smul_zero] at this,
exact this,
end,
Do you have a better proof in mind?
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
Let's golf the proofs in the follow-up, since adding |
bors r+ |
…noid_hom.single` (#6315) This changes the definition of `std_basis` to be exactly `linear_map.single`, but proves equality with the old definition. In future, it might make sense to remove `std_basis` entirely.
bors r+ Not sure what happened there, bors appears to have discarded that batch. |
The log says that bors crashed, hopefully just a transient thing: {%DBConnection.ConnectionError{
message: "connection not available because of disconnection"
},
[
{DBConnection, :checkout, 2,
[file: 'lib/db_connection.ex', line: 934]},
{DBConnection, :run, 3,
[file: 'lib/db_connection.ex', line: 750]},
{DBConnection, :prepare_execute, 4,
[file: 'lib/db_connection.ex', line: 592]},
{Ecto.Adapters.Postgres.Connection, :prepare_execute, 5,
[
file: 'lib/ecto/adapters/postgres/connection.ex',
line: 73
]},
{Ecto.Adapters.SQL, :sql_call, 6,
[file: 'lib/ecto/adapters/sql.ex', line: 256]},
{Ecto.Adapters.SQL, :execute_and_cache, 7,
[file: 'lib/ecto/adapters/sql.ex', line: 426]},
{Ecto.Repo.Queryable, :execute, 5,
[file: 'lib/ecto/repo/queryable.ex', line: 133]},
{Ecto.Repo.Queryable, :all, 4,
[file: 'lib/ecto/repo/queryable.ex', line: 37]}
]} |
…noid_hom.single` (#6315) This changes the definition of `std_basis` to be exactly `linear_map.single`, but proves equality with the old definition. In future, it might make sense to remove `std_basis` entirely.
Pull request successfully merged into master. Build succeeded: |
linear_map.single
to match add_monoid_hom.single
linear_map.single
to match add_monoid_hom.single
…noid_hom.single` (#6315) This changes the definition of `std_basis` to be exactly `linear_map.single`, but proves equality with the old definition. In future, it might make sense to remove `std_basis` entirely.
This changes the definition of
std_basis
to be exactlylinear_map.single
, but proves equality with the old definition.In future, it might make sense to remove
std_basis
entirely.