Skip to content

feat(Combinatorics/HypergraphLike): add vertex degree and edge order - #44015

Open
Jun2M wants to merge 23 commits into
leanprover-community:masterfrom
Jun2M:HypergraphLikeDegree
Open

Jun2M wants to merge 23 commits into
leanprover-community:masterfrom
Jun2M:HypergraphLikeDegree

Conversation

@Jun2M

@Jun2M Jun2M commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Define vertex degree and edge order for HyperGraphLike by counting incidence fibers, with values in ℕ∞ and ℕ. The natural-number versions return zero for infinite fibers.

Initial draft created with codex and revised by myself.


Open in Gitpod

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

PR summary 5e4f0bec53

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) 352
Mathlib.Combinatorics.HypergraphLike.Degree (new file) 1014

Declarations diff (regex)

+ Adj.left_mem_vertexSet
+ Adj.right_mem_vertexSet
+ HyperGraphLike
+ IsLink.adj
+ IsLink.edge_mem_edgeSet
+ IsLink.eq_or_eq_of_isLink_of_eorder_eq_two
+ IsLink.eq_or_eq_of_isLink_of_order_eq_two
+ IsLink.incVerts_eq_of_eorder_eq_two
+ IsLink.incVerts_eq_of_order_eq_two
+ IsLink.left_mem_incVerts
+ IsLink.left_mem_vertexSet
+ IsLink.left_unique_of_eorder_eq_two
+ IsLink.left_unique_of_order_eq_two
+ IsLink.mem_incEdges_left
+ IsLink.mem_incEdges_right
+ IsLink.one_lt_eorder
+ IsLink.one_lt_order
+ IsLink.pair_subset_incVerts
+ IsLink.right_mem_incVerts
+ IsLink.right_mem_vertexSet
+ IsLink.right_unique_of_eorder_eq_two
+ IsLink.right_unique_of_order_eq_two
+ IsSource.mem_incs
+ IsTarget.mem_incs
+ adj_iff_exists_incidence
+ attach
+ attach_image_incs_of_edegree_pos
+ attach_mem_incVerts
+ attach_mem_verts
+ attach_preimage_singleton_injOn
+ attach_surjOn_iff
+ biUnion_edgeFiber
+ biUnion_vertexFiber
+ degree
+ degree_attach_pos
+ degree_eq_ncard_vertexFiber
+ 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_eq_zero_of_infinite
+ degree_le_ncard_incs
+ degree_of_notMem_verts
+ degree_pos
+ degree_pos_iff_exists_mem_incVerts
+ degree_pos_iff_nonempty_incEdges
+ edegree
+ edegree_attach_pos
+ edegree_eq_encard_vertexFiber
+ edegree_eq_top_iff
+ edegree_eq_zero
+ edegree_eq_zero_iff_forall_notMem_incVerts
+ edegree_eq_zero_iff_incEdges_eq_empty
+ edegree_eq_zero_of_incs_eq_empty
+ edegree_le_encard_incs
+ edegree_lt_top_iff
+ edegree_lt_top_of_finite
+ edegree_of_notMem_verts
+ edegree_pos
+ edegree_pos_iff_exists_mem_incVerts
+ edegree_pos_iff_nonempty_incEdges
+ edgeFiber
+ edgeFiber_eq_inter_preimage
+ edgeFiber_subset_incs
+ edgeMap
+ edgeMap_image_incs_of_eorder_pos
+ edgeMap_mem_edges
+ edgeMap_mem_incEdges
+ edgeMap_preimage_singleton_injOn
+ edgeMap_range_of_eorder_pos
+ edgeMap_surjOn_iff
+ encard_incEdges_le_edegree
+ encard_incVerts_le_eorder
+ eorder
+ eorder_edgeMap_pos
+ eorder_eq_encard_edgeFiber
+ eorder_eq_top_iff
+ eorder_eq_zero
+ eorder_eq_zero_of_incs_eq_empty
+ eorder_le_encard_incs
+ eorder_lt_top_iff
+ eorder_lt_top_of_finite
+ eorder_of_notMem_edges
+ eorder_pos
+ finite_edgeFiber_of_order_pos
+ finite_vertexFiber_of_degree_pos
+ 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 [Finite I(G)] : Finite (edgeFiber G e)
+ instance [Finite I(G)] : Finite (vertexFiber G v)
+ isLink_attach
+ isLink_iff_exists_incidence
+ mem_edgeFiber
+ mem_edges_of_eorder_pos
+ 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_edegree_pos
+ mem_verts_of_mem_incEdges
+ mem_verts_of_mem_vertexFiber
+ natCast_degree
+ natCast_degree_of_finite
+ natCast_order
+ natCast_order_of_finite
+ ncard_incEdges_le_degree
+ ncard_incVerts_le_order
+ not_adj_of_notMem_verts
+ not_adj_of_notMem_verts_right
+ not_isLink_of_notMem_edges
+ order
+ order_edgeMap_pos
+ order_eq_ncard_edgeFiber
+ order_eq_zero
+ order_eq_zero_of_incs_eq_empty
+ order_eq_zero_of_infinite
+ order_le_ncard_incs
+ order_of_notMem_edges
+ order_pos
+ pairwise_disjoint_edgeFiber
+ pairwise_disjoint_vertexFiber
+ sum_degree
+ sum_degree_eq_sum_order
+ sum_edegree
+ sum_edegree_eq_sum_eorder
+ sum_eorder
+ sum_order
+ toNat_edegree
+ toNat_eorder
+ val_attach'_eq_attach
+ val_edgeMap'_eq_edgeMap
+ 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 5e4f0bec53
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 20, 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 20, 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