Skip to content

feat(Combinatorics/HypergraphLike): add parallel edges - #43748

Open
Jun2M wants to merge 21 commits into
leanprover-community:masterfrom
Jun2M:HypergraphLikeParallel
Open

Jun2M wants to merge 21 commits into
leanprover-community:masterfrom
Jun2M:HypergraphLikeParallel

Conversation

@Jun2M

@Jun2M Jun2M commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

Defines HyperGraphLike.Parallel for two hyperedges being parallel and NoParallelEdge class for hypergraph.

Two hyperedges are parallel if they have the same multiset of incident vertices with same orientation. For example, an directed edge [u, v] is not parallel to directed edge [v, u] or undirected edge {u, v}.

Codex assisted with initial implementation and review.

Co-authored-by: OpenAI Codex [email protected]


@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

PR summary 2530d9d398

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Combinatorics.HypergraphLike.Basic (new file) 1013
Mathlib.Combinatorics.HypergraphLike.Parallel (new file) 1014

Declarations diff (regex)

+ Adj.left_mem
+ Adj.of_compatible
+ Adj.right_mem
+ Compatible
+ Compatible.adj_congr
+ Compatible.attach_eq
+ Compatible.disjoint_incs_of_disjoint_edges
+ Compatible.disjoint_incs_of_disjoint_verts
+ Compatible.edgeFiber_subset
+ Compatible.edgeFiber_subset_of_edgeFiber_subset
+ Compatible.edgeMap_eq
+ Compatible.incEdges_eq
+ Compatible.incEdges_eq_of_vertexFiber_eq
+ Compatible.incEdges_subset
+ Compatible.incEdges_subset_of_vertexFiber_subset
+ Compatible.incVerts_eq
+ Compatible.incVerts_eq_of_edgeFiber_eq
+ Compatible.incVerts_subset
+ Compatible.incVerts_subset_of_edgeFiber_subset
+ Compatible.isLink_congr
+ Compatible.isLink_congr_of_edgeFiber_eq
+ Compatible.mem_edgeFiber_iff
+ Compatible.mem_vertexFiber_iff
+ Compatible.noParallelEdge_of_edgeFiber_eq
+ Compatible.of_disjoint_incs
+ Compatible.parallel_congr_of_edgeFiber_eq
+ Compatible.refl
+ Compatible.rfl
+ Compatible.symm
+ Compatible.vertexFiber_subset
+ Compatible.vertexFiber_subset_of_vertexFiber_subset
+ HyperGraphLike
+ IsLink.adj
+ IsLink.edge_mem
+ IsLink.eq_or_eq_of_isLink_of_order_eq_two
+ IsLink.incVerts_eq_of_order_eq_two
+ IsLink.left_mem
+ IsLink.left_mem_incVerts
+ IsLink.left_unique_of_order_eq_two
+ IsLink.mem_incEdges_left
+ IsLink.mem_incEdges_right
+ IsLink.of_compatible
+ IsLink.of_compatible_of_edgeFiber_subset
+ IsLink.one_lt_order
+ IsLink.pair_subset_incVerts
+ IsLink.right_mem
+ IsLink.right_mem_incVerts
+ IsLink.right_unique_of_order_eq_two
+ IsRegular
+ IsRegular.eq_of_nonempty
+ IsSource.mem
+ IsTarget.mem
+ IsUniform
+ IsUniform.eq_of_nonempty
+ NoParallelEdge
+ Parallel
+ Parallel.edge_eq
+ Parallel.incVerts_eq
+ Parallel.isLink_iff
+ Parallel.left_mem
+ Parallel.of_compatible
+ Parallel.order_eq
+ Parallel.refl
+ Parallel.right_mem
+ Parallel.symm
+ Parallel.trans
+ adj_iff_exists_incidence
+ attach
+ attach_image_incs_of_degree_pos
+ attach_mem
+ attach_mem_incVerts
+ attach_preimage_singleton_injOn
+ attach_surjOn_iff
+ biUnion_edgeFiber
+ biUnion_vertexFiber
+ compatible_comm
+ compatible_iff
+ degree
+ degree_attach_pos
+ degree_eq_encard_vertexFiber
+ degree_eq_top_iff
+ degree_eq_zero
+ degree_eq_zero_iff_forall_notMem_incVerts
+ degree_eq_zero_iff_incEdges_eq_empty
+ degree_eq_zero_of_incs_eq_empty
+ degree_le_encard_incs
+ degree_lt_top_iff
+ degree_lt_top_of_finite
+ degree_of_notMem_verts
+ degree_pos
+ degree_pos_iff_exists_mem_incVerts
+ degree_pos_iff_nonempty_incEdges
+ edgeFiber
+ edgeFiber_eq_inter_preimage
+ edgeFiber_subset_incs
+ edgeMap
+ edgeMap_image_incs_of_order_pos
+ edgeMap_mem
+ edgeMap_mem_incEdges
+ edgeMap_preimage_singleton_injOn
+ edgeMap_range_of_order_pos
+ edgeMap_surjOn_iff
+ encard_incEdges_le_degree
+ encard_incVerts_le_order
+ iUnion_edgeFiber
+ iUnion_vertexFiber
+ incEdges
+ incEdges_eq_empty
+ incEdges_eq_image
+ incEdges_nonempty
+ incEdges_of_notMem_verts
+ incEdges_subset_edges
+ incVerts
+ incVerts_eq_empty
+ incVerts_eq_image
+ incVerts_nonempty
+ incVerts_of_notMem_edges
+ incVerts_subset_verts
+ incs_eq_empty_of_edges_eq_empty
+ incs_eq_empty_of_verts_eq_empty
+ instance : IsTrans E (Parallel G)
+ instance : Std.Refl (Compatible : Gr → Gr → Prop)
+ instance : Std.Symm (Compatible : Gr → Gr → Prop)
+ instance : Std.Symm (Parallel G)
+ isLink_attach
+ isLink_iff_exists_incidence
+ isRegular_of_verts_eq_empty
+ isRegular_zero
+ isUniform_of_edges_eq_empty
+ isUniform_zero
+ mem_edgeFiber
+ mem_edges_of_mem_edgeFiber
+ mem_edges_of_mem_incVerts
+ mem_edges_of_order_pos
+ mem_incEdges
+ mem_incEdges_iff_exists_incidence
+ mem_incVerts_iff_exists_incidence
+ mem_vertexFiber
+ mem_verts_of_degree_pos
+ mem_verts_of_mem_incEdges
+ mem_verts_of_mem_vertexFiber
+ not_adj_of_notMem_verts
+ not_adj_of_notMem_verts_right
+ not_isLink_of_notMem_edges
+ not_parallel_of_notMem_edges
+ not_parallel_of_notMem_edges_right
+ order
+ order_edgeMap_pos
+ order_eq_encard_edgeFiber
+ order_eq_top_iff
+ order_eq_zero
+ order_eq_zero_of_incs_eq_empty
+ order_le_encard_incs
+ order_lt_top_iff
+ order_lt_top_of_finite
+ order_of_notMem_edges
+ order_pos
+ pairwise_disjoint_edgeFiber
+ pairwise_disjoint_vertexFiber
+ parallel_iff
+ parallel_iff_eq
+ parallel_iff_of_order_eq_zero
+ parallel_self_iff
+ sum_degree
+ sum_degree_eq_sum_order
+ sum_order
+ toEdge_eq_edgeMap
+ toVert_eq_attach
+ vertexFiber
+ vertexFiber_eq_inter_preimage
+ vertexFiber_subset_incs

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean -- unavailable)

⚠️ No declarations diff yet: there is no built master snapshot at this PR's merge-base (typically a bors-batch intermediate that CI never built). Merge master into this PR and push to refresh.


No changes to strong technical debt.

Increase in weak tech debt: (relative, absolute) = (2.00, 0.00)
Current number Change Type (weak)
exposed public sections 5063 2

Current commit 2530d9d398
Reference commit 38f65a093a

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 relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-combinatorics Combinatorics label Sep 12, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 12, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

This PR/issue depends on:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant