Repository navigation
[Merged by Bors] - chore: use IsLUB IsGLB in CompleteLattice - #35328
astrainfinita wants to merge 15 commits into
Conversation
IsLUB IsGLB in CompleteLattice ConditionallyCompleteLattice
PR summary 95b694b853
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Order.CompleteLattice.Basic | 235 | 236 | +1 (+0.43%) |
| Mathlib.Order.CompleteLattice.Lemmas | 238 | 239 | +1 (+0.42%) |
Import changes for all files
| Files | Import difference |
|---|---|
24 filesMathlib.Algebra.Order.Quantale Mathlib.CategoryTheory.ObjectProperty.CompleteLattice Mathlib.Combinatorics.Graph.Basic Mathlib.Combinatorics.SimpleGraph.Walk Mathlib.Data.Finite.Vector Mathlib.Data.Fintype.Vector Mathlib.Data.List.Sym Mathlib.Data.Multiset.Sym Mathlib.Data.Setoid.Basic Mathlib.Data.Sym.Basic Mathlib.Data.Sym.Sym2.Order Mathlib.Data.Sym.Sym2 Mathlib.GroupTheory.Congruence.BigOperators Mathlib.GroupTheory.Congruence.Defs Mathlib.GroupTheory.Congruence.Hom Mathlib.GroupTheory.Congruence.Opposite Mathlib.Order.CompleteLattice.Basic Mathlib.Order.CompleteLattice.Group Mathlib.Order.CompleteLattice.Lemmas Mathlib.Order.GameAdd Mathlib.Order.Lattice.Congruence Mathlib.RingTheory.Congruence.BigOperators Mathlib.RingTheory.Congruence.Defs Mathlib.Topology.Defs.Filter |
1 |
Declarations diff
+ UniformSpace.isGLB_sInf
+ instPartialOrder
+ instance : IsConcreteLE (AbstractSimplicialComplex ι) (Finset ι)
+ instance : IsConcreteLE (PreAbstractSimplicialComplex ι) (Finset ι)
+ sInf_apply_eq_sInf_image
+ sSup_apply_eq_sSup_image
++ isLUB_sSup
+++ isGLB_sInf
+-- le_sSup
+-- sSup_le
- le_sInf
- sInf_le
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.
Increase in tech debt: (relative, absolute) = (0.71, 0.02)
| Current number | Change | Type |
|---|---|---|
| 466 | -2 | porting notes |
| 50 | 1 | dsimp +instances |
Current commit a6eac0ddbc
Reference commit 95b694b853
You can run this locally as
./scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
|
This pull request has conflicts, please merge |
|
This PR/issue depends on:
|
vihdzp
left a comment
There was a problem hiding this comment.
I like this very much! It makes the definition much more transparent and allows us to use existing API on IsLUB/IsGLB better.
I've left a bunch of stylistic suggestions, most of them are safely ignored.
| exact ⟨_, h, F.map f h'⟩ } | ||
| le_sSup _ _ _ _ _ := by aesop | ||
| sSup_le _ _ _ _ _ := by aesop | ||
| isLUB_sSup _ := ⟨fun _ _ _ _ ↦ by aesop, fun _ _ _ ↦ by aesop⟩ |
There was a problem hiding this comment.
Can you merge this into a single aesop call? Same below.
There was a problem hiding this comment.
aesop doesn't know to unfold the definition.
There was a problem hiding this comment.
I tried to add a few aesop lemmas to unfold the definitions, but we want to unfold Set.subset_def (which is not a safe rule in general, since we want to reason on the level of subsets, not on the level of elements). So I think doing everything in one aesop is a bit too much work right now.
| le_sInf _ G' hG' := | ||
| ⟨Set.subset_iInter₂ fun _ hH => (hG' _ hH).1, fun _ _ hab => | ||
| ⟨fun _ hH => (hG' _ hH).2 hab, G'.adj_sub hab⟩⟩ | ||
| isLUB_sSup _ := |
There was a problem hiding this comment.
a) Would it be any nicer to put this proof in a single by block?
b) Is the porting note still relevant?
There was a problem hiding this comment.
Replacing Set.subset_iUnion₂ with Set.subset_biUnion_of_mem avoids by apply.
| /-- `a ≤ sInf s` for all `a ∈ lowerBounds s`. -/ | ||
| le_csInf : ∀ s a, Set.Nonempty s → a ∈ lowerBounds s → a ≤ sInf s | ||
| /-- Every nonempty subset which is bounded above has a least upper bound. -/ | ||
| isLUB_csSup : ∀ s : Set α, s.Nonempty → BddAbove s → IsLUB s (sSup s) |
There was a problem hiding this comment.
Is it any easier to split this into a separate PR? i.e. this PR would just do this change for CompleteLattice, the successive PR would do it on ConditionallyCompleteLattice, etc.
IsLUB IsGLB in CompleteLattice ConditionallyCompleteLatticeIsLUB IsGLB in CompleteLattice
Vierkantor
left a comment
There was a problem hiding this comment.
Most of these changes are quite good, but there are some regressions where the proof becomes quite deeply nested: I would like to see changes like
- isGLB_sInf _ := ⟨sInf_le _, le_sInf _⟩
+ (isGLB_sInf _).mem := sInf_le _
+ (isGLB_sInf _).lower := le_sInf _(After changing IsGLB into a structure with the correct fields.)
But the syntax I suggest above doesn't exist (for writing fields after function arrows). So I think the current version is good enough, it definitely overall improves Mathlib!
bors d+
| exact ⟨_, h, F.map f h'⟩ } | ||
| le_sSup _ _ _ _ _ := by aesop | ||
| sSup_le _ _ _ _ _ := by aesop | ||
| isLUB_sSup _ := ⟨fun _ _ _ _ ↦ by aesop, fun _ _ _ ↦ by aesop⟩ |
There was a problem hiding this comment.
I tried to add a few aesop lemmas to unfold the definitions, but we want to unfold Set.subset_def (which is not a safe rule in general, since we want to reason on the level of subsets, not on the level of elements). So I think doing everything in one aesop is a bit too much work right now.
|
✌️ astrainfinita can now approve this pull request. To approve and merge a pull request, simply reply with |
|
bors r+ |
|
Pull request successfully merged into master. Build succeeded:
|
IsLUB IsGLB in CompleteLatticeIsLUB IsGLB in CompleteLattice
leanprover-community/mathlib4#35328 - Add noncomputable to instances due to dependence on noncomputable definitions like `instZeroEReal`
sSupandsInfusage #35297