1-- Restricting a group action to an invariant subset Y ⊆ X: the restricted2-- graph is an action of G on Y with the same values3-- Part of Cumulus, the Grace17 mathematics library.4-- Copyright (c) 2026 Grant Passmore.5-- Released under the Apache License 2.0. See LICENSE in the repository root.6-- Authors: Grant Passmore78module Grace.Cumulus.Algebra.Group.Action.Restrict9import Algebra.Group.Action1011-- The action graph restricted to the pairs (g, y) with y ∈ Y.12def restrictAction (act G Y : Set) : Set:= restrict(act, G.carrier × Y)1314section Restriction15variable (act G X : Set)16hypothesis action : act : G ↷ X1718theorem restrictAction.function (Y : Set)19requires subset : Y ⊆ X20requires invariant : ∀ g ∈ G.carrier, ∀ y ∈ Y, g ·ₐ y ∈ Y21shows restrictAction(act, G, Y) : G.carrier × Y → Y22proof23have function := Action.function with action24have same := Subset.reflexive at G.carrier25have pairs : G.carrier × Y ⊆ G.carrier × X :=26 product.monotone with same, subset27have closed : ∀ p ∈ G.carrier × Y, act(p) ∈ Y28intros p hp29obtain⟨bound, g, hg, y, hy, shape⟩:=30 product.membership.forward with hp31have moved := invariant with g, hg, y, hy32rw shape33unfold call2 at moved34exact moved35unfold restrictAction36exact restrict.function with function, pairs, closed3738-- The values of the restriction need no invariance of Y.39theorem restrictAction.value (Y g y : Set)40requires subset : Y ⊆ X41requires hg : g ∈ G.carrier42requires hy : y ∈ Y43shows call2(restrictAction(act, G, Y), g, y) = g ·ₐ y44proof45have function := Action.function with action46have same := Subset.reflexive at G.carrier47have pairs : G.carrier × Y ⊆ G.carrier × X :=48 product.monotone with same, subset49have pair := product.pair at g, y, G.carrier, Y with*50have value := restrict.domain_apply at act, G.carrier × X, X,51 G.carrier × Y, (g, y) with function, pairs, pair52simp [restrictAction, call2]5354theorem restrictAction.apply (Y g y : Set)55requires subset : Y ⊆ X56requires invariant : ∀ g ∈ G.carrier, ∀ y ∈ Y, g ·ₐ y ∈ Y57requires hg : g ∈ G.carrier58requires hy : y ∈ Y59shows call2(restrictAction(act, G, Y), g, y) = g ·ₐ y60proof61exact restrictAction.value with action, subset, hg, hy6263theorem restrictAction.action (Y : Set)64requires subset : Y ⊆ X65requires invariant : ∀ g ∈ G.carrier, ∀ y ∈ Y, g ·ₐ y ∈ Y66shows restrictAction(act, G, Y) : G ↷ Y67proof68have group := Action.group with action69have function := restrictAction.function with action, subset, invariant70apply Action.mk with group, function71 . intros y hy72have unitIn : G.one ∈ G.carrier := Group.one_mem with group73have yIn := subset with y, hy74have value := restrictAction.apply with75 action, subset, invariant, unitIn, hy76rw value77exact one_act with action, yIn78 . intros g hg h hh y hy79have yIn := subset with y, hy80have productIn : g * h ∈ G.carrier := Group.mul_mem with group, hg, hh81have moved := invariant with h, hh, y, hy82have outer := restrictAction.apply with83 action, subset, invariant, productIn, hy84have inner := restrictAction.apply with action, subset, invariant, hh, hy85have composed := restrictAction.apply with86 action, subset, invariant, hg, moved87rw [outer, inner, composed]88exact mul_act with action, yIn8990end Restriction91