Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2022 Jireh Loreaux. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Jireh Loreaux | |
-/ | |
import group_theory.subsemigroup.operations | |
/-! | |
# Subsemigroups: membership criteria | |
In this file we prove various facts about membership in a subsemigroup. | |
The intent is to mimic `group_theory/submonoid/membership`, but currently this file is mostly a | |
stub and only provides rudimentary support. | |
* `mem_supr_of_directed`, `coe_supr_of_directed`, `mem_Sup_of_directed_on`, | |
`coe_Sup_of_directed_on`: the supremum of a directed collection of subsemigroup is their union. | |
## TODO | |
* Define the `free_semigroup` generated by a set. This might require some rather substantial | |
additions to low-level API. For example, developing the subtype of nonempty lists, then defining | |
a product on nonempty lists, powers where the exponent is a positive natural, et cetera. | |
Another option would be to define the `free_semigroup` as the subsemigroup (pushed to be a | |
semigroup) of the `free_monoid` consisting of non-identity elements. | |
## Tags | |
subsemigroup | |
-/ | |
variables {ΞΉ : Sort*} {M A B : Type*} | |
section non_assoc | |
variables [has_mul M] | |
open set | |
namespace subsemigroup | |
-- TODO: this section can be generalized to `[mul_mem_class B M] [complete_lattice B]` | |
-- such that `complete_lattice.le` coincides with `set_like.le` | |
@[to_additive] | |
lemma mem_supr_of_directed {S : ΞΉ β subsemigroup M} (hS : directed (β€) S) {x : M} : | |
x β (β¨ i, S i) β β i, x β S i := | |
begin | |
refine β¨_, Ξ» β¨i, hiβ©, (set_like.le_def.1 $ le_supr S i) hiβ©, | |
suffices : x β closure (β i, (S i : set M)) β β i, x β S i, | |
by simpa only [closure_Union, closure_eq (S _)] using this, | |
refine (Ξ» hx, closure_induction hx (Ξ» y hy, mem_Union.mp hy) _), | |
{ rintros x y β¨i, hiβ© β¨j, hjβ©, | |
rcases hS i j with β¨k, hki, hkjβ©, | |
exact β¨k, (S k).mul_mem (hki hi) (hkj hj)β© } | |
end | |
@[to_additive] | |
lemma coe_supr_of_directed {S : ΞΉ β subsemigroup M} (hS : directed (β€) S) : | |
((β¨ i, S i : subsemigroup M) : set M) = β i, β(S i) := | |
set.ext $ Ξ» x, by simp [mem_supr_of_directed hS] | |
@[to_additive] | |
lemma mem_Sup_of_directed_on {S : set (subsemigroup M)} | |
(hS : directed_on (β€) S) {x : M} : | |
x β Sup S β β s β S, x β s := | |
by simp only [Sup_eq_supr', mem_supr_of_directed hS.directed_coe, set_coe.exists, subtype.coe_mk] | |
@[to_additive] | |
lemma coe_Sup_of_directed_on {S : set (subsemigroup M)} | |
(hS : directed_on (β€) S) : | |
(β(Sup S) : set M) = β s β S, βs := | |
set.ext $ Ξ» x, by simp [mem_Sup_of_directed_on hS] | |
@[to_additive] | |
lemma mem_sup_left {S T : subsemigroup M} : β {x : M}, x β S β x β S β T := | |
show S β€ S β T, from le_sup_left | |
@[to_additive] | |
lemma mem_sup_right {S T : subsemigroup M} : β {x : M}, x β T β x β S β T := | |
show T β€ S β T, from le_sup_right | |
@[to_additive] | |
lemma mul_mem_sup {S T : subsemigroup M} {x y : M} (hx : x β S) (hy : y β T) : x * y β S β T := | |
mul_mem (mem_sup_left hx) (mem_sup_right hy) | |
@[to_additive] | |
lemma mem_supr_of_mem {S : ΞΉ β subsemigroup M} (i : ΞΉ) : | |
β {x : M}, x β S i β x β supr S := | |
show S i β€ supr S, from le_supr _ _ | |
@[to_additive] | |
lemma mem_Sup_of_mem {S : set (subsemigroup M)} {s : subsemigroup M} | |
(hs : s β S) : β {x : M}, x β s β x β Sup S := | |
show s β€ Sup S, from le_Sup hs | |
/-- An induction principle for elements of `β¨ i, S i`. | |
If `C` holds all elements of `S i` for all `i`, and is preserved under multiplication, | |
then it holds for all elements of the supremum of `S`. -/ | |
@[elab_as_eliminator, to_additive /-" An induction principle for elements of `β¨ i, S i`. | |
If `C` holds all elements of `S i` for all `i`, and is preserved under addition, | |
then it holds for all elements of the supremum of `S`. "-/] | |
lemma supr_induction (S : ΞΉ β subsemigroup M) {C : M β Prop} {x : M} (hx : x β β¨ i, S i) | |
(hp : β i (x β S i), C x) | |
(hmul : β x y, C x β C y β C (x * y)) : C x := | |
begin | |
rw supr_eq_closure at hx, | |
refine closure_induction hx (Ξ» x hx, _) hmul, | |
obtain β¨i, hiβ© := set.mem_Union.mp hx, | |
exact hp _ _ hi, | |
end | |
/-- A dependent version of `subsemigroup.supr_induction`. -/ | |
@[elab_as_eliminator, to_additive /-"A dependent version of `add_subsemigroup.supr_induction`. "-/] | |
lemma supr_induction' (S : ΞΉ β subsemigroup M) {C : Ξ x, (x β β¨ i, S i) β Prop} | |
(hp : β i (x β S i), C x (mem_supr_of_mem i βΉ_βΊ)) | |
(hmul : β x y hx hy, C x hx β C y hy β C (x * y) (mul_mem βΉ_βΊ βΉ_βΊ)) | |
{x : M} (hx : x β β¨ i, S i) : C x hx := | |
begin | |
refine exists.elim _ (Ξ» (hx : x β β¨ i, S i) (hc : C x hx), hc), | |
refine supr_induction S hx (Ξ» i x hx, _) (Ξ» x y, _), | |
{ exact β¨_, hp _ _ hxβ© }, | |
{ rintro β¨_, Cxβ© β¨_, Cyβ©, | |
exact β¨_, hmul _ _ _ _ Cx Cyβ© }, | |
end | |
end subsemigroup | |
end non_assoc | |