Skip to content

generalize to Monoid+MulAction#1

Merged
xroblot merged 1 commit into
xroblot:isscalartower_transfrom
alreadydone:jyxu/isscalartower_trans
Aug 19, 2025
Merged

generalize to Monoid+MulAction#1
xroblot merged 1 commit into
xroblot:isscalartower_transfrom
alreadydone:jyxu/isscalartower_trans

Conversation

@alreadydone

Copy link
Copy Markdown

Open in Gitpod

@Vierkantor Vierkantor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@alreadydone, @xroblot, do you agree with my suggestions?

@xroblot When you merge these, I'll get your original PR merged!

@@ -516,6 +515,16 @@ lemma SMulCommClass.of_mul_smul_one {M N} [Monoid N] [SMul M N]
(H : ∀ (x : M) (y : N), y * x • (1 : N) = x • y) : SMulCommClass M N N :=
⟨fun x y z ↦ by rw [← H x z, smul_eq_mul, ← H, smul_eq_mul, mul_assoc]⟩

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
/--
Let `Q / P / N / M` be a scalar tower. If `P / N / M`, `Q / P / M` and `Q / P / N` are
scalar towers, then `Q / N / M` is also a scalar tower.
-/

[SMul M N] [SMul M P] [SMul M Q] [SMul N P] [SMul N Q] [Monoid P] [MulAction P Q]
[IsScalarTower M N P] [IsScalarTower M P Q] [IsScalarTower N P Q] : IsScalarTower M N Q where
smul_assoc m n q := by rw [← smul_one_smul P, smul_assoc m, smul_assoc, smul_one_smul]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
/--
Let `Q / P / N / M` be a scalar tower. If `P / N / M`, `Q / N / M` and `Q / P / N` are
scalar towers, then `Q / P / M` is also a scalar tower.
-/

(H : ∀ (x : M) (y : N), y * x • (1 : N) = x • y) : SMulCommClass M N N :=
⟨fun x y z ↦ by rw [← H x z, smul_eq_mul, ← H, smul_eq_mul, mul_assoc]⟩

@[to_additive] lemma IsScalarTower.trans_left (M N P Q)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure about left/right, since the metaphor of towers is more vertical. Maybe we can call Q / P / N / M in that order highest / higher / lower / lowest?

Suggested change
@[to_additive] lemma IsScalarTower.trans_left (M N P Q)
@[to_additive] lemma IsScalarTower.to_lower (M N P Q)

[IsScalarTower M N P] [IsScalarTower M P Q] [IsScalarTower N P Q] : IsScalarTower M N Q where
smul_assoc m n q := by rw [← smul_one_smul P, smul_assoc m, smul_assoc, smul_one_smul]

@[to_additive] lemma IsScalarTower.trans_right (M N P Q)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
@[to_additive] lemma IsScalarTower.trans_right (M N P Q)
@[to_additive] lemma IsScalarTower.to_higher (M N P Q)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

How about to₁₂₄ to₁₃₄

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Works for me too!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have a 123 version too:

theorem IsScalarTower.to₁₂₃ (M N P Q)
    [SMul M N] [SMul M P] [SMul M Q] [SMul N P] [SMul N Q] [SMul P Q] [FaithfulSMul P Q]
    [IsScalarTower M N Q] [IsScalarTower M P Q] [IsScalarTower N P Q] : IsScalarTower M N P where
  smul_assoc m n p := by simp_rw [← (smul_left_injective' (α := Q)).eq_iff, smul_assoc]

This basically require 34 to be an injective map.
The 234 version would need cancelling 12 from the right side of an equality between compositions, so it basically requires 12 to be a surjective map, but I don't know of a readily available typeclass to impose that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

theorem IsScalarTower.to₂₃₄ (M N P Q)
    [SMul M N] [SMul M P] [SMul M Q] [SMul P Q] [Monoid N] [MulAction N P] [MulAction N Q]
    [IsScalarTower M N P] [IsScalarTower M N Q] [IsScalarTower M P Q]
    (h : Function.Surjective fun m : M ↦ m • (1 : N)) : IsScalarTower N P Q where
  smul_assoc n p q := by obtain ⟨m, rfl⟩ := h n; simp_rw [smul_one_smul, smul_assoc]

has the same assumptions as 134 except for the surjectivity.

@xroblot

xroblot commented Aug 19, 2025

Copy link
Copy Markdown
Owner

I am a bit confused here. Should I just merge the current version and then apply the suggestions of @Vierkantor and should I wait for @alreadydone to apply the suggestions and then merge the resulting version?

@Vierkantor

Copy link
Copy Markdown

Sorry for the confusion! I would like to see the suggestions by @alreadydone and my suggestions merged into leanprover-community#27866, and then I'll approve that PR.

@xroblot

xroblot commented Aug 19, 2025

Copy link
Copy Markdown
Owner

Ok, so I'll merge this PR into leanprover-community#27866 and then apply your changes there since I don't think I can modify this PR directly.

@Vierkantor

Copy link
Copy Markdown

Sounds good to me!

@xroblot xroblot merged commit 26752e8 into xroblot:isscalartower_trans Aug 19, 2025
7 of 8 checks passed
@alreadydone

alreadydone commented Aug 19, 2025

Copy link
Copy Markdown
Author

Indeed it's my responsibility to act on reviews on my PR, but I got confused. Thanks for merging and addressing the reviews!

@alreadydone alreadydone deleted the jyxu/isscalartower_trans branch August 20, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants