Skip to content

fix(Tactic/FunProp): detect Continuous.subtype_mk as compositional#35683

Open
gasparattila wants to merge 2 commits intoleanprover-community:masterfrom
gasparattila:fun_prop-subtype-fix
Open

fix(Tactic/FunProp): detect Continuous.subtype_mk as compositional#35683
gasparattila wants to merge 2 commits intoleanprover-community:masterfrom
gasparattila:fun_prop-subtype-fix

Conversation

@gasparattila
Copy link
Copy Markdown
Contributor

@gasparattila gasparattila commented Feb 23, 2026

This PR changes fun_prop to detect some theorems involving dependent types, such as Continous.subtype_mk to be in compositional form. This lets fun_prop solve goals such as Continuous fun x => (⟨x, trivial⟩ : {x : ℝ // True}).


These theorems become compositional: Continuous.subtype_mk, Topology.IsEmbedding.inclusion, Topology.IsOpenEmbedding.inclusion, Topology.IsClosedEmbedding.inclusion, Measurable.subtype_mk, Measurable.imp, Path.symm_continuous_family, Continuous.upperHalfPlaneMk
These theorems become simple: hasFDerivAt_prodMk_left, hasFDerivAt_prodMk_right, contDiff_prodMk_left, contDiff_prodMk_right

Open in Gitpod

@github-actions github-actions bot added the t-meta Tactics, attributes or user commands label Feb 23, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 23, 2026

PR summary fdc3438ce4

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Con_imp
+ Con_subtype_mk
+ DecompositionResult
+ DecompositionResult.toTheoremForm
+ FunctionData.decomposition
- FunctionData.nontrivialDecomposition

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@mathlib-merge-conflicts
Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@mathlib-merge-conflicts mathlib-merge-conflicts bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 27, 2026
@gasparattila gasparattila force-pushed the fun_prop-subtype-fix branch from 90998c5 to fa4b89e Compare March 27, 2026 21:38
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 27, 2026
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Apr 1, 2026

@lecopivo What do you think about this PR?

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Apr 1, 2026

Can you check some of the call sites in mathlib --- can you now use fun_prop?

@lecopivo
Copy link
Copy Markdown
Collaborator

lecopivo commented Apr 1, 2026

Nice! This looks like a simple and clean way to deal with dependently typed functions.

@gasparattila
Copy link
Copy Markdown
Contributor Author

I've checked the uses of Continuous.subtype_mk, but it turned out that none of them were affected by this bug (other than the one in #35697). The reason is that if both the theorem and the goal have dependent types, then the decomposition fails in both cases, so fun_prop applies the theorem directly, which has the same effect as if it was compositional. So this bug appears only when the goal is less dependent than the theorem, such as in the test cases in this PR.

@gasparattila gasparattila force-pushed the fun_prop-subtype-fix branch from fa4b89e to c2679ad Compare April 1, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants