Skip to content

Conversation

@WangYiran01
Copy link

Add theorem isTree_iff_connected_and_forall_edge_isBridge in Mathlib/Combinatorics/SimpleGraph/Acyclic.lean.

This lemma characterizes G.IsTree as G.Connected together with the fact that every edge in G.edgeSet is a bridge.

This makes it easier to switch between tree proofs and bridge/acyclic proofs in SimpleGraph.

@github-actions github-actions bot added new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-combinatorics Combinatorics labels Dec 29, 2025
@github-actions
Copy link

PR summary f1a5ef6e2c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ isTree_iff_connected_and_forall_edge_isBridge

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh 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).

Copy link
Collaborator

@SnirBroshi SnirBroshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello 👋
Can you explain why you want to add this? Is there a reason you need to combine 2 rewrites into one theorem?

Comment on lines +179 to +184
calc
G.IsTree ↔ G.Connected ∧ G.IsAcyclic := SimpleGraph.isTree_iff (G := G)
_ ↔ G.Connected ∧ (∀ ⦃e : Sym2 V⦄, e ∈ G.edgeSet → G.IsBridge e) := by
simpa using
(and_congr_right (fun _ =>
(SimpleGraph.isAcyclic_iff_forall_edge_isBridge (G := G))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
calc
G.IsTree ↔ G.Connected ∧ G.IsAcyclic := SimpleGraph.isTree_iff (G := G)
_ ↔ G.Connected ∧ (∀ ⦃e : Sym2 V⦄, e ∈ G.edgeSet → G.IsBridge e) := by
simpa using
(and_congr_right (fun _ =>
(SimpleGraph.isAcyclic_iff_forall_edge_isBridge (G := G))))
rw [isTree_iff, isAcyclic_iff_forall_edge_isBridge]

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

Labels

new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants