Skip to content

[Merged by Bors] - refactor(Order/Concept): rename intentClosure → lowerPolar - #26976

Closed
vihdzp wants to merge 7 commits into
leanprover-community:masterfrom
vihdzp:vi.polar
Closed

vihdzp wants to merge 7 commits into
leanprover-community:masterfrom
vihdzp:vi.polar

Conversation

@vihdzp

@vihdzp vihdzp commented Jul 10, 2025 •

Copy link
Copy Markdown
Collaborator

The former name was being misused; the intent closure of a set s is actually lowerPolar r (upperPolar r s).

The name "polar" can be found in the reference. Although the two types of polars don't have separate names, we choose lower and upper in analogy to lowerBounds and upperBounds; in fact, lowerPolar (· ≤ ·) s is def-eq to lowerBounds s, and likewise for upperPolar.

While we're at it, we also get rid of the Concept.toProd projection, in favor of giving more informative names to its fields.

This PR contains no mathematics, it's just renaming.


This rename was originally @linesthatinterlace's idea, but I second it!

Open in Gitpod

@github-actions github-actions Bot added the t-order Order theory label Jul 10, 2025
@github-actions

github-actions Bot commented Jul 10, 2025 •

Copy link
Copy Markdown

PR summary f858fcc3b4

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ closure_fst
+ closure_snd
+ extent_bot
+ extent_inf
+ extent_injective
+ extent_sInf
+ extent_sSup
+ extent_ssubset_extent_iff
+ extent_subset_extent_iff
+ extent_sup
+ extent_top
+ fst
+ gc_upperPolar_lowerPolar
+ intent_bot
+ intent_inf
+ intent_injective
+ intent_sInf
+ intent_sSup
+ intent_ssubset_intent_iff
+ intent_subset_intent_iff
+ intent_sup
+ intent_top
+ lowerPolar
+ lowerPolar_anti
+ lowerPolar_empty
+ lowerPolar_iUnion
+ lowerPolar_iUnion₂
+ lowerPolar_swap
+ lowerPolar_union
+ lowerPolar_upperPolar_lowerPolar
+ snd
+ strictAnti_intent
+ strictMono_extent
+ strictMono_snd
+ subset_lowerPolar_upperPolar
+ subset_upperPolar_iff_subset_lowerPolar
+ subset_upperPolar_lowerPolar
+ upperPolar
+ upperPolar_anti
+ upperPolar_empty
+ upperPolar_iUnion
+ upperPolar_iUnion₂
+ upperPolar_lowerPolar_upperPolar
+ upperPolar_swap
+ upperPolar_union
- strictAnti_snd

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

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

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


No changes to technical debt.

You can run this locally as

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

@vihdzp
vihdzp marked this pull request as draft July 10, 2025 19:13
@vihdzp
vihdzp marked this pull request as ready for review July 10, 2025 19:18
@wrenna-robson

Copy link
Copy Markdown
Collaborator

Looks good to me and it's a leaf file so I don't see any major issues. As discussed on Zulip there will be other work in future PRs but I like this.

I'm not a reviewer or maintainer myself so I can't give a formal tick, but I like it!

@wrenna-robson

Copy link
Copy Markdown
Collaborator

Hang about. I think you might have lowerPolar and upperPolar the wrong way round.

@wrenna-robson

wrenna-robson commented Jul 10, 2025 •

Copy link
Copy Markdown
Collaborator

Looks good now.

For posterity, while it isn't going in this PR, the following are true, which motivates the names:

theorem upperBounds_eq_upperPolar [LE α] : upperBounds s = upperPolar (· ≤ ·) s := rfl
theorem lowerBounds_eq_lowerPolar [LE β] : lowerBounds t = lowerPolar (· ≤ ·) t := rfl

Comment thread Mathlib/Order/Concept.lean Outdated
intent : Set β
/-- The axiom of a `Concept` stating that the upper polar of the first set is the second set. -/
upperPolar_extent : upperPolar r extent = intent
/-- The axiom of a `Concept` stating that the lower polar of the second set is the first set. -/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update these docstrings to reflect the new names?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well give more useful docstrings while we're at it.

@wrenna-robson wrenna-robson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias intentClosure_extentClosure_intentClosure := upperPolar_lowerPolar_upperPolar

Comment thread Mathlib/Order/Concept.lean Resolved
Comment thread Mathlib/Order/Concept.lean Outdated
intent : Set β
/-- The axiom of a `Concept` stating that the upper polar of the first set is the second set. -/
upperPolar_extent : upperPolar r extent = intent
/-- The axiom of a `Concept` stating that the lower polar of the second set is the first set. -/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well give more useful docstrings while we're at it.

Comment thread Mathlib/Order/Concept.lean Resolved
@YaelDillies

Copy link
Copy Markdown
Contributor

The name "polar" can be found in the reference.

... what reference? 😅 Can you please back the renames with links to the literature?

@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 11, 2025
@wrenna-robson

Copy link
Copy Markdown
Collaborator

"Introduction to lattices and order" calls them polars - that was my source.

@wrenna-robson

Copy link
Copy Markdown
Collaborator

The other name that appears in the literature is "derivation operator" but having discussed it that seemed a bad direction.

@wrenna-robson

Copy link
Copy Markdown
Collaborator

Page 67 of the most recent edition of "Introduction to lattices and order".

"The maps ′ : A → A′ and ′ : B → B′ are traditionally called the polars of
the relation I ⊆ G × M . The set of all concepts of the context (G, M, I)
is denoted by B(G, M, I). (Again the choice of letter comes from the
German: B for Begriff.)"

@YaelDillies

Copy link
Copy Markdown
Contributor

Do you have more than one reference?

@wrenna-robson

wrenna-robson commented Jul 11, 2025 •

Copy link
Copy Markdown
Collaborator

In the FCA literature they are "derivation operators" if anything (but they are NOT closures so the previous name does seem wrong).

I am trying to track down where they get the term polar from - as they describe it as traditional I'm going to look in older literature.

@wrenna-robson

Copy link
Copy Markdown
Collaborator

Here we are:
https://archive.org/details/latticetheory0000birk/page/122/mode/2up?q=polar

Birkhoff defines them as the "polars" and that is where Davey and Priestley get it from. He says "these are called 'polarities' because they generalize the dual isomorphism between 'polars' in analytic geometry" (though he then uses polar rather than polarity to describe them). He gives an example to make it clear - it is a term derived from classical geometry, in fact.

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this looks convincing. Can you add these references to the module doc?

maintainer delegate

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 11, 2025
@wrenna-robson

Copy link
Copy Markdown
Collaborator

I can't add them myself but I'll get the references.

Davey, Brian A., and Hilary A. Priestley. Introduction to lattices and order. Cambridge university press, 2002. Chapter 3, Formal concept analysis.

Birkhoff, G. (1940). Lattice theory (Vol. 25). American Mathematical Soc.. Chapter 4, Complete Lattices.

@bryangingechen

Copy link
Copy Markdown
Contributor

Thanks!
bors d+

@mathlib-bors

mathlib-bors Bot commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

✌️ vihdzp can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Jul 11, 2025
@vihdzp

vihdzp commented Jul 11, 2025 •

Copy link
Copy Markdown
Collaborator Author

The Davey reference is already listed. As for Birkhoff, I'm not very good with BibTeX, is this the correct citation?

@Book{            birkhoff1940,
  author        = {Birkhoff, Garrett},
  title         = {Lattice Theory},
  edition       = {First},
  publisher     = {American Mathematical Society},
  year          = {1940},
  volume        = {25}
}

@bryangingechen

Copy link
Copy Markdown
Contributor

Yeah, that looks fine.

@vihdzp

vihdzp commented Jul 11, 2025

Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request Jul 11, 2025
The former name was being misused; the intent closure of a set `s` is actually `lowerPolar r (upperPolar r s)`.

The name "polar" can be found in the reference. Although the two types of polars don't have separate names, we choose lower and upper in analogy to `lowerBounds` and `upperBounds`; in fact, `lowerPolar (· ≤ ·) s` is def-eq to `lowerBounds s`, and likewise for `upperPolar`. 

While we're at it, we also get rid of the `Concept.toProd` projection, in favor of giving more informative names to its fields.

This PR contains no mathematics, it's just renaming.
@mathlib-bors

mathlib-bors Bot commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title refactor(Order/Concept): rename intentClosure → lowerPolar [Merged by Bors] - refactor(Order/Concept): rename intentClosure → lowerPolar Jul 11, 2025
@mathlib-bors mathlib-bors Bot closed this Jul 11, 2025
BeibeiX0 pushed a commit to BeibeiX0/mathlib4 that referenced this pull request Jul 16, 2025
…rover-community#26976)

The former name was being misused; the intent closure of a set `s` is actually `lowerPolar r (upperPolar r s)`.

The name "polar" can be found in the reference. Although the two types of polars don't have separate names, we choose lower and upper in analogy to `lowerBounds` and `upperBounds`; in fact, `lowerPolar (· ≤ ·) s` is def-eq to `lowerBounds s`, and likewise for `upperPolar`. 

While we're at it, we also get rid of the `Concept.toProd` projection, in favor of giving more informative names to its fields.

This PR contains no mathematics, it's just renaming.
callesonne pushed a commit to callesonne/mathlib4 that referenced this pull request Jul 24, 2025
…rover-community#26976)

The former name was being misused; the intent closure of a set `s` is actually `lowerPolar r (upperPolar r s)`.

The name "polar" can be found in the reference. Although the two types of polars don't have separate names, we choose lower and upper in analogy to `lowerBounds` and `upperBounds`; in fact, `lowerPolar (· ≤ ·) s` is def-eq to `lowerBounds s`, and likewise for `upperPolar`. 

While we're at it, we also get rid of the `Concept.toProd` projection, in favor of giving more informative names to its fields.

This PR contains no mathematics, it's just renaming.
hrmacbeth pushed a commit to szqzs/mathlib4 that referenced this pull request Jul 28, 2025
…rover-community#26976)

The former name was being misused; the intent closure of a set `s` is actually `lowerPolar r (upperPolar r s)`.

The name "polar" can be found in the reference. Although the two types of polars don't have separate names, we choose lower and upper in analogy to `lowerBounds` and `upperBounds`; in fact, `lowerPolar (· ≤ ·) s` is def-eq to `lowerBounds s`, and likewise for `upperPolar`. 

While we're at it, we also get rid of the `Concept.toProd` projection, in favor of giving more informative names to its fields.

This PR contains no mathematics, it's just renaming.
@vihdzp
vihdzp deleted the vi.polar branch March 14, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants