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

feat: Dyck words #9781

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

feat: Dyck words #9781

wants to merge 28 commits into from

Conversation

Parcly-Taxel
Copy link
Collaborator

@Parcly-Taxel Parcly-Taxel commented Jan 16, 2024


Open in Gitpod

@Parcly-Taxel Parcly-Taxel added the t-combinatorics Combinatorics label Jan 16, 2024
Mathlib/Combinatorics/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/DyckWord.lean Outdated Show resolved Hide resolved
@Parcly-Taxel Parcly-Taxel added the awaiting-review The author would like community review of the PR label Jan 17, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Mar 26, 2024
Mathlib.lean Show resolved Hide resolved
Mathlib.lean Show resolved Hide resolved
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Mar 26, 2024
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Parcly-Taxel and others added 3 commits March 30, 2024 19:41
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Data/List/Indexes.lean Outdated Show resolved Hide resolved
Mathlib/Data/List/Indexes.lean Outdated Show resolved Hide resolved
Mathlib/Data/List/Indexes.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Enumerative/DyckWord.lean Outdated Show resolved Hide resolved
Parcly-Taxel and others added 3 commits March 31, 2024 14:30
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-math-PR This PR depends on another PR to Mathlib label Mar 31, 2024
mathlib-bors bot pushed a commit that referenced this pull request Apr 2, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed blocked-by-math-PR This PR depends on another PR to Mathlib labels Apr 2, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Apr 2, 2024
@trivial1711
Copy link
Collaborator

trivial1711 commented Apr 8, 2024

Do you have a reference that uses the term "Dyck path" to refer to any sequence of U and D? I could not find one.

What you call a "Dyck path" is really called a "word" (although it isn't really necessary to have a abbreviation for it), and what you call a "balanced Dyck path" is really called a "Dyck word". A "balanced Dyck path" is something else altogether: see page 98 of The q,t-Catalan Numbers and the Space of Diagonal Harmonics.

Louddy pushed a commit that referenced this pull request Apr 15, 2024
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
callesonne pushed a commit that referenced this pull request Apr 22, 2024
@Shreyas4991
Copy link
Collaborator

Shreyas4991 commented May 16, 2024

A couple of broader suggestions:

  1. I would suggest that DyckPath be renamed to DyckOnePath or something similar. Dyck languages can combine multiple kinds of brackets and you get Dyck 1 or Dyck 2 languages etc. In fact a Nat parameter could be attached to Step and DyckPath to signify the type of bracket. EDIT: Dyck word is more canonical terminology than Dyck path, at least in theoretical CS, so +1 to @trivial1711 's comment.
  2. Some notation for constructing Dyck paths might be helpful, even if they have to be quoted like [Dyck1| UDUD]
  3. If possible, the Dyck monoid instance could be added. This leads to nice theorems like Chomsky-Schutzenberger.

@trivial1711
Copy link
Collaborator

trivial1711 commented May 18, 2024

Please do not use the phrase "Dyck path" to refer to an unrestricted list consisting of the letters "U" and "D". The correct name for this concept is simply "list" or "word" (written as List Step in Lean); there is no need to use any abbreviation at all.

@trivial1711
Copy link
Collaborator

trivial1711 commented May 18, 2024

Here is what I believe to be the standard usage of these terms. Please tell me if you find a reference that suggests otherwise.

  • A word on the alphabet $\{U, D\}$ is any finite sequence $w = w_1 \ldots w_\ell$, where each $w_i \in \{U, D\}$. Words are used in this PR, but they are not defined in this PR. They are called "lists" in mathlib, and they are defined in docs#Init.Prelude.List.
  • We call a word on the alphabet $\{U, D\}$ a Dyck word if every prefix has at least as many $U$'s as $D$'s and the whole word has exactly as many $U$'s as $D$'s. Dyck words are defined in this PR and they are the primary object of study.
  • A Dyck path is a sequence $v_0, \ldots, v_{2n}$ of points in the plane $\mathbb{N}^2$, where $v_0 = (0, 0)$, $v_{2n} = (2n, 0)$, and $v_{i+1} - v_i \in \{(1, 1), (1, -1)\}$ for $0 \leq i &lt; 2n$. They can be thought of as paths in a particular directed graph whose vertex set is $\mathbb{N}^2$. Dyck paths are in bijection with Dyck words, but they are not the same thing as Dyck words. They are not defined at all in this PR. That is okay; the definition and the bijection can be added later.
  • A balanced Dyck path is something else altogether: see page 98 of The q,t-Catalan Numbers and the Space of Diagonal Harmonics. Right now, balanced Dyck paths are probably too obscure for mathlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review The author would like community review of the PR t-combinatorics Combinatorics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants