deprecated.submonoid
⟷
Mathlib.Deprecated.Submonoid
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -235,7 +235,7 @@ theorem Range.isSubmonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoi
"An `add_submonoid` is closed under multiplication by naturals."]
theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n : ℕ}, a ^ n ∈ s
| 0 => by rw [pow_zero]; exact hs.one_mem
- | n + 1 => by rw [pow_succ]; exact hs.mul_mem h IsSubmonoid.pow_mem
+ | n + 1 => by rw [pow_succ']; exact hs.mul_mem h IsSubmonoid.pow_mem
#align is_submonoid.pow_mem IsSubmonoid.pow_mem
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -276,7 +276,7 @@ theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m
(∀ a ∈ m, a ∈ s) → m.Prod ∈ s :=
by
refine' Quotient.inductionOn m fun l hl => _
- rw [Multiset.quot_mk_to_coe, Multiset.coe_prod]
+ rw [Multiset.quot_mk_to_coe, Multiset.prod_coe]
exact list_prod_mem hs hl
#align is_submonoid.multiset_prod_mem IsSubmonoid.multiset_prod_mem
#align is_add_submonoid.multiset_sum_mem IsAddSubmonoid.multiset_sum_mem
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -239,13 +239,13 @@ theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n
#align is_submonoid.pow_mem IsSubmonoid.pow_mem
-/
-#print IsSubmonoid.power_subset /-
+#print IsSubmonoid.powers_subset /-
/-- The set of natural number powers of an element of a submonoid is a subset of the submonoid. -/
@[to_additive IsAddSubmonoid.multiples_subset
"The set of natural number multiples of an element\nof an `add_submonoid` is a subset of the `add_submonoid`."]
-theorem IsSubmonoid.power_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : powers a ⊆ s :=
+theorem IsSubmonoid.powers_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : powers a ⊆ s :=
fun x ⟨n, hx⟩ => hx ▸ hs.pow_mem h
-#align is_submonoid.power_subset IsSubmonoid.power_subset
+#align is_submonoid.power_subset IsSubmonoid.powers_subset
#align is_add_submonoid.multiples_subset IsAddSubmonoid.multiples_subset
-/
@@ -379,7 +379,8 @@ theorem closure_mono {s t : Set M} (h : s ⊆ t) : Closure s ⊆ Closure t :=
theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x :=
Set.eq_of_subset_of_subset
(closure_subset (powers.isSubmonoid x) <| Set.singleton_subset_iff.2 <| powers.self_mem) <|
- IsSubmonoid.power_subset (closure.isSubmonoid _) <| Set.singleton_subset_iff.1 <| subset_closure
+ IsSubmonoid.powers_subset (closure.isSubmonoid _) <|
+ Set.singleton_subset_iff.1 <| subset_closure
#align monoid.closure_singleton Monoid.closure_singleton
#align add_monoid.closure_singleton AddMonoid.closure_singleton
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard
-/
-import Mathbin.GroupTheory.Submonoid.Basic
-import Mathbin.Algebra.BigOperators.Basic
-import Mathbin.Deprecated.Group
+import GroupTheory.Submonoid.Basic
+import Algebra.BigOperators.Basic
+import Deprecated.Group
#align_import deprecated.submonoid from "leanprover-community/mathlib"@"a11f9106a169dd302a285019e5165f8ab32ff433"
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -57,7 +57,7 @@ preferred. -/
@[to_additive]
structure IsSubmonoid (s : Set M) : Prop where
one_mem : (1 : M) ∈ s
- mul_mem {a b} : a ∈ s → b ∈ s → a * b ∈ s
+ hMul_mem {a b} : a ∈ s → b ∈ s → a * b ∈ s
#align is_submonoid IsSubmonoid
#align is_add_submonoid IsAddSubmonoid
-/
@@ -96,7 +96,7 @@ theorem Multiplicative.isSubmonoid_iff {s : Set A} :
theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂ : IsSubmonoid s₂) :
IsSubmonoid (s₁ ∩ s₂) :=
{ one_mem := ⟨is₁.one_mem, is₂.one_mem⟩
- mul_mem := fun x y hx hy => ⟨is₁.mul_mem hx.1 hy.1, is₂.mul_mem hx.2 hy.2⟩ }
+ hMul_mem := fun x y hx hy => ⟨is₁.hMul_mem hx.1 hy.1, is₂.hMul_mem hx.2 hy.2⟩ }
#align is_submonoid.inter IsSubmonoid.inter
#align is_add_submonoid.inter IsAddSubmonoid.inter
-/
@@ -108,8 +108,8 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
theorem IsSubmonoid.iInter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
IsSubmonoid (Set.iInter s) :=
{ one_mem := Set.mem_iInter.2 fun y => (h y).one_mem
- mul_mem := fun x₁ x₂ h₁ h₂ =>
- Set.mem_iInter.2 fun y => (h y).mul_mem (Set.mem_iInter.1 h₁ y) (Set.mem_iInter.1 h₂ y) }
+ hMul_mem := fun x₁ x₂ h₁ h₂ =>
+ Set.mem_iInter.2 fun y => (h y).hMul_mem (Set.mem_iInter.1 h₁ y) (Set.mem_iInter.1 h₂ y) }
#align is_submonoid.Inter IsSubmonoid.iInter
#align is_add_submonoid.Inter IsAddSubmonoid.iInter
-/
@@ -125,11 +125,11 @@ theorem isSubmonoid_iUnion_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι
{ one_mem :=
let ⟨i⟩ := hι
Set.mem_iUnion.2 ⟨i, (hs i).one_mem⟩
- mul_mem := fun a b ha hb =>
+ hMul_mem := fun a b ha hb =>
let ⟨i, hi⟩ := Set.mem_iUnion.1 ha
let ⟨j, hj⟩ := Set.mem_iUnion.1 hb
let ⟨k, hk⟩ := Directed i j
- Set.mem_iUnion.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
+ Set.mem_iUnion.2 ⟨k, (hs k).hMul_mem (hk.1 hi) (hk.2 hj)⟩ }
#align is_submonoid_Union_of_directed isSubmonoid_iUnion_of_directed
#align is_add_submonoid_Union_of_directed isAddSubmonoid_iUnion_of_directed
-/
@@ -181,7 +181,7 @@ theorem powers.mul_mem {x y z : M} : y ∈ powers x → z ∈ powers x → y * z
"The set of natural number multiples of an element of\nan `add_monoid` `M` is an `add_submonoid` of `M`."]
theorem powers.isSubmonoid (x : M) : IsSubmonoid (powers x) :=
{ one_mem := powers.one_mem
- mul_mem := fun y z => powers.mul_mem }
+ hMul_mem := fun y z => powers.mul_mem }
#align powers.is_submonoid powers.isSubmonoid
#align multiples.is_add_submonoid multiples.isAddSubmonoid
-/
@@ -201,7 +201,7 @@ theorem Univ.isSubmonoid : IsSubmonoid (@Set.univ M) := by constructor <;> simp
theorem IsSubmonoid.preimage {N : Type _} [Monoid N] {f : M → N} (hf : IsMonoidHom f) {s : Set N}
(hs : IsSubmonoid s) : IsSubmonoid (f ⁻¹' s) :=
{ one_mem := show f 1 ∈ s by rw [IsMonoidHom.map_one hf] <;> exact hs.one_mem
- mul_mem := fun a b (ha : f a ∈ s) (hb : f b ∈ s) =>
+ hMul_mem := fun a b (ha : f a ∈ s) (hb : f b ∈ s) =>
show f (a * b) ∈ s by rw [IsMonoidHom.map_mul' hf] <;> exact hs.mul_mem ha hb }
#align is_submonoid.preimage IsSubmonoid.preimage
#align is_add_submonoid.preimage IsAddSubmonoid.preimage
@@ -214,8 +214,8 @@ theorem IsSubmonoid.preimage {N : Type _} [Monoid N] {f : M → N} (hf : IsMonoi
theorem IsSubmonoid.image {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) {s : Set M}
(hs : IsSubmonoid s) : IsSubmonoid (f '' s) :=
{ one_mem := ⟨1, hs.one_mem, hf.map_one⟩
- mul_mem := fun a b ⟨x, hx⟩ ⟨y, hy⟩ =>
- ⟨x * y, hs.mul_mem hx.1 hy.1, by rw [hf.map_mul, hx.2, hy.2]⟩ }
+ hMul_mem := fun a b ⟨x, hx⟩ ⟨y, hy⟩ =>
+ ⟨x * y, hs.hMul_mem hx.1 hy.1, by rw [hf.map_mul, hx.2, hy.2]⟩ }
#align is_submonoid.image IsSubmonoid.image
#align is_add_submonoid.image IsAddSubmonoid.image
-/
@@ -262,7 +262,7 @@ theorem list_prod_mem (hs : IsSubmonoid s) : ∀ {l : List M}, (∀ x ∈ l, x
| a :: l, h =>
suffices a * l.Prod ∈ s by simpa
have : a ∈ s ∧ ∀ x ∈ l, x ∈ s := by simpa using h
- hs.mul_mem this.1 (list_prod_mem this.2)
+ hs.hMul_mem this.1 (list_prod_mem this.2)
#align is_submonoid.list_prod_mem IsSubmonoid.list_prod_mem
#align is_add_submonoid.list_sum_mem IsAddSubmonoid.list_sum_mem
-/
@@ -337,7 +337,7 @@ def Closure (s : Set M) : Set M :=
@[to_additive]
theorem closure.isSubmonoid (s : Set M) : IsSubmonoid (Closure s) :=
{ one_mem := InClosure.one
- mul_mem := fun a b => InClosure.mul }
+ hMul_mem := fun a b => InClosure.mul }
#align monoid.closure.is_submonoid Monoid.closure.isSubmonoid
#align add_monoid.closure.is_add_submonoid AddMonoid.closure.isAddSubmonoid
-/
@@ -355,7 +355,7 @@ theorem subset_closure {s : Set M} : s ⊆ Closure s := fun a => InClosure.basic
@[to_additive
"The `add_submonoid` generated by a set is contained in any `add_submonoid` that\ncontains the set."]
theorem closure_subset {s t : Set M} (ht : IsSubmonoid t) (h : s ⊆ t) : Closure s ⊆ t := fun a ha =>
- by induction ha <;> simp [h _, *, IsSubmonoid.one_mem, IsSubmonoid.mul_mem]
+ by induction ha <;> simp [h _, *, IsSubmonoid.one_mem, IsSubmonoid.hMul_mem]
#align monoid.closure_subset Monoid.closure_subset
#align add_monoid.closure_subset AddMonoid.closure_subset
-/
@@ -397,7 +397,7 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
apply in_closure.rec_on hx <;> intros
· solve_by_elim [subset_closure, Set.mem_image_of_mem]
· rw [hf.map_one]; apply IsSubmonoid.one_mem (closure.is_submonoid (f '' s))
- · rw [hf.map_mul]; solve_by_elim [(closure.is_submonoid _).mul_mem])
+ · rw [hf.map_mul]; solve_by_elim [(closure.is_submonoid _).hMul_mem])
(closure_subset (IsSubmonoid.image hf (closure.isSubmonoid _)) <|
Set.image_subset _ subset_closure)
#align monoid.image_closure Monoid.image_closure
@@ -438,20 +438,20 @@ theorem mem_closure_union_iff {M : Type _} [CommMonoid M] {s t : Set M} {x : M}
HL2 ▸
List.recOn L
(fun _ =>
- ⟨1, (closure.isSubmonoid _).one_mem, 1, (closure.isSubmonoid _).one_mem, mul_one _⟩)
+ ⟨1, (closure.isSubmonoid _).one_mem, 1, (closure.isSubmonoid _).one_mem, hMul_one _⟩)
(fun hd tl ih HL1 =>
let ⟨y, hy, z, hz, hyzx⟩ := ih (List.forall_mem_of_forall_mem_cons HL1)
Or.cases_on (HL1 hd <| List.mem_cons_self _ _)
(fun hs =>
- ⟨hd * y, (closure.isSubmonoid _).mul_mem (subset_closure hs) hy, z, hz, by
+ ⟨hd * y, (closure.isSubmonoid _).hMul_mem (subset_closure hs) hy, z, hz, by
rw [mul_assoc, List.prod_cons, ← hyzx] <;> rfl⟩)
fun ht =>
- ⟨y, hy, z * hd, (closure.isSubmonoid _).mul_mem hz (subset_closure ht), by
+ ⟨y, hy, z * hd, (closure.isSubmonoid _).hMul_mem hz (subset_closure ht), by
rw [← mul_assoc, List.prod_cons, ← hyzx, mul_comm hd] <;> rfl⟩)
HL1,
fun ⟨y, hy, z, hz, hyzx⟩ =>
hyzx ▸
- (closure.isSubmonoid _).mul_mem (closure_mono (Set.subset_union_left _ _) hy)
+ (closure.isSubmonoid _).hMul_mem (closure_mono (Set.subset_union_left _ _) hy)
(closure_mono (Set.subset_union_right _ _) hz)⟩
#align monoid.mem_closure_union_iff Monoid.mem_closure_union_iff
#align add_monoid.mem_closure_union_iff AddMonoid.mem_closure_union_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard
-
-! This file was ported from Lean 3 source module deprecated.submonoid
-! leanprover-community/mathlib commit a11f9106a169dd302a285019e5165f8ab32ff433
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.GroupTheory.Submonoid.Basic
import Mathbin.Algebra.BigOperators.Basic
import Mathbin.Deprecated.Group
+#align_import deprecated.submonoid from "leanprover-community/mathlib"@"a11f9106a169dd302a285019e5165f8ab32ff433"
+
/-!
# Unbundled submonoids (deprecated)
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -92,6 +92,7 @@ theorem Multiplicative.isSubmonoid_iff {s : Set A} :
#align multiplicative.is_submonoid_iff Multiplicative.isSubmonoid_iff
-/
+#print IsSubmonoid.inter /-
/-- The intersection of two submonoids of a monoid `M` is a submonoid of `M`. -/
@[to_additive
"The intersection of two `add_submonoid`s of an `add_monoid` `M` is\nan `add_submonoid` of M."]
@@ -101,6 +102,7 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
mul_mem := fun x y hx hy => ⟨is₁.mul_mem hx.1 hy.1, is₂.mul_mem hx.2 hy.2⟩ }
#align is_submonoid.inter IsSubmonoid.inter
#align is_add_submonoid.inter IsAddSubmonoid.inter
+-/
#print IsSubmonoid.iInter /-
/-- The intersection of an indexed set of submonoids of a monoid `M` is a submonoid of `M`. -/
@@ -147,12 +149,14 @@ def powers (x : M) : Set M :=
#align multiples multiples
-/
+#print powers.one_mem /-
/-- 1 is in the set of natural number powers of an element of a monoid. -/
@[to_additive "0 is in the set of natural number multiples of an element of an `add_monoid`."]
theorem powers.one_mem {x : M} : (1 : M) ∈ powers x :=
⟨0, pow_zero _⟩
#align powers.one_mem powers.one_mem
#align multiples.zero_mem multiples.zero_mem
+-/
#print powers.self_mem /-
/-- An element of a monoid is in the set of that element's natural number powers. -/
@@ -164,6 +168,7 @@ theorem powers.self_mem {x : M} : x ∈ powers x :=
#align multiples.self_mem multiples.self_mem
-/
+#print powers.mul_mem /-
/-- The set of natural number powers of an element of a monoid is closed under multiplication. -/
@[to_additive
"The set of natural number multiples of an element of an `add_monoid` is closed under addition."]
@@ -171,6 +176,7 @@ theorem powers.mul_mem {x y z : M} : y ∈ powers x → z ∈ powers x → y * z
fun ⟨n₁, h₁⟩ ⟨n₂, h₂⟩ => ⟨n₁ + n₂, by simp only [pow_add, *]⟩
#align powers.mul_mem powers.mul_mem
#align multiples.add_mem multiples.add_mem
+-/
#print powers.isSubmonoid /-
/-- The set of natural number powers of an element of a monoid `M` is a submonoid of `M`. -/
@@ -250,6 +256,7 @@ end powers
namespace IsSubmonoid
+#print IsSubmonoid.list_prod_mem /-
/-- The product of a list of elements of a submonoid is an element of the submonoid. -/
@[to_additive
"The sum of a list of elements of an `add_submonoid` is an element of the\n`add_submonoid`."]
@@ -261,6 +268,7 @@ theorem list_prod_mem (hs : IsSubmonoid s) : ∀ {l : List M}, (∀ x ∈ l, x
hs.mul_mem this.1 (list_prod_mem this.2)
#align is_submonoid.list_prod_mem IsSubmonoid.list_prod_mem
#align is_add_submonoid.list_sum_mem IsAddSubmonoid.list_sum_mem
+-/
#print IsSubmonoid.multiset_prod_mem /-
/-- The product of a multiset of elements of a submonoid of a `comm_monoid` is an element of
@@ -277,6 +285,7 @@ theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m
#align is_add_submonoid.multiset_sum_mem IsAddSubmonoid.multiset_sum_mem
-/
+#print IsSubmonoid.finset_prod_mem /-
/-- The product of elements of a submonoid of a `comm_monoid` indexed by a `finset` is an element
of the submonoid. -/
@[to_additive
@@ -286,6 +295,7 @@ theorem finset_prod_mem {M A} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (f
| ⟨m, hm⟩, _ => multiset_prod_mem hs _ (by simpa)
#align is_submonoid.finset_prod_mem IsSubmonoid.finset_prod_mem
#align is_add_submonoid.finset_sum_mem IsAddSubmonoid.finset_sum_mem
+-/
end IsSubmonoid
@@ -397,6 +407,7 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
#align add_monoid.image_closure AddMonoid.image_closure
-/
+#print Monoid.exists_list_of_mem_closure /-
/-- Given an element `a` of the submonoid of a monoid `M` generated by a set `s`, there exists
a list of elements of `s` whose product is `a`. -/
@[to_additive
@@ -415,7 +426,9 @@ theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
exact fun a => ⟨ha a, hb a⟩
#align monoid.exists_list_of_mem_closure Monoid.exists_list_of_mem_closure
#align add_monoid.exists_list_of_mem_closure AddMonoid.exists_list_of_mem_closure
+-/
+#print Monoid.mem_closure_union_iff /-
/-- Given sets `s, t` of a commutative monoid `M`, `x ∈ M` is in the submonoid of `M` generated by
`s ∪ t` iff there exists an element of the submonoid generated by `s` and an element of the
submonoid generated by `t` whose product is `x`. -/
@@ -445,6 +458,7 @@ theorem mem_closure_union_iff {M : Type _} [CommMonoid M] {s t : Set M} {x : M}
(closure_mono (Set.subset_union_right _ _) hz)⟩
#align monoid.mem_closure_union_iff Monoid.mem_closure_union_iff
#align add_monoid.mem_closure_union_iff AddMonoid.mem_closure_union_iff
+-/
end Monoid
@@ -457,9 +471,11 @@ def Submonoid.of {s : Set M} (h : IsSubmonoid s) : Submonoid M :=
#align add_submonoid.of AddSubmonoid.of
-/
+#print Submonoid.isSubmonoid /-
@[to_additive]
theorem Submonoid.isSubmonoid (S : Submonoid M) : IsSubmonoid (S : Set M) :=
⟨S.3, fun _ _ => S.2⟩
#align submonoid.is_submonoid Submonoid.isSubmonoid
#align add_submonoid.is_add_submonoid AddSubmonoid.isAddSubmonoid
+-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -282,7 +282,7 @@ of the submonoid. -/
@[to_additive
"The sum of elements of an `add_submonoid` of an `add_comm_monoid` indexed by\na `finset` is an element of the `add_submonoid`."]
theorem finset_prod_mem {M A} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (f : A → M) :
- ∀ t : Finset A, (∀ b ∈ t, f b ∈ s) → (∏ b in t, f b) ∈ s
+ ∀ t : Finset A, (∀ b ∈ t, f b ∈ s) → ∏ b in t, f b ∈ s
| ⟨m, hm⟩, _ => multiset_prod_mem hs _ (by simpa)
#align is_submonoid.finset_prod_mem IsSubmonoid.finset_prod_mem
#align is_add_submonoid.finset_sum_mem IsAddSubmonoid.finset_sum_mem
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -142,7 +142,7 @@ section powers
@[to_additive multiples
"The set of natural number multiples `0, x, 2x, ...` of an element `x` of an `add_monoid`."]
def powers (x : M) : Set M :=
- { y | ∃ n : ℕ, x ^ n = y }
+ {y | ∃ n : ℕ, x ^ n = y}
#align powers powers
#align multiples multiples
-/
@@ -321,7 +321,7 @@ inductive InClosure (s : Set M) : M → Prop
/-- The inductively defined submonoid generated by a subset of a monoid. -/
@[to_additive "The inductively defined `add_submonoid` genrated by a subset of an `add_monoid`."]
def Closure (s : Set M) : Set M :=
- { a | InClosure s a }
+ {a | InClosure s a}
#align monoid.closure Monoid.Closure
#align add_monoid.closure AddMonoid.Closure
-/
@@ -390,7 +390,7 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
apply in_closure.rec_on hx <;> intros
· solve_by_elim [subset_closure, Set.mem_image_of_mem]
· rw [hf.map_one]; apply IsSubmonoid.one_mem (closure.is_submonoid (f '' s))
- · rw [hf.map_mul]; solve_by_elim [(closure.is_submonoid _).mul_mem] )
+ · rw [hf.map_mul]; solve_by_elim [(closure.is_submonoid _).mul_mem])
(closure_subset (IsSubmonoid.image hf (closure.isSubmonoid _)) <|
Set.image_subset _ subset_closure)
#align monoid.image_closure Monoid.image_closure
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -37,7 +37,7 @@ submonoid, submonoids, is_submonoid
-/
-open BigOperators
+open scoped BigOperators
variable {M : Type _} [Monoid M] {s : Set M}
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -92,12 +92,6 @@ theorem Multiplicative.isSubmonoid_iff {s : Set A} :
#align multiplicative.is_submonoid_iff Multiplicative.isSubmonoid_iff
-/
-/- warning: is_submonoid.inter -> IsSubmonoid.inter is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {s₁ : Set.{u1} M} {s₂ : Set.{u1} M}, (IsSubmonoid.{u1} M _inst_1 s₁) -> (IsSubmonoid.{u1} M _inst_1 s₂) -> (IsSubmonoid.{u1} M _inst_1 (Inter.inter.{u1} (Set.{u1} M) (Set.hasInter.{u1} M) s₁ s₂))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {s₁ : Set.{u1} M} {s₂ : Set.{u1} M}, (IsSubmonoid.{u1} M _inst_1 s₁) -> (IsSubmonoid.{u1} M _inst_1 s₂) -> (IsSubmonoid.{u1} M _inst_1 (Inter.inter.{u1} (Set.{u1} M) (Set.instInterSet.{u1} M) s₁ s₂))
-Case conversion may be inaccurate. Consider using '#align is_submonoid.inter IsSubmonoid.interₓ'. -/
/-- The intersection of two submonoids of a monoid `M` is a submonoid of `M`. -/
@[to_additive
"The intersection of two `add_submonoid`s of an `add_monoid` `M` is\nan `add_submonoid` of M."]
@@ -153,12 +147,6 @@ def powers (x : M) : Set M :=
#align multiples multiples
-/
-/- warning: powers.one_mem -> powers.one_mem is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {x : M}, Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) (OfNat.ofNat.{u1} M 1 (OfNat.mk.{u1} M 1 (One.one.{u1} M (MulOneClass.toHasOne.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))))) (powers.{u1} M _inst_1 x)
-but is expected to have type
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {x : M}, Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) (OfNat.ofNat.{u1} M 1 (One.toOfNat1.{u1} M (Monoid.toOne.{u1} M _inst_1))) (powers.{u1} M _inst_1 x)
-Case conversion may be inaccurate. Consider using '#align powers.one_mem powers.one_memₓ'. -/
/-- 1 is in the set of natural number powers of an element of a monoid. -/
@[to_additive "0 is in the set of natural number multiples of an element of an `add_monoid`."]
theorem powers.one_mem {x : M} : (1 : M) ∈ powers x :=
@@ -176,12 +164,6 @@ theorem powers.self_mem {x : M} : x ∈ powers x :=
#align multiples.self_mem multiples.self_mem
-/
-/- warning: powers.mul_mem -> powers.mul_mem is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {x : M} {y : M} {z : M}, (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) y (powers.{u1} M _inst_1 x)) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) z (powers.{u1} M _inst_1 x)) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) y z) (powers.{u1} M _inst_1 x))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {x : M} {y : M} {z : M}, (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) y (powers.{u1} M _inst_1 x)) -> (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) z (powers.{u1} M _inst_1 x)) -> (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) y z) (powers.{u1} M _inst_1 x))
-Case conversion may be inaccurate. Consider using '#align powers.mul_mem powers.mul_memₓ'. -/
/-- The set of natural number powers of an element of a monoid is closed under multiplication. -/
@[to_additive
"The set of natural number multiples of an element of an `add_monoid` is closed under addition."]
@@ -268,12 +250,6 @@ end powers
namespace IsSubmonoid
-/- warning: is_submonoid.list_prod_mem -> IsSubmonoid.list_prod_mem is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {s : Set.{u1} M}, (IsSubmonoid.{u1} M _inst_1 s) -> (forall {l : List.{u1} M}, (forall (x : M), (Membership.Mem.{u1, u1} M (List.{u1} M) (List.hasMem.{u1} M) x l) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) x s)) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) (List.prod.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (MulOneClass.toHasOne.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) l) s))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {s : Set.{u1} M}, (IsSubmonoid.{u1} M _inst_1 s) -> (forall {l : List.{u1} M}, (forall (x : M), (Membership.mem.{u1, u1} M (List.{u1} M) (List.instMembershipList.{u1} M) x l) -> (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) x s)) -> (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) (List.prod.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Monoid.toOne.{u1} M _inst_1) l) s))
-Case conversion may be inaccurate. Consider using '#align is_submonoid.list_prod_mem IsSubmonoid.list_prod_memₓ'. -/
/-- The product of a list of elements of a submonoid is an element of the submonoid. -/
@[to_additive
"The sum of a list of elements of an `add_submonoid` is an element of the\n`add_submonoid`."]
@@ -301,12 +277,6 @@ theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m
#align is_add_submonoid.multiset_sum_mem IsAddSubmonoid.multiset_sum_mem
-/
-/- warning: is_submonoid.finset_prod_mem -> IsSubmonoid.finset_prod_mem is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} {A : Type.{u2}} [_inst_3 : CommMonoid.{u1} M] {s : Set.{u1} M}, (IsSubmonoid.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) s) -> (forall (f : A -> M) (t : Finset.{u2} A), (forall (b : A), (Membership.Mem.{u2, u2} A (Finset.{u2} A) (Finset.hasMem.{u2} A) b t) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) (f b) s)) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) (Finset.prod.{u1, u2} M A _inst_3 t (fun (b : A) => f b)) s))
-but is expected to have type
- forall {M : Type.{u2}} {A : Type.{u1}} [_inst_3 : CommMonoid.{u2} M] {s : Set.{u2} M}, (IsSubmonoid.{u2} M (CommMonoid.toMonoid.{u2} M _inst_3) s) -> (forall (f : A -> M) (t : Finset.{u1} A), (forall (b : A), (Membership.mem.{u1, u1} A (Finset.{u1} A) (Finset.instMembershipFinset.{u1} A) b t) -> (Membership.mem.{u2, u2} M (Set.{u2} M) (Set.instMembershipSet.{u2} M) (f b) s)) -> (Membership.mem.{u2, u2} M (Set.{u2} M) (Set.instMembershipSet.{u2} M) (Finset.prod.{u2, u1} M A _inst_3 t (fun (b : A) => f b)) s))
-Case conversion may be inaccurate. Consider using '#align is_submonoid.finset_prod_mem IsSubmonoid.finset_prod_memₓ'. -/
/-- The product of elements of a submonoid of a `comm_monoid` indexed by a `finset` is an element
of the submonoid. -/
@[to_additive
@@ -427,12 +397,6 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
#align add_monoid.image_closure AddMonoid.image_closure
-/
-/- warning: monoid.exists_list_of_mem_closure -> Monoid.exists_list_of_mem_closure is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {s : Set.{u1} M} {a : M}, (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) a (Monoid.Closure.{u1} M _inst_1 s)) -> (Exists.{succ u1} (List.{u1} M) (fun (l : List.{u1} M) => And (forall (x : M), (Membership.Mem.{u1, u1} M (List.{u1} M) (List.hasMem.{u1} M) x l) -> (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) x s)) (Eq.{succ u1} M (List.prod.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (MulOneClass.toHasOne.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) l) a)))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {s : Set.{u1} M} {a : M}, (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) a (Monoid.Closure.{u1} M _inst_1 s)) -> (Exists.{succ u1} (List.{u1} M) (fun (l : List.{u1} M) => And (forall (x : M), (Membership.mem.{u1, u1} M (List.{u1} M) (List.instMembershipList.{u1} M) x l) -> (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) x s)) (Eq.{succ u1} M (List.prod.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Monoid.toOne.{u1} M _inst_1) l) a)))
-Case conversion may be inaccurate. Consider using '#align monoid.exists_list_of_mem_closure Monoid.exists_list_of_mem_closureₓ'. -/
/-- Given an element `a` of the submonoid of a monoid `M` generated by a set `s`, there exists
a list of elements of `s` whose product is `a`. -/
@[to_additive
@@ -452,12 +416,6 @@ theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
#align monoid.exists_list_of_mem_closure Monoid.exists_list_of_mem_closure
#align add_monoid.exists_list_of_mem_closure AddMonoid.exists_list_of_mem_closure
-/- warning: monoid.mem_closure_union_iff -> Monoid.mem_closure_union_iff is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_3 : CommMonoid.{u1} M] {s : Set.{u1} M} {t : Set.{u1} M} {x : M}, Iff (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) x (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) (Union.union.{u1} (Set.{u1} M) (Set.hasUnion.{u1} M) s t))) (Exists.{succ u1} M (fun (y : M) => Exists.{0} (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) y (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) s)) (fun (H : Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) y (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) s)) => Exists.{succ u1} M (fun (z : M) => Exists.{0} (Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) z (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) t)) (fun (H : Membership.Mem.{u1, u1} M (Set.{u1} M) (Set.hasMem.{u1} M) z (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) t)) => Eq.{succ u1} M (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3)))) y z) x)))))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_3 : CommMonoid.{u1} M] {s : Set.{u1} M} {t : Set.{u1} M} {x : M}, Iff (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) x (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) (Union.union.{u1} (Set.{u1} M) (Set.instUnionSet.{u1} M) s t))) (Exists.{succ u1} M (fun (y : M) => And (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) y (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) s)) (Exists.{succ u1} M (fun (z : M) => And (Membership.mem.{u1, u1} M (Set.{u1} M) (Set.instMembershipSet.{u1} M) z (Monoid.Closure.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3) t)) (Eq.{succ u1} M (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3)))) y z) x)))))
-Case conversion may be inaccurate. Consider using '#align monoid.mem_closure_union_iff Monoid.mem_closure_union_iffₓ'. -/
/-- Given sets `s, t` of a commutative monoid `M`, `x ∈ M` is in the submonoid of `M` generated by
`s ∪ t` iff there exists an element of the submonoid generated by `s` and an element of the
submonoid generated by `t` whose product is `x`. -/
@@ -499,12 +457,6 @@ def Submonoid.of {s : Set M} (h : IsSubmonoid s) : Submonoid M :=
#align add_submonoid.of AddSubmonoid.of
-/
-/- warning: submonoid.is_submonoid -> Submonoid.isSubmonoid is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] (S : Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)), IsSubmonoid.{u1} M _inst_1 ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Set.{u1} M) (HasLiftT.mk.{succ u1, succ u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Set.{u1} M) (CoeTCₓ.coe.{succ u1, succ u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Set.{u1} M) (SetLike.Set.hasCoeT.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.setLike.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))))) S)
-but is expected to have type
- forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] (S : Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)), IsSubmonoid.{u1} M _inst_1 (SetLike.coe.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.instSetLikeSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) S)
-Case conversion may be inaccurate. Consider using '#align submonoid.is_submonoid Submonoid.isSubmonoidₓ'. -/
@[to_additive]
theorem Submonoid.isSubmonoid (S : Submonoid M) : IsSubmonoid (S : Set M) :=
⟨S.3, fun _ _ => S.2⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -239,9 +239,7 @@ theorem IsSubmonoid.image {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoi
/-- The image of a monoid hom is a submonoid of the codomain. -/
@[to_additive "The image of an `add_monoid` hom is an `add_submonoid`\nof the codomain."]
theorem Range.isSubmonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) :
- IsSubmonoid (Set.range f) := by
- rw [← Set.image_univ]
- exact univ.is_submonoid.image hf
+ IsSubmonoid (Set.range f) := by rw [← Set.image_univ]; exact univ.is_submonoid.image hf
#align range.is_submonoid Range.isSubmonoid
#align range.is_add_submonoid Range.isAddSubmonoid
-/
@@ -251,12 +249,8 @@ theorem Range.isSubmonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoi
@[to_additive IsAddSubmonoid.smul_mem
"An `add_submonoid` is closed under multiplication by naturals."]
theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n : ℕ}, a ^ n ∈ s
- | 0 => by
- rw [pow_zero]
- exact hs.one_mem
- | n + 1 => by
- rw [pow_succ]
- exact hs.mul_mem h IsSubmonoid.pow_mem
+ | 0 => by rw [pow_zero]; exact hs.one_mem
+ | n + 1 => by rw [pow_succ]; exact hs.mul_mem h IsSubmonoid.pow_mem
#align is_submonoid.pow_mem IsSubmonoid.pow_mem
-/
@@ -425,10 +419,8 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
rintro _ ⟨x, hx, rfl⟩
apply in_closure.rec_on hx <;> intros
· solve_by_elim [subset_closure, Set.mem_image_of_mem]
- · rw [hf.map_one]
- apply IsSubmonoid.one_mem (closure.is_submonoid (f '' s))
- · rw [hf.map_mul]
- solve_by_elim [(closure.is_submonoid _).mul_mem] )
+ · rw [hf.map_one]; apply IsSubmonoid.one_mem (closure.is_submonoid (f '' s))
+ · rw [hf.map_mul]; solve_by_elim [(closure.is_submonoid _).mul_mem] )
(closure_subset (IsSubmonoid.image hf (closure.isSubmonoid _)) <|
Set.image_subset _ subset_closure)
#align monoid.image_closure Monoid.image_closure
mathlib commit https://github.com/leanprover-community/mathlib/commit/e3fb84046afd187b710170887195d50bada934ee
@@ -108,37 +108,37 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
#align is_submonoid.inter IsSubmonoid.inter
#align is_add_submonoid.inter IsAddSubmonoid.inter
-#print IsSubmonoid.interᵢ /-
+#print IsSubmonoid.iInter /-
/-- The intersection of an indexed set of submonoids of a monoid `M` is a submonoid of `M`. -/
@[to_additive
"The intersection of an indexed set of `add_submonoid`s of an `add_monoid` `M` is\nan `add_submonoid` of `M`."]
-theorem IsSubmonoid.interᵢ {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
- IsSubmonoid (Set.interᵢ s) :=
- { one_mem := Set.mem_interᵢ.2 fun y => (h y).one_mem
+theorem IsSubmonoid.iInter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
+ IsSubmonoid (Set.iInter s) :=
+ { one_mem := Set.mem_iInter.2 fun y => (h y).one_mem
mul_mem := fun x₁ x₂ h₁ h₂ =>
- Set.mem_interᵢ.2 fun y => (h y).mul_mem (Set.mem_interᵢ.1 h₁ y) (Set.mem_interᵢ.1 h₂ y) }
-#align is_submonoid.Inter IsSubmonoid.interᵢ
-#align is_add_submonoid.Inter IsAddSubmonoid.interᵢ
+ Set.mem_iInter.2 fun y => (h y).mul_mem (Set.mem_iInter.1 h₁ y) (Set.mem_iInter.1 h₂ y) }
+#align is_submonoid.Inter IsSubmonoid.iInter
+#align is_add_submonoid.Inter IsAddSubmonoid.iInter
-/
-#print isSubmonoid_unionᵢ_of_directed /-
+#print isSubmonoid_iUnion_of_directed /-
/-- The union of an indexed, directed, nonempty set of submonoids of a monoid `M` is a submonoid
of `M`. -/
@[to_additive
"The union of an indexed, directed, nonempty set\nof `add_submonoid`s of an `add_monoid` `M` is an `add_submonoid` of `M`. "]
-theorem isSubmonoid_unionᵢ_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
+theorem isSubmonoid_iUnion_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
(hs : ∀ i, IsSubmonoid (s i)) (directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
IsSubmonoid (⋃ i, s i) :=
{ one_mem :=
let ⟨i⟩ := hι
- Set.mem_unionᵢ.2 ⟨i, (hs i).one_mem⟩
+ Set.mem_iUnion.2 ⟨i, (hs i).one_mem⟩
mul_mem := fun a b ha hb =>
- let ⟨i, hi⟩ := Set.mem_unionᵢ.1 ha
- let ⟨j, hj⟩ := Set.mem_unionᵢ.1 hb
+ let ⟨i, hi⟩ := Set.mem_iUnion.1 ha
+ let ⟨j, hj⟩ := Set.mem_iUnion.1 hb
let ⟨k, hk⟩ := Directed i j
- Set.mem_unionᵢ.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
-#align is_submonoid_Union_of_directed isSubmonoid_unionᵢ_of_directed
-#align is_add_submonoid_Union_of_directed isAddSubmonoid_unionᵢ_of_directed
+ Set.mem_iUnion.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
+#align is_submonoid_Union_of_directed isSubmonoid_iUnion_of_directed
+#align is_add_submonoid_Union_of_directed isAddSubmonoid_iUnion_of_directed
-/
section powers
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
deprecated
attributeWhy these changes?
@@ -222,7 +222,7 @@ theorem IsSubmonoid.powers_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : p
fun _ ⟨_, hx⟩ => hx ▸ hs.pow_mem h
#align is_submonoid.power_subset IsSubmonoid.powers_subset
#align is_add_submonoid.multiples_subset IsAddSubmonoid.multiples_subset
-/- 2024-02-21 -/ @[deprecated] alias IsSubmonoid.power_subset := IsSubmonoid.powers_subset
+@[deprecated] alias IsSubmonoid.power_subset := IsSubmonoid.powers_subset -- 2024-02-21
end powers
Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.
@@ -269,7 +269,7 @@ end IsSubmonoid
namespace AddMonoid
/-- The inductively defined membership predicate for the submonoid generated by a subset of a
- monoid.-/
+ monoid. -/
inductive InClosure (s : Set A) : A → Prop
| basic {a : A} : a ∈ s → InClosure _ a
| zero : InClosure _ 0
We change the following field in the definition of an additive commutative monoid:
nsmul_succ : ∀ (n : ℕ) (x : G),
- AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+ AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
where the latter is more natural
We adjust the definitions of ^
in monoids, groups, etc.
Originally there was a warning comment about why this natural order was preferred
use
x * npowRec n x
and notnpowRec n x * x
in the definition to make sure that definitional unfolding ofnpowRec
is blocked, to avoid deep recursion issues.
but it seems to no longer apply.
Remarks on the PR :
pow_succ
and pow_succ'
have switched their meanings.Ideal.IsPrime.mul_mem_pow
which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul
.@@ -210,7 +210,7 @@ theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n
exact hs.one_mem
| n + 1 => by
rw [pow_succ]
- exact hs.mul_mem h (IsSubmonoid.pow_mem hs h)
+ exact hs.mul_mem (IsSubmonoid.pow_mem hs h) h
#align is_submonoid.pow_mem IsSubmonoid.pow_mem
/-- The set of natural number powers of an element of a `Submonoid` is a subset of the
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -34,7 +34,6 @@ Submonoid, Submonoids, IsSubmonoid
open BigOperators
variable {M : Type*} [Monoid M] {s : Set M}
-
variable {A : Type*} [AddMonoid A] {t : Set A}
/-- `s` is an additive submonoid: a set containing 0 and closed under addition.
List → Multiset
(#11099)
These did not respect the naming convention by having the coe
as a prefix instead of a suffix, or vice-versa. Also add a bunch of norm_cast
@@ -249,7 +249,7 @@ the submonoid. -/
theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m : Multiset M) :
(∀ a ∈ m, a ∈ s) → m.prod ∈ s := by
refine' Quotient.inductionOn m fun l hl => _
- rw [Multiset.quot_mk_to_coe, Multiset.coe_prod]
+ rw [Multiset.quot_mk_to_coe, Multiset.prod_coe]
exact list_prod_mem hs hl
#align is_submonoid.multiset_prod_mem IsSubmonoid.multiset_prod_mem
#align is_add_submonoid.multiset_sum_mem IsAddSubmonoid.multiset_sum_mem
@@ -122,7 +122,7 @@ theorem isSubmonoid_iUnion_of_directed {ι : Type*} [hι : Nonempty ι] {s : ι
section powers
/-- The set of natural number powers `1, x, x², ...` of an element `x` of a monoid. -/
-@[to_additive multiples
+@[to_additive
"The set of natural number multiples `0, x, 2x, ...` of an element `x` of an `AddMonoid`."]
def powers (x : M) : Set M :=
{ y | ∃ n : ℕ, x ^ n = y }
@@ -214,14 +214,16 @@ theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n
exact hs.mul_mem h (IsSubmonoid.pow_mem hs h)
#align is_submonoid.pow_mem IsSubmonoid.pow_mem
-/-- The set of natural number powers of an element of a submonoid is a subset of the submonoid. -/
-@[to_additive IsAddSubmonoid.multiples_subset
+/-- The set of natural number powers of an element of a `Submonoid` is a subset of the
+`Submonoid`. -/
+@[to_additive
"The set of natural number multiples of an element of an `AddSubmonoid` is a subset of
the `AddSubmonoid`."]
-theorem IsSubmonoid.power_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : powers a ⊆ s :=
+theorem IsSubmonoid.powers_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : powers a ⊆ s :=
fun _ ⟨_, hx⟩ => hx ▸ hs.pow_mem h
-#align is_submonoid.power_subset IsSubmonoid.power_subset
+#align is_submonoid.power_subset IsSubmonoid.powers_subset
#align is_add_submonoid.multiples_subset IsAddSubmonoid.multiples_subset
+/- 2024-02-21 -/ @[deprecated] alias IsSubmonoid.power_subset := IsSubmonoid.powers_subset
end powers
@@ -337,7 +339,7 @@ theorem closure_mono {s t : Set M} (h : s ⊆ t) : Closure s ⊆ Closure t :=
theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x :=
Set.eq_of_subset_of_subset
(closure_subset (powers.isSubmonoid x) <| Set.singleton_subset_iff.2 <| powers.self_mem) <|
- IsSubmonoid.power_subset (closure.isSubmonoid _) <|
+ IsSubmonoid.powers_subset (closure.isSubmonoid _) <|
Set.singleton_subset_iff.1 <| subset_closure
#align monoid.closure_singleton Monoid.closure_singleton
#align add_monoid.closure_singleton AddMonoid.closure_singleton
refine
s (#10762)
I replaced a few "terminal" refine/refine'
s with exact
.
The strategy was very simple-minded: essentially any refine
whose following line had smaller indentation got replaced by exact
and then I cleaned up the mess.
This PR certainly leaves some further terminal refine
s, but maybe the current change is beneficial.
@@ -425,6 +425,6 @@ def Submonoid.of {s : Set M} (h : IsSubmonoid s) : Submonoid M :=
@[to_additive]
theorem Submonoid.isSubmonoid (S : Submonoid M) : IsSubmonoid (S : Set M) := by
- refine' ⟨S.2, S.1.2⟩
+ exact ⟨S.2, S.1.2⟩
#align submonoid.is_submonoid Submonoid.isSubmonoid
#align add_submonoid.is_add_submonoid AddSubmonoid.isAddSubmonoid
@@ -59,7 +59,7 @@ structure IsSubmonoid (s : Set M) : Prop where
#align is_submonoid IsSubmonoid
theorem Additive.isAddSubmonoid {s : Set M} :
- ∀ _ : IsSubmonoid s, @IsAddSubmonoid (Additive M) _ s
+ IsSubmonoid s → @IsAddSubmonoid (Additive M) _ s
| ⟨h₁, h₂⟩ => ⟨h₁, @h₂⟩
#align additive.is_add_submonoid Additive.isAddSubmonoid
@@ -69,7 +69,7 @@ theorem Additive.isAddSubmonoid_iff {s : Set M} :
#align additive.is_add_submonoid_iff Additive.isAddSubmonoid_iff
theorem Multiplicative.isSubmonoid {s : Set A} :
- ∀ _ : IsAddSubmonoid s, @IsSubmonoid (Multiplicative A) _ s
+ IsAddSubmonoid s → @IsSubmonoid (Multiplicative A) _ s
| ⟨h₁, h₂⟩ => ⟨h₁, @h₂⟩
#align multiplicative.is_submonoid Multiplicative.isSubmonoid
cases x with | ...
instead of cases x; case => ...
(#9321)
This converts usages of the pattern
cases h
case inl h' => ...
case inr h' => ...
which derive from mathported code, to the "structured cases
" syntax:
cases h with
| inl h' => ...
| inr h' => ...
The case where the subgoals are handled with ·
instead of case
is more contentious (and much more numerous) so I left those alone. This pattern also appears with cases'
, induction
, induction'
, and rcases
. Furthermore, there is a similar transformation for by_cases
:
by_cases h : cond
case pos => ...
case neg => ...
is replaced by:
if h : cond then
...
else
...
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -370,10 +370,10 @@ a list of elements of `s` whose product is `a`. -/
a set `s`, there exists a list of elements of `s` whose sum is `a`."]
theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
∃ l : List M, (∀ x ∈ l, x ∈ s) ∧ l.prod = a := by
- induction h
- case basic a ha => exists [a]; simp [ha]
- case one => exists []; simp
- case mul a b _ _ ha hb =>
+ induction h with
+ | @basic a ha => exists [a]; simp [ha]
+ | one => exists []; simp
+ | mul _ _ ha hb =>
rcases ha with ⟨la, ha, eqa⟩
rcases hb with ⟨lb, hb, eqb⟩
exists la ++ lb
Removes nonterminal simps on lines looking like simp [...]
@@ -377,7 +377,7 @@ theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
rcases ha with ⟨la, ha, eqa⟩
rcases hb with ⟨lb, hb, eqb⟩
exists la ++ lb
- simp [eqa.symm, eqb.symm, or_imp]
+ simp only [List.mem_append, or_imp, List.prod_append, eqa.symm, eqb.symm, and_true]
exact fun a => ⟨ha a, hb a⟩
#align monoid.exists_list_of_mem_closure Monoid.exists_list_of_mem_closure
#align add_monoid.exists_list_of_mem_closure AddMonoid.exists_list_of_mem_closure
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -33,9 +33,9 @@ Submonoid, Submonoids, IsSubmonoid
open BigOperators
-variable {M : Type _} [Monoid M] {s : Set M}
+variable {M : Type*} [Monoid M] {s : Set M}
-variable {A : Type _} [AddMonoid A] {t : Set A}
+variable {A : Type*} [AddMonoid A] {t : Set A}
/-- `s` is an additive submonoid: a set containing 0 and closed under addition.
Note that this structure is deprecated, and the bundled variant `AddSubmonoid A` should be
@@ -92,7 +92,7 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
@[to_additive
"The intersection of an indexed set of `AddSubmonoid`s of an `AddMonoid` `M` is
an `AddSubmonoid` of `M`."]
-theorem IsSubmonoid.iInter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
+theorem IsSubmonoid.iInter {ι : Sort*} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
IsSubmonoid (Set.iInter s) :=
{ one_mem := Set.mem_iInter.2 fun y => (h y).one_mem
mul_mem := fun h₁ h₂ =>
@@ -105,7 +105,7 @@ theorem IsSubmonoid.iInter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsS
@[to_additive
"The union of an indexed, directed, nonempty set of `AddSubmonoid`s of an `AddMonoid` `M`
is an `AddSubmonoid` of `M`. "]
-theorem isSubmonoid_iUnion_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
+theorem isSubmonoid_iUnion_of_directed {ι : Type*} [hι : Nonempty ι] {s : ι → Set M}
(hs : ∀ i, IsSubmonoid (s i)) (Directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
IsSubmonoid (⋃ i, s i) :=
{ one_mem :=
@@ -173,7 +173,7 @@ theorem Univ.isSubmonoid : IsSubmonoid (@Set.univ M) := by constructor <;> simp
@[to_additive
"The preimage of an `AddSubmonoid` under an `AddMonoid` hom is
an `AddSubmonoid` of the domain."]
-theorem IsSubmonoid.preimage {N : Type _} [Monoid N] {f : M → N} (hf : IsMonoidHom f) {s : Set N}
+theorem IsSubmonoid.preimage {N : Type*} [Monoid N] {f : M → N} (hf : IsMonoidHom f) {s : Set N}
(hs : IsSubmonoid s) : IsSubmonoid (f ⁻¹' s) :=
{ one_mem := show f 1 ∈ s by (rw [IsMonoidHom.map_one hf]; exact hs.one_mem)
mul_mem := fun {a b} (ha : f a ∈ s) (hb : f b ∈ s) =>
@@ -185,7 +185,7 @@ theorem IsSubmonoid.preimage {N : Type _} [Monoid N] {f : M → N} (hf : IsMonoi
@[to_additive
"The image of an `AddSubmonoid` under an `AddMonoid` hom is an `AddSubmonoid` of the
codomain."]
-theorem IsSubmonoid.image {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) {s : Set M}
+theorem IsSubmonoid.image {γ : Type*} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) {s : Set M}
(hs : IsSubmonoid s) : IsSubmonoid (f '' s) :=
{ one_mem := ⟨1, hs.one_mem, hf.map_one⟩
mul_mem := @fun a b ⟨x, hx⟩ ⟨y, hy⟩ =>
@@ -195,7 +195,7 @@ theorem IsSubmonoid.image {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoi
/-- The image of a monoid hom is a submonoid of the codomain. -/
@[to_additive "The image of an `AddMonoid` hom is an `AddSubmonoid` of the codomain."]
-theorem Range.isSubmonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) :
+theorem Range.isSubmonoid {γ : Type*} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) :
IsSubmonoid (Set.range f) := by
rw [← Set.image_univ]
exact Univ.isSubmonoid.image hf
@@ -347,7 +347,7 @@ theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x :=
@[to_additive
"The image under an `AddMonoid` hom of the `AddSubmonoid` generated by a set equals
the `AddSubmonoid` generated by the image of the set under the `AddMonoid` hom."]
-theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f) (s : Set M) :
+theorem image_closure {A : Type*} [Monoid A] {f : M → A} (hf : IsMonoidHom f) (s : Set M) :
f '' Closure s = Closure (f '' s) :=
le_antisymm
(by
@@ -389,7 +389,7 @@ theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
"Given sets `s, t` of a commutative `AddMonoid M`, `x ∈ M` is in the `AddSubmonoid`
of `M` generated by `s ∪ t` iff there exists an element of the `AddSubmonoid` generated by `s`
and an element of the `AddSubmonoid` generated by `t` whose sum is `x`."]
-theorem mem_closure_union_iff {M : Type _} [CommMonoid M] {s t : Set M} {x : M} :
+theorem mem_closure_union_iff {M : Type*} [CommMonoid M] {s t : Set M} {x : M} :
x ∈ Closure (s ∪ t) ↔ ∃ y ∈ Closure s, ∃ z ∈ Closure t, y * z = x :=
⟨fun hx =>
let ⟨L, HL1, HL2⟩ := exists_list_of_mem_closure hx
@@ -2,16 +2,13 @@
Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzzard
-
-! This file was ported from Lean 3 source module deprecated.submonoid
-! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.GroupTheory.Submonoid.Basic
import Mathlib.Algebra.BigOperators.Basic
import Mathlib.Deprecated.Group
+#align_import deprecated.submonoid from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
+
/-!
# Unbundled submonoids (deprecated)
I ran codespell Mathlib
and got tired halfway through the suggestions.
@@ -293,7 +293,7 @@ inductive InClosure (s : Set M) : M → Prop
/-- The inductively defined submonoid generated by a subset of a monoid. -/
@[to_additive
- "The inductively defined `AddSubmonoid` genrated by a subset of an `AddMonoid`."]
+ "The inductively defined `AddSubmonoid` generated by a subset of an `AddMonoid`."]
def Closure (s : Set M) : Set M :=
{ a | InClosure s a }
#align monoid.closure Monoid.Closure
sSup
/iSup
(#3938)
As discussed on Zulip
supₛ
→ sSup
infₛ
→ sInf
supᵢ
→ iSup
infᵢ
→ iInf
bsupₛ
→ bsSup
binfₛ
→ bsInf
bsupᵢ
→ biSup
binfᵢ
→ biInf
csupₛ
→ csSup
cinfₛ
→ csInf
csupᵢ
→ ciSup
cinfᵢ
→ ciInf
unionₛ
→ sUnion
interₛ
→ sInter
unionᵢ
→ iUnion
interᵢ
→ iInter
bunionₛ
→ bsUnion
binterₛ
→ bsInter
bunionᵢ
→ biUnion
binterᵢ
→ biInter
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@@ -95,32 +95,32 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
@[to_additive
"The intersection of an indexed set of `AddSubmonoid`s of an `AddMonoid` `M` is
an `AddSubmonoid` of `M`."]
-theorem IsSubmonoid.interᵢ {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
- IsSubmonoid (Set.interᵢ s) :=
- { one_mem := Set.mem_interᵢ.2 fun y => (h y).one_mem
+theorem IsSubmonoid.iInter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
+ IsSubmonoid (Set.iInter s) :=
+ { one_mem := Set.mem_iInter.2 fun y => (h y).one_mem
mul_mem := fun h₁ h₂ =>
- Set.mem_interᵢ.2 fun y => (h y).mul_mem (Set.mem_interᵢ.1 h₁ y) (Set.mem_interᵢ.1 h₂ y) }
-#align is_submonoid.Inter IsSubmonoid.interᵢ
-#align is_add_submonoid.Inter IsAddSubmonoid.interᵢ
+ Set.mem_iInter.2 fun y => (h y).mul_mem (Set.mem_iInter.1 h₁ y) (Set.mem_iInter.1 h₂ y) }
+#align is_submonoid.Inter IsSubmonoid.iInter
+#align is_add_submonoid.Inter IsAddSubmonoid.iInter
/-- The union of an indexed, directed, nonempty set of submonoids of a monoid `M` is a submonoid
of `M`. -/
@[to_additive
"The union of an indexed, directed, nonempty set of `AddSubmonoid`s of an `AddMonoid` `M`
is an `AddSubmonoid` of `M`. "]
-theorem isSubmonoid_unionᵢ_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
+theorem isSubmonoid_iUnion_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
(hs : ∀ i, IsSubmonoid (s i)) (Directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
IsSubmonoid (⋃ i, s i) :=
{ one_mem :=
let ⟨i⟩ := hι
- Set.mem_unionᵢ.2 ⟨i, (hs i).one_mem⟩
+ Set.mem_iUnion.2 ⟨i, (hs i).one_mem⟩
mul_mem := fun ha hb =>
- let ⟨i, hi⟩ := Set.mem_unionᵢ.1 ha
- let ⟨j, hj⟩ := Set.mem_unionᵢ.1 hb
+ let ⟨i, hi⟩ := Set.mem_iUnion.1 ha
+ let ⟨j, hj⟩ := Set.mem_iUnion.1 hb
let ⟨k, hk⟩ := Directed i j
- Set.mem_unionᵢ.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
-#align is_submonoid_Union_of_directed isSubmonoid_unionᵢ_of_directed
-#align is_add_submonoid_Union_of_directed isAddSubmonoid_unionᵢ_of_directed
+ Set.mem_iUnion.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
+#align is_submonoid_Union_of_directed isSubmonoid_iUnion_of_directed
+#align is_add_submonoid_Union_of_directed isAddSubmonoid_iUnion_of_directed
section powers
@@ -66,10 +66,10 @@ theorem Additive.isAddSubmonoid {s : Set M} :
| ⟨h₁, h₂⟩ => ⟨h₁, @h₂⟩
#align additive.is_add_submonoid Additive.isAddSubmonoid
-theorem Additive.is_add_submonoid_iff {s : Set M} :
+theorem Additive.isAddSubmonoid_iff {s : Set M} :
@IsAddSubmonoid (Additive M) _ s ↔ IsSubmonoid s :=
⟨fun ⟨h₁, h₂⟩ => ⟨h₁, @h₂⟩, Additive.isAddSubmonoid⟩
-#align additive.is_add_submonoid_iff Additive.is_add_submonoid_iff
+#align additive.is_add_submonoid_iff Additive.isAddSubmonoid_iff
theorem Multiplicative.isSubmonoid {s : Set A} :
∀ _ : IsAddSubmonoid s, @IsSubmonoid (Multiplicative A) _ s
@@ -95,32 +95,32 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
@[to_additive
"The intersection of an indexed set of `AddSubmonoid`s of an `AddMonoid` `M` is
an `AddSubmonoid` of `M`."]
-theorem IsSubmonoid.Inter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
+theorem IsSubmonoid.interᵢ {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSubmonoid (s y)) :
IsSubmonoid (Set.interᵢ s) :=
{ one_mem := Set.mem_interᵢ.2 fun y => (h y).one_mem
- mul_mem := @fun _ _ h₁ h₂ =>
+ mul_mem := fun h₁ h₂ =>
Set.mem_interᵢ.2 fun y => (h y).mul_mem (Set.mem_interᵢ.1 h₁ y) (Set.mem_interᵢ.1 h₂ y) }
-#align is_submonoid.Inter IsSubmonoid.Inter
-#align is_add_submonoid.Inter IsAddSubmonoid.Inter
+#align is_submonoid.Inter IsSubmonoid.interᵢ
+#align is_add_submonoid.Inter IsAddSubmonoid.interᵢ
/-- The union of an indexed, directed, nonempty set of submonoids of a monoid `M` is a submonoid
of `M`. -/
@[to_additive
"The union of an indexed, directed, nonempty set of `AddSubmonoid`s of an `AddMonoid` `M`
is an `AddSubmonoid` of `M`. "]
-theorem is_submonoid_Union_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
+theorem isSubmonoid_unionᵢ_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι → Set M}
(hs : ∀ i, IsSubmonoid (s i)) (Directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
IsSubmonoid (⋃ i, s i) :=
{ one_mem :=
let ⟨i⟩ := hι
Set.mem_unionᵢ.2 ⟨i, (hs i).one_mem⟩
- mul_mem := @fun _ _ ha hb =>
+ mul_mem := fun ha hb =>
let ⟨i, hi⟩ := Set.mem_unionᵢ.1 ha
let ⟨j, hj⟩ := Set.mem_unionᵢ.1 hb
let ⟨k, hk⟩ := Directed i j
Set.mem_unionᵢ.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
-#align is_submonoid_Union_of_directed is_submonoid_Union_of_directed
-#align is_add_submonoid_Union_of_directed is_addSubmonoid_Union_of_directed
+#align is_submonoid_Union_of_directed isSubmonoid_unionᵢ_of_directed
+#align is_add_submonoid_Union_of_directed isAddSubmonoid_unionᵢ_of_directed
section powers
@@ -160,17 +160,17 @@ theorem powers.mul_mem {x y z : M} : y ∈ powers x → z ∈ powers x → y * z
@[to_additive
"The set of natural number multiples of an element of an `AddMonoid` `M` is
an `AddSubmonoid` of `M`."]
-theorem powers.is_submonoid (x : M) : IsSubmonoid (powers x) :=
+theorem powers.isSubmonoid (x : M) : IsSubmonoid (powers x) :=
{ one_mem := powers.one_mem
- mul_mem := @fun _ _ => powers.mul_mem }
-#align powers.is_submonoid powers.is_submonoid
-#align multiples.is_add_submonoid multiples.is_addSubmonoid
+ mul_mem := powers.mul_mem }
+#align powers.is_submonoid powers.isSubmonoid
+#align multiples.is_add_submonoid multiples.isAddSubmonoid
/-- A monoid is a submonoid of itself. -/
-@[to_additive "An `add_monoid` is an `add_submonoid` of itself."]
-theorem Univ.IsSubmonoid : IsSubmonoid (@Set.univ M) := by constructor <;> simp
-#align univ.is_submonoid Univ.IsSubmonoid
-#align univ.is_add_submonoid Univ.IsAddSubmonoid
+@[to_additive "An `AddMonoid` is an `AddSubmonoid` of itself."]
+theorem Univ.isSubmonoid : IsSubmonoid (@Set.univ M) := by constructor <;> simp
+#align univ.is_submonoid Univ.isSubmonoid
+#align univ.is_add_submonoid Univ.isAddSubmonoid
/-- The preimage of a submonoid under a monoid hom is a submonoid of the domain. -/
@[to_additive
@@ -179,7 +179,7 @@ theorem Univ.IsSubmonoid : IsSubmonoid (@Set.univ M) := by constructor <;> simp
theorem IsSubmonoid.preimage {N : Type _} [Monoid N] {f : M → N} (hf : IsMonoidHom f) {s : Set N}
(hs : IsSubmonoid s) : IsSubmonoid (f ⁻¹' s) :=
{ one_mem := show f 1 ∈ s by (rw [IsMonoidHom.map_one hf]; exact hs.one_mem)
- mul_mem := @fun a b (ha : f a ∈ s) (hb : f b ∈ s) =>
+ mul_mem := fun {a b} (ha : f a ∈ s) (hb : f b ∈ s) =>
show f (a * b) ∈ s by (rw [IsMonoidHom.map_mul' hf]; exact hs.mul_mem ha hb) }
#align is_submonoid.preimage IsSubmonoid.preimage
#align is_add_submonoid.preimage IsAddSubmonoid.preimage
@@ -198,12 +198,12 @@ theorem IsSubmonoid.image {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoi
/-- The image of a monoid hom is a submonoid of the codomain. -/
@[to_additive "The image of an `AddMonoid` hom is an `AddSubmonoid` of the codomain."]
-theorem Range.is_submonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) :
+theorem Range.isSubmonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) :
IsSubmonoid (Set.range f) := by
rw [← Set.image_univ]
- exact Univ.IsSubmonoid.image hf
-#align range.is_submonoid Range.is_submonoid
-#align range.is_add_submonoid Range.is_addSubmonoid
+ exact Univ.isSubmonoid.image hf
+#align range.is_submonoid Range.isSubmonoid
+#align range.is_add_submonoid Range.isAddSubmonoid
/-- Submonoids are closed under natural powers. -/
@[to_additive
@@ -255,11 +255,11 @@ theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m
#align is_submonoid.multiset_prod_mem IsSubmonoid.multiset_prod_mem
#align is_add_submonoid.multiset_sum_mem IsAddSubmonoid.multiset_sum_mem
-/-- The product of elements of a submonoid of a `comm_monoid` indexed by a `finset` is an element
+/-- The product of elements of a submonoid of a `CommMonoid` indexed by a `Finset` is an element
of the submonoid. -/
@[to_additive
"The sum of elements of an `AddSubmonoid` of an `AddCommMonoid` indexed by
- a `finset` is an element of the `AddSubmonoid`."]
+ a `Finset` is an element of the `AddSubmonoid`."]
theorem finset_prod_mem {M A} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (f : A → M) :
∀ t : Finset A, (∀ b ∈ t, f b ∈ s) → (∏ b in t, f b) ∈ s
| ⟨m, hm⟩, _ => multiset_prod_mem hs _ (by simpa)
@@ -300,13 +300,11 @@ def Closure (s : Set M) : Set M :=
#align add_monoid.closure AddMonoid.Closure
@[to_additive]
--- porting note (TODO): here the error is `unknown constant 'AddMonoid.InClosure.one'`, but above
--- we defined `AddMonoid.InClosure.zero`, should that be helpful here somehow?
-theorem closure.IsSubmonoid (s : Set M) : IsSubmonoid (Closure s) :=
+theorem closure.isSubmonoid (s : Set M) : IsSubmonoid (Closure s) :=
{ one_mem := InClosure.one
- mul_mem := @fun _ _ => InClosure.mul }
-#align monoid.closure.is_submonoid Monoid.closure.IsSubmonoid
-#align add_monoid.closure.is_add_submonoid AddMonoid.closure.IsAddSubmonoid
+ mul_mem := InClosure.mul }
+#align monoid.closure.is_submonoid Monoid.closure.isSubmonoid
+#align add_monoid.closure.is_add_submonoid AddMonoid.closure.isAddSubmonoid
/-- A subset of a monoid is contained in the submonoid it generates. -/
@[to_additive
@@ -330,7 +328,7 @@ theorem closure_subset {s t : Set M} (ht : IsSubmonoid t) (h : s ⊆ t) : Closur
"Given subsets `t` and `s` of an `AddMonoid M`, if `s ⊆ t`, the `AddSubmonoid`
of `M` generated by `s` is contained in the `AddSubmonoid` generated by `t`."]
theorem closure_mono {s t : Set M} (h : s ⊆ t) : Closure s ⊆ Closure t :=
- closure_subset (closure.IsSubmonoid t) <| Set.Subset.trans h subset_closure
+ closure_subset (closure.isSubmonoid t) <| Set.Subset.trans h subset_closure
#align monoid.closure_mono Monoid.closure_mono
#align add_monoid.closure_mono AddMonoid.closure_mono
@@ -341,8 +339,8 @@ theorem closure_mono {s t : Set M} (h : s ⊆ t) : Closure s ⊆ Closure t :=
natural number multiples of the element."]
theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x :=
Set.eq_of_subset_of_subset
- (closure_subset (powers.is_submonoid x) <| Set.singleton_subset_iff.2 <| powers.self_mem) <|
- IsSubmonoid.power_subset (closure.IsSubmonoid _) <|
+ (closure_subset (powers.isSubmonoid x) <| Set.singleton_subset_iff.2 <| powers.self_mem) <|
+ IsSubmonoid.power_subset (closure.isSubmonoid _) <|
Set.singleton_subset_iff.1 <| subset_closure
#align monoid.closure_singleton Monoid.closure_singleton
#align add_monoid.closure_singleton AddMonoid.closure_singleton
@@ -360,10 +358,10 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
induction' hx with z hz
· solve_by_elim [subset_closure, Set.mem_image_of_mem]
· rw [hf.map_one]
- apply IsSubmonoid.one_mem (closure.IsSubmonoid (f '' s))
+ apply IsSubmonoid.one_mem (closure.isSubmonoid (f '' s))
· rw [hf.map_mul]
- solve_by_elim [(closure.IsSubmonoid _).mul_mem] )
- (closure_subset (IsSubmonoid.image hf (closure.IsSubmonoid _)) <|
+ solve_by_elim [(closure.isSubmonoid _).mul_mem] )
+ (closure_subset (IsSubmonoid.image hf (closure.isSubmonoid _)) <|
Set.image_subset _ subset_closure)
#align monoid.image_closure Monoid.image_closure
#align add_monoid.image_closure AddMonoid.image_closure
@@ -401,20 +399,20 @@ theorem mem_closure_union_iff {M : Type _} [CommMonoid M] {s t : Set M} {x : M}
HL2 ▸
List.recOn L
(fun _ =>
- ⟨1, (closure.IsSubmonoid _).one_mem, 1, (closure.IsSubmonoid _).one_mem, mul_one _⟩)
+ ⟨1, (closure.isSubmonoid _).one_mem, 1, (closure.isSubmonoid _).one_mem, mul_one _⟩)
(fun hd tl ih HL1 =>
let ⟨y, hy, z, hz, hyzx⟩ := ih (List.forall_mem_of_forall_mem_cons HL1)
Or.casesOn (HL1 hd <| List.mem_cons_self _ _)
(fun hs =>
- ⟨hd * y, (closure.IsSubmonoid _).mul_mem (subset_closure hs) hy, z, hz, by
+ ⟨hd * y, (closure.isSubmonoid _).mul_mem (subset_closure hs) hy, z, hz, by
rw [mul_assoc, List.prod_cons, ← hyzx]⟩)
fun ht =>
- ⟨y, hy, z * hd, (closure.IsSubmonoid _).mul_mem hz (subset_closure ht), by
+ ⟨y, hy, z * hd, (closure.isSubmonoid _).mul_mem hz (subset_closure ht), by
rw [← mul_assoc, List.prod_cons, ← hyzx, mul_comm hd]⟩)
HL1,
fun ⟨y, hy, z, hz, hyzx⟩ =>
hyzx ▸
- (closure.IsSubmonoid _).mul_mem (closure_mono (Set.subset_union_left _ _) hy)
+ (closure.isSubmonoid _).mul_mem (closure_mono (Set.subset_union_left _ _) hy)
(closure_mono (Set.subset_union_right _ _) hz)⟩
#align monoid.mem_closure_union_iff Monoid.mem_closure_union_iff
#align add_monoid.mem_closure_union_iff AddMonoid.mem_closure_union_iff
@@ -429,7 +427,7 @@ def Submonoid.of {s : Set M} (h : IsSubmonoid s) : Submonoid M :=
#align add_submonoid.of AddSubmonoid.of
@[to_additive]
-theorem Submonoid.is_submonoid (S : Submonoid M) : IsSubmonoid (S : Set M) := by
+theorem Submonoid.isSubmonoid (S : Submonoid M) : IsSubmonoid (S : Set M) := by
refine' ⟨S.2, S.1.2⟩
-#align submonoid.is_submonoid Submonoid.is_submonoid
-#align add_submonoid.is_add_submonoid AddSubmonoid.is_addSubmonoid
+#align submonoid.is_submonoid Submonoid.isSubmonoid
+#align add_submonoid.is_add_submonoid AddSubmonoid.isAddSubmonoid
@@ -34,7 +34,7 @@ Submonoid, Submonoids, IsSubmonoid
-/
--- open BigOperators -- Porting note: commented out locale
+open BigOperators
variable {M : Type _} [Monoid M] {s : Set M}
This PR is the result of a slight variant on the following "algorithm"
_
and make all uppercase letters into lowercase_
and make all uppercase letters into lowercase(original_lean3_name, OriginalLean4Name)
#align
statement just before the next empty line#align
statement to have been inserted too early)@@ -89,6 +89,7 @@ theorem IsSubmonoid.inter {s₁ s₂ : Set M} (is₁ : IsSubmonoid s₁) (is₂
{ one_mem := ⟨is₁.one_mem, is₂.one_mem⟩
mul_mem := @fun _ _ hx hy => ⟨is₁.mul_mem hx.1 hy.1, is₂.mul_mem hx.2 hy.2⟩ }
#align is_submonoid.inter IsSubmonoid.inter
+#align is_add_submonoid.inter IsAddSubmonoid.inter
/-- The intersection of an indexed set of submonoids of a monoid `M` is a submonoid of `M`. -/
@[to_additive
@@ -100,6 +101,7 @@ theorem IsSubmonoid.Inter {ι : Sort _} {s : ι → Set M} (h : ∀ y : ι, IsSu
mul_mem := @fun _ _ h₁ h₂ =>
Set.mem_interᵢ.2 fun y => (h y).mul_mem (Set.mem_interᵢ.1 h₁ y) (Set.mem_interᵢ.1 h₂ y) }
#align is_submonoid.Inter IsSubmonoid.Inter
+#align is_add_submonoid.Inter IsAddSubmonoid.Inter
/-- The union of an indexed, directed, nonempty set of submonoids of a monoid `M` is a submonoid
of `M`. -/
@@ -118,6 +120,7 @@ theorem is_submonoid_Union_of_directed {ι : Type _} [hι : Nonempty ι] {s : ι
let ⟨k, hk⟩ := Directed i j
Set.mem_unionᵢ.2 ⟨k, (hs k).mul_mem (hk.1 hi) (hk.2 hj)⟩ }
#align is_submonoid_Union_of_directed is_submonoid_Union_of_directed
+#align is_add_submonoid_Union_of_directed is_addSubmonoid_Union_of_directed
section powers
@@ -127,12 +130,14 @@ section powers
def powers (x : M) : Set M :=
{ y | ∃ n : ℕ, x ^ n = y }
#align powers powers
+#align multiples multiples
/-- 1 is in the set of natural number powers of an element of a monoid. -/
@[to_additive "0 is in the set of natural number multiples of an element of an `AddMonoid`."]
theorem powers.one_mem {x : M} : (1 : M) ∈ powers x :=
⟨0, pow_zero _⟩
#align powers.one_mem powers.one_mem
+#align multiples.zero_mem multiples.zero_mem
/-- An element of a monoid is in the set of that element's natural number powers. -/
@[to_additive
@@ -140,6 +145,7 @@ theorem powers.one_mem {x : M} : (1 : M) ∈ powers x :=
theorem powers.self_mem {x : M} : x ∈ powers x :=
⟨1, pow_one _⟩
#align powers.self_mem powers.self_mem
+#align multiples.self_mem multiples.self_mem
/-- The set of natural number powers of an element of a monoid is closed under multiplication. -/
@[to_additive
@@ -148,6 +154,7 @@ theorem powers.self_mem {x : M} : x ∈ powers x :=
theorem powers.mul_mem {x y z : M} : y ∈ powers x → z ∈ powers x → y * z ∈ powers x :=
fun ⟨n₁, h₁⟩ ⟨n₂, h₂⟩ => ⟨n₁ + n₂, by simp only [pow_add, *]⟩
#align powers.mul_mem powers.mul_mem
+#align multiples.add_mem multiples.add_mem
/-- The set of natural number powers of an element of a monoid `M` is a submonoid of `M`. -/
@[to_additive
@@ -157,11 +164,13 @@ theorem powers.is_submonoid (x : M) : IsSubmonoid (powers x) :=
{ one_mem := powers.one_mem
mul_mem := @fun _ _ => powers.mul_mem }
#align powers.is_submonoid powers.is_submonoid
+#align multiples.is_add_submonoid multiples.is_addSubmonoid
/-- A monoid is a submonoid of itself. -/
@[to_additive "An `add_monoid` is an `add_submonoid` of itself."]
theorem Univ.IsSubmonoid : IsSubmonoid (@Set.univ M) := by constructor <;> simp
#align univ.is_submonoid Univ.IsSubmonoid
+#align univ.is_add_submonoid Univ.IsAddSubmonoid
/-- The preimage of a submonoid under a monoid hom is a submonoid of the domain. -/
@[to_additive
@@ -173,6 +182,7 @@ theorem IsSubmonoid.preimage {N : Type _} [Monoid N] {f : M → N} (hf : IsMonoi
mul_mem := @fun a b (ha : f a ∈ s) (hb : f b ∈ s) =>
show f (a * b) ∈ s by (rw [IsMonoidHom.map_mul' hf]; exact hs.mul_mem ha hb) }
#align is_submonoid.preimage IsSubmonoid.preimage
+#align is_add_submonoid.preimage IsAddSubmonoid.preimage
/-- The image of a submonoid under a monoid hom is a submonoid of the codomain. -/
@[to_additive
@@ -184,6 +194,7 @@ theorem IsSubmonoid.image {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMonoi
mul_mem := @fun a b ⟨x, hx⟩ ⟨y, hy⟩ =>
⟨x * y, hs.mul_mem hx.1 hy.1, by rw [hf.map_mul, hx.2, hy.2]⟩ }
#align is_submonoid.image IsSubmonoid.image
+#align is_add_submonoid.image IsAddSubmonoid.image
/-- The image of a monoid hom is a submonoid of the codomain. -/
@[to_additive "The image of an `AddMonoid` hom is an `AddSubmonoid` of the codomain."]
@@ -192,6 +203,7 @@ theorem Range.is_submonoid {γ : Type _} [Monoid γ] {f : M → γ} (hf : IsMono
rw [← Set.image_univ]
exact Univ.IsSubmonoid.image hf
#align range.is_submonoid Range.is_submonoid
+#align range.is_add_submonoid Range.is_addSubmonoid
/-- Submonoids are closed under natural powers. -/
@[to_additive
@@ -212,6 +224,7 @@ theorem IsSubmonoid.pow_mem {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : ∀ {n
theorem IsSubmonoid.power_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : powers a ⊆ s :=
fun _ ⟨_, hx⟩ => hx ▸ hs.pow_mem h
#align is_submonoid.power_subset IsSubmonoid.power_subset
+#align is_add_submonoid.multiples_subset IsAddSubmonoid.multiples_subset
end powers
@@ -227,6 +240,7 @@ theorem list_prod_mem (hs : IsSubmonoid s) : ∀ {l : List M}, (∀ x ∈ l, x
have : a ∈ s ∧ ∀ x ∈ l, x ∈ s := by simpa using h
hs.mul_mem this.1 (list_prod_mem hs this.2)
#align is_submonoid.list_prod_mem IsSubmonoid.list_prod_mem
+#align is_add_submonoid.list_sum_mem IsAddSubmonoid.list_sum_mem
/-- The product of a multiset of elements of a submonoid of a `CommMonoid` is an element of
the submonoid. -/
@@ -239,6 +253,7 @@ theorem multiset_prod_mem {M} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (m
rw [Multiset.quot_mk_to_coe, Multiset.coe_prod]
exact list_prod_mem hs hl
#align is_submonoid.multiset_prod_mem IsSubmonoid.multiset_prod_mem
+#align is_add_submonoid.multiset_sum_mem IsAddSubmonoid.multiset_sum_mem
/-- The product of elements of a submonoid of a `comm_monoid` indexed by a `finset` is an element
of the submonoid. -/
@@ -249,6 +264,7 @@ theorem finset_prod_mem {M A} [CommMonoid M] {s : Set M} (hs : IsSubmonoid s) (f
∀ t : Finset A, (∀ b ∈ t, f b ∈ s) → (∏ b in t, f b) ∈ s
| ⟨m, hm⟩, _ => multiset_prod_mem hs _ (by simpa)
#align is_submonoid.finset_prod_mem IsSubmonoid.finset_prod_mem
+#align is_add_submonoid.finset_sum_mem IsAddSubmonoid.finset_sum_mem
end IsSubmonoid
@@ -290,12 +306,14 @@ theorem closure.IsSubmonoid (s : Set M) : IsSubmonoid (Closure s) :=
{ one_mem := InClosure.one
mul_mem := @fun _ _ => InClosure.mul }
#align monoid.closure.is_submonoid Monoid.closure.IsSubmonoid
+#align add_monoid.closure.is_add_submonoid AddMonoid.closure.IsAddSubmonoid
/-- A subset of a monoid is contained in the submonoid it generates. -/
@[to_additive
"A subset of an `AddMonoid` is contained in the `AddSubmonoid` it generates."]
theorem subset_closure {s : Set M} : s ⊆ Closure s := fun _ => InClosure.basic
#align monoid.subset_closure Monoid.subset_closure
+#align add_monoid.subset_closure AddMonoid.subset_closure
/-- The submonoid generated by a set is contained in any submonoid that contains the set. -/
@[to_additive
@@ -304,6 +322,7 @@ theorem subset_closure {s : Set M} : s ⊆ Closure s := fun _ => InClosure.basic
theorem closure_subset {s t : Set M} (ht : IsSubmonoid t) (h : s ⊆ t) : Closure s ⊆ t := fun a ha =>
by induction ha <;> simp [h _, *, IsSubmonoid.one_mem, IsSubmonoid.mul_mem]
#align monoid.closure_subset Monoid.closure_subset
+#align add_monoid.closure_subset AddMonoid.closure_subset
/-- Given subsets `t` and `s` of a monoid `M`, if `s ⊆ t`, the submonoid of `M` generated by `s` is
contained in the submonoid generated by `t`. -/
@@ -313,6 +332,7 @@ theorem closure_subset {s t : Set M} (ht : IsSubmonoid t) (h : s ⊆ t) : Closur
theorem closure_mono {s t : Set M} (h : s ⊆ t) : Closure s ⊆ Closure t :=
closure_subset (closure.IsSubmonoid t) <| Set.Subset.trans h subset_closure
#align monoid.closure_mono Monoid.closure_mono
+#align add_monoid.closure_mono AddMonoid.closure_mono
/-- The submonoid generated by an element of a monoid equals the set of natural number powers of
the element. -/
@@ -325,6 +345,7 @@ theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x :=
IsSubmonoid.power_subset (closure.IsSubmonoid _) <|
Set.singleton_subset_iff.1 <| subset_closure
#align monoid.closure_singleton Monoid.closure_singleton
+#align add_monoid.closure_singleton AddMonoid.closure_singleton
/-- The image under a monoid hom of the submonoid generated by a set equals the submonoid generated
by the image of the set under the monoid hom. -/
@@ -345,6 +366,7 @@ theorem image_closure {A : Type _} [Monoid A] {f : M → A} (hf : IsMonoidHom f)
(closure_subset (IsSubmonoid.image hf (closure.IsSubmonoid _)) <|
Set.image_subset _ subset_closure)
#align monoid.image_closure Monoid.image_closure
+#align add_monoid.image_closure AddMonoid.image_closure
/-- Given an element `a` of the submonoid of a monoid `M` generated by a set `s`, there exists
a list of elements of `s` whose product is `a`. -/
@@ -363,6 +385,7 @@ theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
simp [eqa.symm, eqb.symm, or_imp]
exact fun a => ⟨ha a, hb a⟩
#align monoid.exists_list_of_mem_closure Monoid.exists_list_of_mem_closure
+#align add_monoid.exists_list_of_mem_closure AddMonoid.exists_list_of_mem_closure
/-- Given sets `s, t` of a commutative monoid `M`, `x ∈ M` is in the submonoid of `M` generated by
`s ∪ t` iff there exists an element of the submonoid generated by `s` and an element of the
@@ -394,6 +417,7 @@ theorem mem_closure_union_iff {M : Type _} [CommMonoid M] {s t : Set M} {x : M}
(closure.IsSubmonoid _).mul_mem (closure_mono (Set.subset_union_left _ _) hy)
(closure_mono (Set.subset_union_right _ _) hz)⟩
#align monoid.mem_closure_union_iff Monoid.mem_closure_union_iff
+#align add_monoid.mem_closure_union_iff AddMonoid.mem_closure_union_iff
end Monoid
@@ -402,8 +426,10 @@ end Monoid
def Submonoid.of {s : Set M} (h : IsSubmonoid s) : Submonoid M :=
⟨⟨s, @fun _ _ => h.2⟩, h.1⟩
#align submonoid.of Submonoid.of
+#align add_submonoid.of AddSubmonoid.of
@[to_additive]
theorem Submonoid.is_submonoid (S : Submonoid M) : IsSubmonoid (S : Set M) := by
refine' ⟨S.2, S.1.2⟩
#align submonoid.is_submonoid Submonoid.is_submonoid
+#align add_submonoid.is_add_submonoid AddSubmonoid.is_addSubmonoid
The unported dependencies are