[STATEMENT]
lemma (in PolynRg) P_mod_diffxxx5_3:"\<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>;
  maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R;
  g \<in> carrier R; h \<in> carrier R;
  deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
      (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g);
  deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R'
                (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f;
  0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
              (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g);
  0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
              (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h);
  rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
    (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g)
    (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h);
  P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a (g \<cdot>\<^sub>r h))\<rbrakk> \<Longrightarrow>
  P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) ((fst (Hpr\<^bsub>R S X t R' Y f g h\<^esub> m)) \<plusminus>
                                -\<^sub>a (fst (Hpr\<^bsub>R S X t R' Y f g h\<^esub> (m + n)))) \<and>
  P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) ((snd (Hpr\<^bsub>R S X t R' Y f g h\<^esub> m)) \<plusminus>
                                -\<^sub>a (snd (Hpr\<^bsub>R S X t R' Y f g h\<^esub> (m + n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h)\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))
[PROOF STEP]
apply (cut_tac ring_is_ag,
       cut_tac subring, frule subring_Ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + 0))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + 0)))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (simp del:npow_suc Hpr_Suc)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m)) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (frule P_mod_diffxxx5_2[of t R' Y f g h m], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m)) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (frule cart_prod_fst[of "Hpr\<^bsub> R S X t R' Y f g h\<^esub> m" "carrier R" "carrier R"],
        frule cart_prod_snd[of "Hpr\<^bsub> R S X t R' Y f g h\<^esub> m" "carrier R" "carrier R"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m)) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (simp add:aGroup.ag_r_inv1, simp add:P_mod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (frule_tac m = "m + n" in P_mod_diffxxx5_1[of t R' Y f g h],
        assumption+, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) = erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (g, h)); erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) = erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (snd (g, h)); deg R S X (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); deg R S X (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))) \<le> deg R S X f; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (Suc (m + n))\<^esup>)) (f \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<cdot>\<^sub>r snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (frule_tac m = m in P_mod_diffxxx5_2[of t R' Y f g h], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) = erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (g, h)); erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) = erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (snd (g, h)); deg R S X (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); deg R S X (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))) \<le> deg R S X f; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (Suc (m + n))\<^esup>)) (f \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<cdot>\<^sub>r snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (frule_tac m = "m + n" in P_mod_diffxxx5_2[of t R' Y f g h], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; deg R S X g \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f; 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g); 0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h); P_mod R S X (S \<diamondsuit>\<^sub>p t) (f \<plusminus> -\<^sub>a g \<cdot>\<^sub>r h); aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) = erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (g, h)); erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) = erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (snd (g, h)); deg R S X (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); deg R S X (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))) \<le> deg R S X f; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (Suc (m + n))\<^esup>)) (f \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<cdot>\<^sub>r snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (thin_tac "deg R S X g
           \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
              (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g)",
       thin_tac "deg R S X h + deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
          (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g) \<le> deg R S X f",
       thin_tac "0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
              (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g)",
       thin_tac "0 < deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
              (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h)",
       thin_tac "rel_prime_pols R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
          (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) g)
          (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) h)",
       thin_tac "P_mod R S X (S \<diamondsuit>\<^sub>p t) ( f \<plusminus> -\<^sub>a (g \<cdot>\<^sub>r h))",
       thin_tac "erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t))
                            (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) =
         erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t)) (fst (g, h))",
       thin_tac "erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t))
                 (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) =
                  erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t))
          (snd (g, h))",
       thin_tac "deg R S X (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
          \<le> deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y
            (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t))
                      (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))))",
      thin_tac "deg R S X (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) +
      deg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (erH R S X R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y (pj S (S \<diamondsuit>\<^sub>p t))
           (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))) \<le> deg R S X f",
      thin_tac "P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S (Suc (Suc (m + n)))\<^esup>))
          (f \<plusminus>  -\<^sub>a (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<cdot>\<^sub>r
                      snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))))")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + Suc n)))
[PROOF STEP]
apply (simp del:npow_suc Hpr_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (frule_tac x = "Hpr\<^bsub> R S X t R' Y f g h\<^esub> m" in
          cart_prod_fst[of _ "carrier R" "carrier R"],
       frule_tac x = "Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)" in
          cart_prod_fst[of _ "carrier R" "carrier R"],
       frule_tac x = "Hpr\<^bsub> R S X t R' Y f g h\<^esub> (Suc (m + n))" in
          cart_prod_fst[of _ "carrier R" "carrier R"],
       frule_tac x = "Hpr\<^bsub> R S X t R' Y f g h\<^esub> m" in
          cart_prod_snd[of _ "carrier R" "carrier R"],
       frule_tac x = "Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)" in
          cart_prod_snd[of _ "carrier R" "carrier R"],
       frule_tac x = "Hpr\<^bsub> R S X t R' Y f g h\<^esub> (Suc (m + n))" in
          cart_prod_snd[of _ "carrier R" "carrier R"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (case_tac "m = 0", simp del:npow_suc Hpr_Suc)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p 1\<^sub>r\<^bsub>S\<^esub>) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); P_mod R S X (S \<diamondsuit>\<^sub>p 1\<^sub>r\<^bsub>S\<^esub>) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> n \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; m = 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p 1\<^sub>r\<^bsub>S\<^esub>) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p 1\<^sub>r\<^bsub>S\<^esub>) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (simp only:Ring.Rxa_one)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (carrier S) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> n \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; m = 0\<rbrakk> \<Longrightarrow> P_mod R S X (carrier S) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)) \<and> P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (carrier S) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> n \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; m = 0\<rbrakk> \<Longrightarrow> P_mod R S X (carrier S) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (carrier S) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> n \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; m = 0\<rbrakk> \<Longrightarrow> P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n))
 3. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (rule_tac p = "g \<plusminus> -\<^sub>a (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (Suc n)))" in
       P_mod_whole,
       rule aGroup.ag_pOp_closed, assumption+,
       rule aGroup.ag_mOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (carrier S) (g \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc n\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n)); Hpr\<^bsub> R S X t R' Y f g h\<^esub> n \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> n) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n) \<in> carrier R; m = 0\<rbrakk> \<Longrightarrow> P_mod R S X (carrier S) (h \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc n))
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (rule_tac p = "h \<plusminus> -\<^sub>a (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (Suc n)))" in
       P_mod_whole,
       rule aGroup.ag_pOp_closed, assumption+,
       rule aGroup.ag_mOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (frule_tac g = "fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus>
     -\<^sub>a (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))" and n = "m + n" in
     P_mod_n_m[of t _ "m - Suc 0"], assumption+)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> m - Suc 0 \<le> m + n
 3. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
 4. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; m \<noteq> 0; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m - Suc 0)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (rule aGroup.ag_pOp_closed, assumption+, rule aGroup.ag_mOp_closed,
       assumption+,
       arith,
       simp del:npow_suc Hpr_Suc, simp del:npow_suc Hpr_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (frule Ring.npClose[of S t m], assumption,
       frule Ring.principal_ideal[of S "t^\<^bsup>S m\<^esup>"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))) \<and> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (frule_tac p = "fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus>
           -\<^sub>a (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))" and
       q = "fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus>
           -\<^sub>a (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))" in
       P_mod_add[of "S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)"],
      (rule aGroup.ag_pOp_closed, assumption+,
             rule aGroup.ag_mOp_closed, assumption+)+,
      simp del:npow_suc Hpr_Suc add:aGroup.pOp_assoc_cancel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (frule_tac g = "snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus>
     -\<^sub>a (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))" and n = "m + n" in
     P_mod_n_m[of t _ "m - Suc 0"], assumption+)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R
 2. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> m - Suc 0 \<le> m + n
 3. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
 4. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m - Suc 0)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (rule aGroup.ag_pOp_closed, assumption+, rule aGroup.ag_mOp_closed,
       assumption+,
       arith,
       simp del:npow_suc Hpr_Suc, simp del:npow_suc Hpr_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; t \<in> carrier S; t \<noteq> \<zero>\<^bsub>S\<^esub>; maximal_ideal S (S \<diamondsuit>\<^sub>p t); PolynRg R' (S /\<^sub>r (S \<diamondsuit>\<^sub>p t)) Y; f \<in> carrier R; g \<in> carrier R; h \<in> carrier R; aGroup R; Subring R S; Ring S; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n) \<in> carrier R \<times> carrier R; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S Suc (m + n)\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); Hpr\<^bsub> R S X t R' Y f g h\<^esub> m \<in> carrier R \<times> carrier R; Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n) \<in> carrier R \<times> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<in> carrier R; snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)) \<in> carrier R; 0 < m; P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); t^\<^bsup>S m\<^esup> \<in> carrier S; ideal S (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a fst (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n))); P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))\<rbrakk> \<Longrightarrow> P_mod R S X (S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)) (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus> -\<^sub>a snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))
[PROOF STEP]
apply (frule_tac p = "snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> m) \<plusminus>
           -\<^sub>a (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)))" and
       q = "snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> (m + n)) \<plusminus>
           -\<^sub>a (snd (Hpr\<^bsub> R S X t R' Y f g h\<^esub> Suc (m + n)))" in
       P_mod_add[of "S \<diamondsuit>\<^sub>p (t^\<^bsup>S m\<^esup>)"],
      (rule aGroup.ag_pOp_closed, assumption+,
             rule aGroup.ag_mOp_closed, assumption+)+,
      simp del:npow_suc Hpr_Suc add:aGroup.pOp_assoc_cancel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma add_to_slots_assoc:
  "add_to_slots x (add_to_slots (y ++ z) obj) =
   add_to_slots (x ++ y) (add_to_slots z obj)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Separation_D.add_to_slots x (Abstract_Separation_D.add_to_slots (y ++ z) obj) = Abstract_Separation_D.add_to_slots (x ++ y) (Abstract_Separation_D.add_to_slots z obj)
[PROOF STEP]
apply (clarsimp simp: add_to_slots_def update_slots_def object_slots_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) of Endpoint \<Rightarrow> case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | Tcb xa \<Rightarrow> Tcb (xa\<lparr>cdl_tcb_caps := x ++ (case case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode xa \<Rightarrow> CNode (xa\<lparr>cdl_cnode_caps := x ++ (case case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := y ++ z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>)) = (case case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) of Endpoint \<Rightarrow> case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | Tcb xa \<Rightarrow> Tcb (xa\<lparr>cdl_tcb_caps := x ++ y ++ (case case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode xa \<Rightarrow> CNode (xa\<lparr>cdl_cnode_caps := x ++ y ++ (case case obj of Endpoint \<Rightarrow> obj | Tcb x \<Rightarrow> Tcb (x\<lparr>cdl_tcb_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) | CNode x \<Rightarrow> CNode (x\<lparr>cdl_cnode_caps := z ++ (case obj of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>) of Endpoint \<Rightarrow> Map.empty | Tcb x \<Rightarrow> cdl_tcb_caps x | CNode x \<Rightarrow> cdl_cnode_caps x)\<rparr>))
[PROOF STEP]
apply (fastforce simp: cdl_tcb.splits cdl_cnode.splits
                 split: cdl_object.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done