Repository navigation
feat(Combinatorics/Quiver): periodicity and aperiodicity - #39913
mkaratarakis wants to merge 14 commits into
Conversation
PR summary ba6e7eebc7Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (weak) |
|---|---|---|
| 5101 | 1 | exposed public sections |
Current commit ba6e7eebc7
Reference commit 74e558e2f8
This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
81aeef9 to
519d92e
Compare
|
Thanks! I think I have shared/committed several refactor suggestions and improvements to this file (which was the latest developed among the Perron-Frobenius prerequisites); in particular an improvement to the definition of an aperiodic Quiver. |
Co-authored-by: Cursor <[email protected]>
a79e484 to
6d19d30
Compare
The master merge (toolchain v4.32.0-rc1) changed simp's handling of let-bound locals: `simpa [indexOfImprimitivity, i0]` no longer unfolds the let-variable `h` in the goal, so the divisibility bridge failed with a type mismatch. The two `have`s are definitionally true (`h` is a let of `indexOfImprimitivity`, which is a plain def of `period`), so provide the terms directly and let defeq do the work.
…mmon divisor `period` was `Nat.find` over the set of common divisors of the cycle lengths at a vertex. Since `1` is always such a divisor, that returned `1` as soon as any cycle exists, so `IsAperiodic` held for every quiver with a cycle and the notion carried no content. Define it instead as the least positive element of the additive subgroup of `ℤ` generated by the cycle lengths, which is their gcd, and record the universal property: every common divisor of the cycle lengths divides the period (`dvd_period`). `period_min` and `period_le_of_commonDivisor`, which asserted minimality, are replaced by `dvd_period` and `commonDivisor_le_period`. Every other statement is unchanged, and `period_constant_of_strongly_connected` now concludes with `Nat.dvd_antisymm` instead of `le_antisymm`.
If the period at a vertex is `1`, every sufficiently large natural number is the length of a cycle there (`exists_forall_ge_mem_CycleLengths_of_period_eq_one`). The proof needs no general theory of numerical semigroups: from `1 ∈ cycleSubgroup i` one extracts two cycle lengths differing by `1` (`exists_consecutive_of_period_eq_one`), and for consecutive `q`, `q + 1` every `n ≥ q * q` is a nonnegative combination, obtained by splitting `n = (n / q - n % q) * q + n % q * (q + 1)`. Supporting lemmas: `add_mem_CycleLengths` (concatenation of cycles), `nsmul_mem_CycleLengths`, and `exists_sub_repr_of_mem_cycleSubgroup`, which writes every element of the generated subgroup as a difference of two cycle lengths.
|
WIP |
|
-WIP |
YaelDillies
left a comment
There was a problem hiding this comment.
Do you have a reference for this material? I have never of the "period of a quiver" before
|
Hey Yael! it's from Seneta, Non-negative matrices and Markov chains |
|
-awaiting-author |
|
Thanks for the review. All addressed -awaiting-author |
344ee29 to
e67f4ee
Compare
| /-! ### Cycle lengths -/ | ||
|
|
||
| /-- The lengths of the positive-length cycles at a vertex `i`. -/ | ||
| def cycleLengths (i : V) : Set ℕ := {k | 0 < k ∧ ∃ p : Path i i, p.length = k} |
There was a problem hiding this comment.
Would it not make sense to allow 0 to be a cycle length? All the statements below seemingly more with this more permissive definition
There was a problem hiding this comment.
Done, 0 is now included. Most statements got simpler. period_eq_zero and period_pos now talk about {0} and nonzero cycle lengths instead of emptiness.
| def IsCyclicPartition {h : ℕ} (f : V → Fin h) : Prop := | ||
| ∀ ⦃i j : V⦄, (i ⟶ j) → (f j : ℕ) = ((f i : ℕ) + 1) % h |
There was a problem hiding this comment.
Shouldn't you be using ZMod here instead?
| def IsCyclicPartition {h : ℕ} (f : V → Fin h) : Prop := | |
| ∀ ⦃i j : V⦄, (i ⟶ j) → (f j : ℕ) = ((f i : ℕ) + 1) % h | |
| def IsCyclicPartition {h : ℕ} (f : V → ZMod h) : Prop := | |
| ∀ ⦃i j : V⦄, (i ⟶ j) → f j = f i + 1 |
There was a problem hiding this comment.
Done, switched to ZMod.
|
-awaiting-author |
| exact ⟨by lia, p.comp q, by simp [Path.length_comp]⟩ | ||
| obtain ⟨p, rfl⟩ := ha | ||
| obtain ⟨q, rfl⟩ := hb | ||
| exact ⟨p.comp q, by simp [Path.length_comp]⟩ |
There was a problem hiding this comment.
This is already a simp lemma
| exact ⟨p.comp q, by simp [Path.length_comp]⟩ | |
| exact ⟨p.comp q, by simp⟩ |
| /-- The lengths of the positive-length cycles at a vertex `i`. -/ | ||
| def cycleLengths (i : V) : Set ℕ := {k | 0 < k ∧ ∃ p : Path i i, p.length = k} | ||
| /-- The lengths of the cycles at a vertex `i`, including the trivial cycle of length `0`. -/ | ||
| def cycleLengths (i : V) : Set ℕ := {k | ∃ p : Path i i, p.length = k} |
There was a problem hiding this comment.
Why not define this as
| def cycleLengths (i : V) : Set ℕ := {k | ∃ p : Path i i, p.length = k} | |
| def cycleLengths (i : V) : AddSubmonoid ℕ where | |
| carrier := {k | ∃ p : Path i i, p.length = k} | |
| ... |
right away? An even nicer way to define it would be as the range of length as an AddChar (Path i i) ℕ, but I don't think Path i i currently has a monoid structure. I suspect we should add it anyway, as it would make #45033 redundant (in another way than described there).
| | zero => simp | ||
| | succ k ih => simpa [Nat.succ_mul] using add_mem_cycleLengths ih ha | ||
|
|
||
| lemma mul_const_mem_cycleLengths (ha : a ∈ cycleLengths i) (m : ℕ) : a * m ∈ cycleLengths i := |
There was a problem hiding this comment.
| lemma mul_const_mem_cycleLengths (ha : a ∈ cycleLengths i) (m : ℕ) : a * m ∈ cycleLengths i := | |
| lemma mul_mem_cycleLengths_of_left (ha : a ∈ cycleLengths i) (m : ℕ) : a * m ∈ cycleLengths i := |
Similarly below
| theorem exists_forall_ge_mem_cycleLengths (h : period i = 1) : | ||
| ∃ N, ∀ n, N ≤ n → n ∈ cycleLengths i := by |
There was a problem hiding this comment.
| theorem exists_forall_ge_mem_cycleLengths (h : period i = 1) : | |
| ∃ N, ∀ n, N ≤ n → n ∈ cycleLengths i := by | |
| theorem eventually_mem_cycleLengths (h : period i = 1) : | |
| ∀\^f n in atTop, n ∈ cycleLengths i := by |
and can you upgrade this to an iff?
cycle lengths, index of imprimitivity, and cyclic partitions for strongly connected quivers.
Part of the Perron–Frobenius formalization (with @or4nge19).
cc @or4nge19 for review