[WIP] feat(UnionFind): add construction witness#1761
Draft
Oppen wants to merge 6 commits intoleanprover-community:mainfrom
Draft
[WIP] feat(UnionFind): add construction witness#1761Oppen wants to merge 6 commits intoleanprover-community:mainfrom
Oppen wants to merge 6 commits intoleanprover-community:mainfrom
Conversation
Remove the redundant `parentD_lt` and `rankD_lt` fields from the `UnionFind` structure, keeping only `arr` and `valid : WF arr`. Prove `WF.parentD_lt` and `WF.rankD_lt` by induction on the `WF` predicate, using `rankD_lt_of_isAncestor` as a helper for the compress case. These theorems are exposed as abbreviations on `UnionFind` for backward compatibility. Also moves `setParentBump_rankD_lt`, `setParent_rankD_lt`, and `linkAux_size` before the `UnionFind` structure definition since they operate on raw arrays and are needed by the WF proofs. The `link` function now requires both `xroot` and `yroot` proofs (previously only `yroot`) to satisfy the `WF.link` constructor.
…_lt from WF" This reverts commit 3a4db44.
…D_lt from WF" This reverts commit 4dc71cf.
…and rankD_lt from WF"" This reverts commit 7d4a613.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment, this is just for discussion in Zulip conversation
The new file
RankBound.leanis meant to be deleted afterwards. It contains theorems I think I'd need to prove the complexity bounds in CSLib, and would be moved there. Specifically, I care about rank_le_log_subtreeSize. The goal of the PR is enabling me to prove that, so I included it here to make sure it fulfills that goal.The main change is that
UnionFindnow requires thearrargument to carry a proof that it was built by applying certain constructors defined as WF.The
linkoperation now works only between roots of disjoint sets, to avoid depleting members of a set, breaking the rank bounds.