If I have a locale with several fixes and assumes, but for many operations some of the fixes will always be the same, what is the best way of providing a partially instantiated locale?
Written differenctly: let's say the locale L has fixes A, B and C and assumes P1, P2, P3. P3 only depends on C. What is the best way to provide the locale L A B K (where C is fixed to some constant K) that only assumes P1 and P2 (because I can prove P3 for K)?
Currently I can only think of a lemma P1 ⟹ P2 ⟹ L A B K, is there a better way that does not require restating P1 and P2?
Ok, that is very inconvenient for the user as they won't be able to use interpretation easily (at least as far as I can tell). So I think the solution is to define a new locale L' A B that assumes P1 and P2, then interpret L A B K inside L' and provide an abbreviation for the derived constants that I care about and use lemmas statements as abbreviations for the derived theorems from the inner locale. Is there a better way?
Jan van Brügge said:
Ok, that is very inconvenient for the user as they won't be able to use
interpretationeasily (at least as far as I can tell). So I think the solution is to define a new localeL' A Bthat assumesP1andP2, then interpretL A B KinsideL'and provide an abbreviation for the derived constants that I care about and uselemmasstatements as abbreviations for the derived theorems from the inner locale. Is there a better way?
I do pretty much the same what you describe, just that I use sublocale for the inner locale. Then you don't have to provide the abbreviations and the lemmas statement
You could also rearrange the locales: have a locale C c assuming P3 and have your L = C c + fixes a b assumes P1 P2
Then you can interpret your C with your constant, which should avoid you needing to reinterpret it when interpreting L.
Last updated: Nov 13 2025 at 04:27 UTC