feat(CategoryTheory/Subobject): Heyting algebra structure on Subobject in elementary topoi#39618
feat(CategoryTheory/Subobject): Heyting algebra structure on Subobject in elementary topoi#39618node0000 wants to merge 1 commit into
Conversation
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 082cf14f30Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
…t in elementary topoi Add the canonical `HeytingAlgebra (Subobject X)` instance for any category `C` satisfying the elementary-topos hypothesis bundle (`HasSubobjectClassifier`, `HasPullbacks`, `HasEqualizers`, `HasInitial`, `HasImages`, `HasBinaryCoproducts`, `InitialMonoClass`). Implication is the residual defined by an equalizer of characteristic morphisms, following Mac Lane and Moerdijk, *Sheaves in Geometry and Logic*, IV.6 Proposition 2. The load-bearing Galois connection `R ≤ residual P Q ↔ R ⊓ P ≤ Q` (`le_residual_iff_inf_le`) is assembled from six private bridging lemmas. Closes a gap in `Mathlib.CategoryTheory.Subobject.Lattice` where the `SemilatticeInf`, `SemilatticeSup`, `OrderTop`, `OrderBot`, and `Lattice` instances on `Subobject X` were in place but the Heyting implication was missing. Co-authored-by: Cursor <cursoragent@cursor.com>
Replaces the "CLOSED locally; PR not yet opened" status block with the pre-staged "CLOSED locally; PR opened upstream" version that was sitting in an HTML comment waiting for the PR URL. Anchors the live link to leanprover-community/mathlib4#39618 (opened 2026-05-20, auto-labelled `new-contributor` and `t-category-theory` by the Mathlib bots, 13 CI checks green). Co-authored-by: Cursor <cursoragent@cursor.com>
|
I'm closing this under our new-contributor-AI-policy. Here is an AI generated overall review if it helps: Recommendation I would close it under the AI policy. The author explicitly discloses that This is a substantial new theorem/instance file, not a small edit, so the Additional code-quality concerns Even ignoring policy, I would not treat this as close to merge-ready:
Salvageability The mathematical idea is plausible and the file compiles, but getting it into |
This PR provides the canonical
HeytingAlgebra (Subobject X)instancefor any category
Csatisfying the elementary-topos hypothesis bundle.Closes a gap in
Mathlib.CategoryTheory.Subobject.Lattice:the
SemilatticeInf,SemilatticeSup,OrderTop,OrderBot, andLatticeinstances onSubobject Xwere already in place, but theHeyting-algebra structure that elementary topoi induce on the subobject
lattice was missing.
The construction follows Mac Lane and Moerdijk, Sheaves in Geometry
and Logic, IV.6 Proposition 2: implication is the residual defined
by an equalizer of characteristic morphisms, and the Galois connection
R ≤ residual P Q ↔ R ⊓ P ≤ Qis the load-bearing identity that drivesthe
HeytingAlgebratypeclass.What this PR adds
A single new file
Mathlib/CategoryTheory/Subobject/Heyting.leancontaining:
CategoryTheory.Subobject.residual : Subobject X → Subobject X → Subobject X— the Heyting implication, defined as
Subobject.mk (equalizer.ι (χ (P ⊓ Q).arrow) (χ P.arrow)).CategoryTheory.Subobject.le_residual_iff_inf_le—the Galois connection
R ≤ residual P Q ↔ R ⊓ P ≤ Q.CategoryTheory.Subobject.heytingAlgebra—the
HeytingAlgebra (Subobject X)instance, withhimp := residual,compl P := residual P ⊥,le_himp_iff := le_residual_iff_inf_le, andhimp_bot := rfl.Six private lemmas (
residual_E1,residual_E2,residual_E3for theelimination half of the Galois connection;
residual_I1,residual_I2,residual_I3for the introduction half) carry the proof; they arefile-local and do not enter the public API.
Hypothesis bundle
These together are entailed by
Cbeing an elementary topos. Of these,HasSubobjectClassifierandHasEqualizersare the genuinely newrequirements for the residual construction itself; the remainder enter
via the existing
SemilatticeInf,SemilatticeSup,OrderTop, andOrderBotinstances onSubobject XthatHeytingAlgebraextends.The per-lemma breakdown is given in the file's module docstring.
Connection to existing API
Mathlib/CategoryTheory/Subobject/Lattice.lean(Bhavik Mehta, KimMorrison) already exhibits the
SemilatticeInf, SemilatticeSup, OrderTop, OrderBot, Latticeinstances onSubobject Xunder thecorresponding limit/colimit hypotheses. This PR extends that chain
to
HeytingAlgebrausing the newHasSubobjectClassifiertypeclassintroduced in
Mathlib/CategoryTheory/Subobject/Classifier/Defs.lean(Charlie Conneen, Pablo Donato, Klaus Gy, 2024) and the equalizer
infrastructure in
Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean.Combined with the presheaf-topos classifier instance in
Mathlib.CategoryTheory.Topos.Sheaf(HasSubobjectClassifier (Cᵒᵖ ⥤ Type w)for
EssentiallySmall.{w} C), this gives the Heyting structure on anypresheaf-topos subobject lattice automatically.
Use of AI
Per Mathlib's AI-use policy,
disclosing: the initial proof skeleton and the six bridging lemmas
were drafted with the assistance of Cursor
running Anthropic Claude as the
underlying model, during a multi-session co-working pass on a private
formalization project.
The author is the maintainer of the
FalseWork Papers project,
where this instance has been consumed by application-level theorems
(
four_position_partitionand three other position-theory results)since Phase 3 of that project — providing a real downstream test of
the construction.
Testing
inferInstancesmoketest under the topos hypothesis bundle exhibits this).
himp_botdischarges viarfl(the pseudo-complement is definitionallyresidual P ⊥);le_himp_iffis the Galois connection theorem assembledfrom the six bridging lemmas.
position-theory theorems whose proofs are
LE.le.disjoint_compl_right-style consequences of the Heytingstructure, kernel-checked with
#print axiomsreporting only[propext, Classical.choice, Quot.sound].parameterizing over
[HeytingAlgebra (Subobject Y)], which can produceinstance diamonds against the native
Subobjectorder structure.Acknowledgments
Thanks to Edward van de Meent and Fernando Chu for confirming
the gap and discussing the construction's shape in
a #maths Zulip thread
(2026-05).
References
Springer, 1992. Chapter IV § 6, Proposition 2 (the residual
construction) and Theorem 8 (subobject lattice is a Heyting
algebra).