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] - feat(linear_algebra/affine_space/independent): affine.simplex.reindex #17566

Closed
wants to merge 1 commit into from

Conversation

jsm28
Copy link
Collaborator

@jsm28 jsm28 commented Nov 16, 2022

Add a definition for remapping a simplex along an equiv of index types, and associated basic API. (Typically of course the two index types are defeq and this is a permutation of indices within the same type, but the definition covers the general case where they might not be defeq.)


Open in Gitpod

Add a definition for remapping a simplex along an `equiv` of index
types, and associated basic API.  (Typically of course the two index
types are defeq and this is a permutation of indices within the same
type, but the definition covers the general case where they might not
be defeq.)
@jsm28 jsm28 added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) labels Nov 16, 2022
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Dec 6, 2022
Comment on lines +738 to +740
@[simps]
def reindex {m n : ℕ} (s : simplex k P m) (e : fin (m + 1) ≃ fin (n + 1)) : simplex k P n :=
⟨s.points ∘ e.symm, (affine_independent_equiv e.symm).2 s.independent⟩
Copy link
Member

Choose a reason for hiding this comment

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

This works more generally for an embedding or a embedding_class, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, we have face to extract a simplex with a given subset of points, but yes, it would be possible to define a variant using an embedding and derive various things from that. It would be good to have proper documentation on the leanprover-community website of conventions for reindexing and similar operations (and ensure existing APIs follow them). For example, when should the operation be reindex (basis) versus comp_equiv (affine_basis) versus dom_dom_congr (multilinear_map)? Which way round should an equiv of index types be specified, when an equiv is used?

Comment on lines +747 to +751
/-- Reindexing by the composition of two equivalences is the same as reindexing twice. -/
@[simp] lemma reindex_trans {n₁ n₂ n₃ : ℕ} (e₁₂ : fin (n₁ + 1) ≃ fin (n₂ + 1))
(e₂₃ : fin (n₂ + 1) ≃ fin (n₃ + 1)) (s : simplex k P n₁) :
s.reindex (e₁₂.trans e₂₃) = (s.reindex e₁₂).reindex e₂₃ :=
rfl
Copy link
Member

Choose a reason for hiding this comment

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

This might be more convenient as a simp lemma in the reverse direction; do you have a reason for preferring this direction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is another case where I don't think we have any defined convention for whether to prefer trans (and other similar composition operations) or whether to prefer a form where each operation is applied in succession, and again might benefit from documentation saying what the simp normal form should generally be for lemmas involving applying the results of trans, comp or similar.

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.

No need to cancel the merge, but some ideas for a follow-up

bors bot pushed a commit that referenced this pull request Dec 6, 2022
…x` (#17566)

Add a definition for remapping a simplex along an `equiv` of index types, and associated basic API.  (Typically of course the two index types are defeq and this is a permutation of indices within the same type, but the definition covers the general case where they might not be defeq.)
@bors
Copy link

bors bot commented Dec 6, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(linear_algebra/affine_space/independent): affine.simplex.reindex [Merged by Bors] - feat(linear_algebra/affine_space/independent): affine.simplex.reindex Dec 6, 2022
@bors bors bot closed this Dec 6, 2022
@bors bors bot deleted the jsm28/simplex_reindex branch December 6, 2022 13:01
jsm28 added a commit that referenced this pull request Dec 6, 2022
Add lemmas that reindexing a simplex along an `equiv` of index types
does not change the `circumsphere`, `circumcenter` or `circumradius`.

---

Regarding the comments in #17566 about reindexing along an embedding
rather than just an `equiv`, the lemmas here do need an `equiv` to get
all three equalities (which is thus why I was thinking of `equiv` when
writing that PR).  With an embedding you only get a weaker statement
about orthogonal projections (see the existing
`orthogonal_projection_circumcenter`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants