Skip to content

[Merged by Bors] - chore(Algebra/Lie/DirectSum): shorten proof of lieAlgebraOf.map_lie'#20592

Closed
dwrensha wants to merge 2 commits intomasterfrom
tryAtEachStep-lie-direct-sum
Closed

[Merged by Bors] - chore(Algebra/Lie/DirectSum): shorten proof of lieAlgebraOf.map_lie'#20592
dwrensha wants to merge 2 commits intomasterfrom
tryAtEachStep-lie-direct-sum

Conversation

@dwrensha
Copy link
Copy Markdown
Member

@dwrensha dwrensha commented Jan 9, 2025

Uses the lie_of_same lemma added in #8388 to shorten a 13-line proof down to a single line, removing two erws and one porting note.

According to set_option trace.profiler true, the new lieAlgbraOf declaration takes 135 milliseconds to elaborate, compared to 298 milliseconds for the declaration it replaces.

Found via tryAtEachStep.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2025

PR summary c8f8304a09

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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.


Decrease in tech debt: (relative, absolute) = (2.00, 0.00)
Current number Change Type
1427 -2 erw

Current commit c8f8304a09
Reference commit 2d57ce7344

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

@github-actions github-actions bot added the t-algebra Algebra (groups, rings, fields, etc) label Jan 9, 2025
@dwrensha
Copy link
Copy Markdown
Member Author

dwrensha commented Jan 9, 2025

Note that the goal is

{ toFun := ⇑(of L j), map_add' := ⋯, map_smul' := ⋯ }.toFun ⁅x, y⁆ =
    ⁅{ toFun := ⇑(of L j), map_add' := ⋯, map_smul' := ⋯ }.toFun x,
      { toFun := ⇑(of L j), map_add' := ⋯, map_smul' := ⋯ }.toFun y⁆

while (lie_of_same L x y).symm has type

(of L j) ⁅x, y⁆ = ⁅(of L j) x, (of L j) y⁆

so the goal needs to take a few steps of definitional reduction before it matches the lemma application -- but I think it's far from anything that might be considered "defeq abuse".

@dwrensha
Copy link
Copy Markdown
Member Author

cc @kim-em, who has been interested in removing instances of erw.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 10, 2025
@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Jan 10, 2025

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 10, 2025

✌️ dwrensha 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 the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jan 10, 2025
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 10, 2025
@dwrensha
Copy link
Copy Markdown
Member Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jan 10, 2025
…20592)

Uses the [`lie_of_same`](https://github.com/leanprover-community/mathlib4/blob/d4891b46ecc82d3f6050dd51c2699fee91a2347b/Mathlib/Algebra/Lie/DirectSum.lean#L118) lemma added in #8388 to shorten a 13-line proof down to a single line, removing two `erw`s and one porting note.

According to `set_option trace.profiler true`, the new `lieAlgbraOf` declaration takes 135 milliseconds to elaborate, compared to 298 milliseconds for the declaration it replaces.

Found via [`tryAtEachStep`](https://github.com/dwrensha/tryAtEachStep).
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 10, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Algebra/Lie/DirectSum): shorten proof of lieAlgebraOf.map_lie' [Merged by Bors] - chore(Algebra/Lie/DirectSum): shorten proof of lieAlgebraOf.map_lie' Jan 10, 2025
@mathlib-bors mathlib-bors bot closed this Jan 10, 2025
@mathlib-bors mathlib-bors bot deleted the tryAtEachStep-lie-direct-sum branch January 10, 2025 04:35
grunweg pushed a commit that referenced this pull request Jan 11, 2025
…20592)

Uses the [`lie_of_same`](https://github.com/leanprover-community/mathlib4/blob/d4891b46ecc82d3f6050dd51c2699fee91a2347b/Mathlib/Algebra/Lie/DirectSum.lean#L118) lemma added in #8388 to shorten a 13-line proof down to a single line, removing two `erw`s and one porting note.

According to `set_option trace.profiler true`, the new `lieAlgbraOf` declaration takes 135 milliseconds to elaborate, compared to 298 milliseconds for the declaration it replaces.

Found via [`tryAtEachStep`](https://github.com/dwrensha/tryAtEachStep).
Julian added a commit that referenced this pull request Jan 12, 2025
* origin/master: (88 commits)
  chore(scripts): update nolints.json (#20672)
  chore: de-simp `map_eq_zero_iff_eq_one` (#20662)
  feat(Combinatorics/SimpleGraph): add independent sets (#18608)
  chore(CategoryTheory/Limits/Cones): functoriality of `mapCone` (#20641)
  feat(Algebra/Category/ModuleCat): pullback of presheaves of modules (#17366)
  feat(AlgebraicTopology): model categories (#19158)
  chore(CategoryTheory): make NormalEpi/MonoCategory and RegularEpi/MonoCategory props (#19548)
  feat(Data/List/ReduceOption): add replicate theorems (#20644)
  feat: approximate subgroups (#20050)
  feat: use scoped trace nodes in linarith (#19855)
  feat: disjoint union of charted spaces (#20619)
  feat: add some term elaborators for reduction (#15192)
  feat(Topology/Category): category of delta-generated spaces (#19499)
  add a variable_alias for Quantale and AddQuantale (#19282)
  feat(Computability/DFA): implement `isRegular_iff` (#19940)
  chore: unpin and bump batteries and importgraph (#20651)
  chore: split `Mathlib/Algebra/Group/Int` (#20624)
  feat: three lemmas related to Hausdorff distance (#20585)
  chore: `initialize_simps_projections` for `Submodule` (#20582)
  feat(Order): Boolean algebra structure on idempotents (#20618)
  chore(CategoryTheory): moving/renaming Subpresheaf (#20583)
  refactor(IntermediateField/Adjoin): Split off relation to `Algebra.adjoin` (#20630)
  feat: sets of doubling strictly less than 3/2 (#20572)
  chore(TensorProduct): universe polymorphism in EquationalCriterion (#20452)
  feat: `s \ t ∩ u = (s ∩ u) \ t` (#20298)
  feat: product of subalgebras (#20202)
  feat: `Submodule.restrictScalars` commutes with `pow` (#20581)
  feat: `a ∈ s ^ n` iff there exists a sequence `f` of `n` elements of `s` such that `∏ i, f i = a` (#20580)
  chore: make `FooHom.coe_id` a `norm_cast` lemma (#20576)
  chore: use ofNat more (#20546)
  feat(CategoryTheory/Shift/Opposite and CategoryTheory/Shift/Pullback): `CommShift` structures on adjunctions are compatible with opposites and pullbacks (#20363)
  feat(FieldTheory/Differential/Liouville): prove the algebraic case of Liouville's theorem (#16797)
  refactor: remove the `CompactSpace` field from `Unique{NonUnital}ContinuousFunctionalCalculus` (#20590)
  feat: Make `PNat.recOn` induction eliminator (#20617)
  feat(Analysis/SpecialFunctions/Pow/Real): add some lemmas (#20608)
  feat: If `s ∆ t` is finite, then `s ∆ u` is finite iff `t ∆ u` is (#20574)
  feat: `⨅ i, f i ≤ ⨆ i, f i` (#20573)
  chore(Geometry/Manifold): move SmoothManifoldWithCorners.lean to IsManifold.lean (#20611)
  feat: AbsoluteValue.IsNontrivial (#20588)
  chore(Data/Finsupp): split off extensionality from `Defs.lean` (#19092)
  chore(Data/Set): split the `CoeSort` instance to its own file (#19031)
  feat(Algebra/Order/Archimedean/Basic): powers between two elements (#20612)
  feature(Algebra/Ring/Idempotents): product of an idempotent and its complement (#20286)
  chore: cleanup more `erw` (#20601)
  chore(GroupTheory/CoprodI): shorten proof of lift_word_prod_nontrivial_of_not_empty (#20587)
  chore: cleanup imports in PrimePow/Divisors (#20626)
  chore: split Algebra/BigOperators/Group/List (#20625)
  chore: reduce Topology->Order imports by moving content (#20627)
  chore(Algebra/Lie/DirectSum): shorten proof of lieAlgebraOf.map_lie' (#20592)
  refactor: Split `FieldTheory/Adjoin.lean` into `Defs.lean` and `Basic.lean` (#20333)
  ...
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-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants