Zulip Chat Archive

Stream: mathlib4

Topic: Equiv.Perm


Yi.Yuan (Apr 07 2025 at 14:15):

Excuse me, I want to construct an Equiv.Perm that rotates the elements in the range(i, j) while keeping the other positions unchanged. For example : (0, ..., i - 1, i, i + 1, ...., j , j + 1, ...., n )(0, ..., i - 1, i + 1, ...., j ,i, j + 1, ...., n )

How should I design this? I found finRotate n and Fin.cycleRange in mathlib for now. The former rotates everything, while the latter rotates the range Range(i). I tried to copy the proof of Fin.cycleRange, but it involves a lot of cumbersome steps like Fin (n) ≃ Fin (i + (n - i)).

Antoine Chambert-Loir (Apr 07 2025 at 14:54):

You can construct it this way, or provide a definition of the permutation you want (using if ... then ... else) and its inverse.

Yi.Yuan (Apr 07 2025 at 15:03):

Do you mean that I can use many by_cases? It is currently the most efficient approach, but they will probably not merge this into mathlib.

Jz Pan (Apr 07 2025 at 15:45):

by_cases is in tactic mode. In term mode you should use if ... then ... else if ... then ... else ... just like ordinary programming languages.

Antoine Chambert-Loir (Apr 09 2025 at 15:41):

Another, more general, option would be, given an embedding e of a type X into a type Y, to define (maybe it exists) the corresponding group morphism Equiv.Perm X ->* Equiv.Perm Y.

Yaël Dillies (Apr 09 2025 at 15:44):

Yes, this exists, although I can't remember where it is

Aaron Liu (Apr 09 2025 at 15:47):

#mathlib4 > Equiv.Perm from a list of mappings @ 💬

Aaron Liu (Apr 09 2025 at 15:49):

Oh, I found docs#Equiv.Perm.viaEmbeddingHom

Kevin Buzzard (Apr 09 2025 at 15:50):

There's also docs#Equiv.Perm.extendDomainHom


Last updated: May 02 2025 at 03:31 UTC