Skip to content

chore: remove all transparency set_options in SimpleGraph - #45430

Open
Parcly-Taxel wants to merge 14 commits into
leanprover-community:masterfrom
Parcly-Taxel:kill-set-option-graph
Open

Parcly-Taxel wants to merge 14 commits into
leanprover-community:masterfrom
Parcly-Taxel:kill-set-option-graph

Conversation

@Parcly-Taxel

@Parcly-Taxel Parcly-Taxel commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

GPT-6.1 Sol was used to fix most but not all of these proofs, which I have reviewed. Declaration changes:

  • Equational lemmas Walk.{take,drop}_{nil,zero,cons_succ}.
  • There was a long-standing typo in the types of variables to Walk.ofBoxProdRight_boxProdRight, which has been corrected.
  • toFinset_commonNeighbors, the finite version of commonNeighbors_eq.

@Parcly-Taxel Parcly-Taxel added t-combinatorics Combinatorics LLM-generated PRs with substantial input from LLMs - review accordingly labels Oct 28, 2026
@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

PR summary 31e1418276

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ drop_cons_succ
+ drop_nil
+ take_cons_succ
+ take_nil
+ toFinset_commonNeighbors

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)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 31e1418).

  • +6 new declarations
  • −4 removed declarations
-SimpleGraph.Walk.drop.eq_def
-SimpleGraph.Walk.drop.hcongr_6
+SimpleGraph.Walk.drop_cons_succ
+SimpleGraph.Walk.drop_nil
-SimpleGraph.Walk.take.eq_def
+SimpleGraph.Walk.take_cons_succ
+SimpleGraph.Walk.take_nil
+SimpleGraph.bipartiteDoubleCover_adj
-SimpleGraph.induceHomOfLE.congr_simp
+SimpleGraph.toFinset_commonNeighbors

Decrease in strong tech debt: (relative, absolute) = (23.04, 0.03)
Current number Change Type (strong)
1769 -2 backward.defeqAttrib.useBackward
3535 -36 backward.isDefEq.respectTransparency
1939 -39 backward.isDefEq.respectTransparency.types
No changes to weak technical debt.

Current commit 31e1418276
Reference commit da6f8cef9e

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).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's the issue here? Could you instead fix simp rather than changing the proofs?

@Parcly-Taxel Parcly-Taxel Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is impossible to fix simp to get the original proofs working.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Even adding the following lemmas doesn't allow restoring the original proofs:

@[simp high] lemma transfer_nil (hp) : nil (G := G) (u := u).transfer H hp = .nil := rfl

@[simp high] lemma transfer_cons
    (h : G.Adj u v) (p : G.Walk v w) (hp : ∀ e ∈ (cons h p).edges, e ∈ H.edgeSet) :
    (cons h p).transfer H hp =
    cons (hp s(u, v) (by simp)) (p.transfer H fun e he => hp e (by simp [he])) := rfl

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't know why, but simp should not be made an all-powerful tool. We should just accept this change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I disagree.

| cons _ w => by
rw [mapToSubgraph, Walk.map, map_map]
exact congrArg₂ _ rfl w.map_mapToSubgraph_hom
| cons h w => (map_cons ..).trans (congrArg (cons h) ((map_map ..).trans w.map_mapToSubgraph_hom))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you use rw or simp instead?

mul_zero, sum_ite_eq, mem_univ, ↓reduceIte]
rfl
mul_zero]
exact Fintype.sum_ite_eq ..

@SnirBroshi SnirBroshi Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the wrong fix; the issue is the Quot.lift above unfolding ConnectedComponent, instead of using ConnectedComponent.lift.

Since lapMatrix_mulVec_eq_zero_iff_forall_reachable expects Reachable but ConnectedComponent.lift does something different, the correct solution here is to create another version of ConnectedComponent.lift that uses a hypothesis with Reachable (just a wrapper for Quot.lift).

Then everything after ext could be just simp [lapMatrix_ker_basis_aux].

@SnirBroshi

Copy link
Copy Markdown
Collaborator

Some of these seem right and some of these seem very wrong; could you please go over them slowly and try to find the right fix?
I think splitting this into multiple PRs would help with both diagnosing the issues carefully and with reviewing the fixes.

@SnirBroshi SnirBroshi added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Oct 28, 2026
@Parcly-Taxel Parcly-Taxel removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Oct 29, 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 Oct 29, 2026
@mathlib-dependent-issues

mathlib-dependent-issues Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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) LLM-generated PRs with substantial input from LLMs - review accordingly t-combinatorics Combinatorics tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants