Skip to content

refactor: use simp_to_model for TreeMap mergeWith - #532

Open
ctkrug wants to merge 1 commit into
leanprover-community:masterfrom
ctkrug:agent/simp-to-model-mergewith
Open

refactor: use simp_to_model for TreeMap mergeWith#532
ctkrug wants to merge 1 commit into
leanprover-community:masterfrom
ctkrug:agent/simp-to-model-mergewith

Conversation

@ctkrug

@ctkrug ctkrug commented Jul 23, 2026

Copy link
Copy Markdown

Description

Replace the bespoke TreeMap.mergeWith lookup proof and its private fold helpers with a direct simp_to_model proof. This preserves both public theorem signatures while replacing 122 lines of implementation-specific machinery with a 10-line model-based proof.

This draft depends on the Std model bridge in leanprover/lean4#14526.

Validation performed on the exact committed diff:

  • native Lean v4.32 release build with the proposed Std bridge
  • focused downstream simp_to_model bridge checker
  • full Iris-Lean build (259 jobs)
  • independent theorem-signature and proof-safety checker

Fixes #127.

Checklist

  • My code follows the mathlib naming and code style conventions
  • No file-level authors list needs updating for this proof refactor

Generative AI Guidelines

AI assistance was used to investigate and draft the refactor. The final proof was manually reviewed, the duplicated constructions were removed, both public theorem signatures were preserved, and all checks listed above passed.

@markusdemedeiros

Copy link
Copy Markdown
Collaborator

Awesome! Thanks for figuring this out.

@ctkrug
ctkrug marked this pull request as ready for review July 24, 2026 16:33
@markusdemedeiros markusdemedeiros added the blocked The issue is blocked by a different issue. label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked The issue is blocked by a different issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor TreeMap to use simp_to_model

2 participants