Skip to content

Commit 2b13f3b

Browse files
committed
feat: port GroupTheory.GroupAction.SubMulAction.Pointwise (#1893)
Co-authored-by: Moritz Firsching <firsching@google.com>
1 parent 62a7ce4 commit 2b13f3b

File tree

2 files changed

+140
-0
lines changed

2 files changed

+140
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ import Mathlib.GroupTheory.GroupAction.Pi
596596
import Mathlib.GroupTheory.GroupAction.Prod
597597
import Mathlib.GroupTheory.GroupAction.Sigma
598598
import Mathlib.GroupTheory.GroupAction.SubMulAction
599+
import Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise
599600
import Mathlib.GroupTheory.GroupAction.Sum
600601
import Mathlib.GroupTheory.GroupAction.Support
601602
import Mathlib.GroupTheory.GroupAction.Units
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/-
2+
Copyright (c) 2022 Eric Wieser. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Eric Wieser
5+
6+
! This file was ported from Lean 3 source module group_theory.group_action.sub_mul_action.pointwise
7+
! leanprover-community/mathlib commit f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.GroupTheory.GroupAction.SubMulAction
12+
13+
/-!
14+
# Pointwise monoid structures on SubMulAction
15+
16+
This file provides `SubMulAction.Monoid` and weaker typeclasses, which show that `SubMulAction`s
17+
inherit the same pointwise multiplications as sets.
18+
19+
To match `Submodule.Semiring`, we do not put these in the `Pointwise` locale.
20+
21+
-/
22+
23+
24+
open Pointwise
25+
26+
variable {R M : Type _}
27+
28+
namespace SubMulAction
29+
30+
section One
31+
32+
variable [Monoid R] [MulAction R M] [One M]
33+
34+
instance : One (SubMulAction R M)
35+
where one :=
36+
{ carrier := Set.range fun r : R => r • (1 : M)
37+
smul_mem' := fun r _ ⟨r', hr'⟩ => hr' ▸ ⟨r * r', mul_smul _ _ _⟩ }
38+
39+
theorem coe_one : ↑(1 : SubMulAction R M) = Set.range fun r : R => r • (1 : M) :=
40+
rfl
41+
#align sub_mul_action.coe_one SubMulAction.coe_one
42+
43+
@[simp]
44+
theorem mem_one {x : M} : x ∈ (1 : SubMulAction R M) ↔ ∃ r : R, r • (1 : M) = x :=
45+
Iff.rfl
46+
#align sub_mul_action.mem_one SubMulAction.mem_one
47+
48+
theorem subset_coe_one : (1 : Set M) ⊆ (1 : SubMulAction R M) := fun _ hx =>
49+
1, (one_smul _ _).trans hx.symm⟩
50+
#align sub_mul_action.subset_coe_one SubMulAction.subset_coe_one
51+
52+
end One
53+
54+
section Mul
55+
56+
variable [Monoid R] [MulAction R M] [Mul M] [IsScalarTower R M M]
57+
58+
instance : Mul (SubMulAction R M)
59+
where mul p q :=
60+
{ carrier := Set.image2 (· * ·) p q
61+
smul_mem' := fun r _ ⟨m₁, m₂, hm₁, hm₂, h⟩ =>
62+
h ▸ smul_mul_assoc r m₁ m₂ ▸ Set.mul_mem_mul (p.smul_mem _ hm₁) hm₂ }
63+
64+
@[norm_cast]
65+
theorem coe_mul (p q : SubMulAction R M) : ↑(p * q) = (p * q : Set M) :=
66+
rfl
67+
#align sub_mul_action.coe_mul SubMulAction.coe_mul
68+
69+
theorem mem_mul {p q : SubMulAction R M} {x : M} : x ∈ p * q ↔ ∃ y z, y ∈ p ∧ z ∈ q ∧ y * z = x :=
70+
Set.mem_mul
71+
#align sub_mul_action.mem_mul SubMulAction.mem_mul
72+
73+
end Mul
74+
75+
section MulOneClass
76+
77+
variable [Monoid R] [MulAction R M] [MulOneClass M] [IsScalarTower R M M] [SMulCommClass R M M]
78+
79+
-- porting note: giving the instance the name `mulOneClass`
80+
instance mulOneClass : MulOneClass (SubMulAction R M)
81+
where
82+
mul := (· * ·)
83+
one := 1
84+
mul_one a := by
85+
ext x
86+
simp only [mem_mul, mem_one, mul_smul_comm, exists_and_left, exists_exists_eq_and, mul_one]
87+
constructor
88+
· rintro ⟨y, hy, r, rfl⟩
89+
exact smul_mem _ _ hy
90+
· intro hx
91+
exact ⟨x, hx, 1, one_smul _ _⟩
92+
one_mul a := by
93+
ext x
94+
simp only [mem_mul, mem_one, smul_mul_assoc, exists_and_left, exists_exists_eq_and, one_mul]
95+
refine' ⟨_, fun hx => ⟨1, x, hx, one_smul _ _⟩⟩
96+
rintro ⟨r, y, hy, rfl⟩
97+
exact smul_mem _ _ hy
98+
99+
end MulOneClass
100+
101+
section Semigroup
102+
103+
variable [Monoid R] [MulAction R M] [Semigroup M] [IsScalarTower R M M]
104+
105+
-- porting note: giving the instance the name `semiGroup`
106+
instance semiGroup : Semigroup (SubMulAction R M)
107+
where
108+
mul := (· * ·)
109+
mul_assoc _ _ _ := SetLike.coe_injective (mul_assoc (_ : Set _) _ _)
110+
111+
end Semigroup
112+
113+
section Monoid
114+
115+
variable [Monoid R] [MulAction R M] [Monoid M] [IsScalarTower R M M] [SMulCommClass R M M]
116+
117+
instance : Monoid (SubMulAction R M) :=
118+
{ SubMulAction.semiGroup,
119+
SubMulAction.mulOneClass with
120+
mul := (· * ·)
121+
one := 1 }
122+
123+
theorem coe_pow (p : SubMulAction R M) : ∀ {n : ℕ} (_ : n ≠ 0), (p ^ n : Set M) = ((p : Set M) ^ n)
124+
| 0, hn => (hn rfl).elim
125+
| 1, _ => by rw [pow_one, pow_one]
126+
| n + 2, _ => by
127+
rw [pow_succ _ (n + 1), pow_succ _ (n + 1), coe_mul, coe_pow _ n.succ_ne_zero]
128+
#align sub_mul_action.coe_pow SubMulAction.coe_pow
129+
130+
theorem subset_coe_pow (p : SubMulAction R M) : ∀ {n : ℕ}, ((p : Set M) ^ n) ⊆ (p ^ n : Set M)
131+
| 0 => by
132+
rw [pow_zero, pow_zero]
133+
exact subset_coe_one
134+
| n + 1 => by rw [← Nat.succ_eq_add_one, coe_pow _ n.succ_ne_zero]
135+
#align sub_mul_action.subset_coe_pow SubMulAction.subset_coe_pow
136+
137+
end Monoid
138+
139+
end SubMulAction

0 commit comments

Comments
 (0)