Commit 2026-07-15 12:13 50b6a3e8

View on Github →

feat: use to_dual for HeytingAlgebra (#33543) This PR adds to_dual for HeytingAlgebra, BiheytingAlgebra, GeneralizedHeytingAlgebra. There is a bit of friction around dualizing compl to hnot, because this means that theorems about compl in boolean algebras will not be able to be translated nicely with to_dual. This should not be that many theorems, so this is acceptable. See also https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Dualize.20sdiff.20and.20himp/with/599261487 Since we have GeneralizedCoheytingAlgebra.toDistribLattice, I removed CoheytingAlgebra.toDistribLattice. Aligning the Heyting and Coheyting API is kind of awkward, because they are unfortunately quite different. One reason is that the arguments of sup/inf are often swapped in the dual version, which is not compatible with to_dual. I've worked around this with extensive use of to_dual none. There are quite some lemmas that in my eyes seem unnecessary, such as le_sup_sdiff_sup_sdiff, but I haven't removed any in this PR.

Estimated changes

deleted theorem Disjoint.sdiff_eq_left
deleted theorem Disjoint.sdiff_eq_right
deleted theorem IsCompl.eq_hnot
deleted theorem IsCompl.hnot_eq
deleted theorem PUnit.bot_eq
deleted theorem PUnit.compl_eq
deleted theorem PUnit.inf_eq
deleted theorem PUnit.sdiff_eq
deleted theorem Pi.himp_apply
deleted theorem Pi.himp_def
deleted theorem Pi.hnot_apply
deleted theorem Pi.hnot_def
deleted theorem bot_sdiff
deleted theorem codisjoint_hnot_left
deleted theorem codisjoint_hnot_right
modified theorem compl_ne_self
deleted theorem fst_compl
deleted theorem fst_sdiff
deleted theorem gc_sdiff_sup
modified theorem himp_eq_himp_iff
deleted theorem hnot_anti
deleted theorem hnot_bot
deleted theorem hnot_hnot_hnot
deleted theorem hnot_hnot_le
deleted theorem hnot_hnot_sdiff_distrib
deleted theorem hnot_hnot_sup_distrib
deleted theorem hnot_inf_distrib
deleted theorem hnot_le_comm
deleted theorem hnot_le_hnot
deleted theorem hnot_sdiff
deleted theorem hnot_sdiff_comm
deleted theorem hnot_sup_self
deleted theorem hnot_top
modified theorem le_compl_self
deleted theorem le_hnot_inf_hnot
deleted theorem le_sdiff_sup
deleted theorem le_sup_sdiff
modified theorem lt_compl_self
modified theorem ne_compl_self
deleted theorem ofDual_compl
deleted theorem ofDual_himp
added theorem ofDual_sdiff
deleted theorem sdiff_bot
deleted theorem sdiff_eq_bot_iff
deleted theorem sdiff_eq_sdiff_iff
deleted theorem sdiff_idem
deleted theorem sdiff_inf_distrib
deleted theorem sdiff_inf_self_left
deleted theorem sdiff_inf_self_right
deleted theorem sdiff_le
deleted theorem sdiff_le_comm
deleted theorem sdiff_le_hnot
modified theorem sdiff_le_iff'
modified theorem sdiff_le_iff
deleted theorem sdiff_le_iff_left
deleted theorem sdiff_le_inf_hnot
deleted theorem sdiff_le_sdiff
deleted theorem sdiff_le_sdiff_left
deleted theorem sdiff_le_sdiff_right
deleted theorem sdiff_ne_sdiff_iff
deleted theorem sdiff_right_comm
deleted theorem sdiff_sdiff_le
deleted theorem sdiff_self
deleted theorem sdiff_sup_self
deleted theorem sdiff_top
deleted theorem snd_compl
deleted theorem snd_sdiff
deleted theorem sup_hnot_self
deleted theorem sup_sdiff_distrib
deleted theorem sup_sdiff_self
added theorem toDual_himp
deleted theorem toDual_hnot
deleted theorem toDual_sdiff
deleted theorem top_sdiff'