[STATEMENT]
theorem jordan_hoelder_multisets:
  assumes "group G"
  assumes "finite (carrier G)"
  assumes "composition_series G \<GG>"
  assumes "composition_series G \<HH>"
  shows "mset (map group.iso_class (normal_series.quotients G \<GG>))
    = mset (map group.iso_class (normal_series.quotients G \<HH>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>

goal (1 subgoal):
 1. mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
proof (induction "length \<GG>" arbitrary: \<GG> \<HH> G rule: full_nat_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<GG> \<HH> G. \<lbrakk>\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa)))); Group.group G; finite (carrier G); composition_series G \<GG>; composition_series G \<HH>\<rbrakk> \<Longrightarrow> mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
case (1 \<GG> \<HH> G)
[PROOF STATE]
proof (state)
this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>

goal (1 subgoal):
 1. \<And>\<GG> \<HH> G. \<lbrakk>\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa)))); Group.group G; finite (carrier G); composition_series G \<GG>; composition_series G \<HH>\<rbrakk> \<Longrightarrow> mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>
[PROOF STEP]
interpret comp\<GG>: composition_series G \<GG>
[PROOF STATE]
proof (prove)
using this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>

goal (1 subgoal):
 1. composition_series G \<GG>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<GG> \<HH> G. \<lbrakk>\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa)))); Group.group G; finite (carrier G); composition_series G \<GG>; composition_series G \<HH>\<rbrakk> \<Longrightarrow> mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>
[PROOF STEP]
interpret comp\<HH>: composition_series G \<HH>
[PROOF STATE]
proof (prove)
using this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>

goal (1 subgoal):
 1. composition_series G \<HH>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<GG> \<HH> G. \<lbrakk>\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa)))); Group.group G; finite (carrier G); composition_series G \<GG>; composition_series G \<HH>\<rbrakk> \<Longrightarrow> mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>
[PROOF STEP]
interpret grpG: group G
[PROOF STATE]
proof (prove)
using this:
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group G
finite (carrier G)
composition_series G \<GG>
composition_series G \<HH>

goal (1 subgoal):
 1. Group.group G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<GG> \<HH> G. \<lbrakk>\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa)))); Group.group G; finite (carrier G); composition_series G \<GG>; composition_series G \<HH>\<rbrakk> \<Longrightarrow> mset (map group.iso_class (normal_series.quotients G \<GG>)) = mset (map group.iso_class (normal_series.quotients G \<HH>))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
proof (cases "length \<GG> \<le> 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
length \<GG> \<le> 2

goal (2 subgoals):
 1. length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence  "length \<GG> = 0 \<or> length \<GG> = 1 \<or> length \<GG> = 2"
[PROOF STATE]
proof (prove)
using this:
length \<GG> \<le> 2

goal (1 subgoal):
 1. length \<GG> = 0 \<or> length \<GG> = 1 \<or> length \<GG> = 2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
length \<GG> = 0 \<or> length \<GG> = 1 \<or> length \<GG> = 2

goal (2 subgoals):
 1. length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
with comp\<GG>.notempty
[PROOF STATE]
proof (chain)
picking this:
\<GG> \<noteq> []
length \<GG> = 0 \<or> length \<GG> = 1 \<or> length \<GG> = 2
[PROOF STEP]
have  "length \<GG> = 1 \<or> length \<GG> = 2"
[PROOF STATE]
proof (prove)
using this:
\<GG> \<noteq> []
length \<GG> = 0 \<or> length \<GG> = 1 \<or> length \<GG> = 2

goal (1 subgoal):
 1. length \<GG> = 1 \<or> length \<GG> = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length \<GG> = 1 \<or> length \<GG> = 2

goal (2 subgoals):
 1. length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length \<GG> = 1 \<or> length \<GG> = 2

goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
proof (auto simp del: mset_map)
      \<comment> \<open>First trivial case: @{text \<GG>} is the trivial group.\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
assume "length \<GG> = Suc 0"
[PROOF STATE]
proof (state)
this:
length \<GG> = Suc 0

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length:"length \<GG> = 1"
[PROOF STATE]
proof (prove)
using this:
length \<GG> = Suc 0

goal (1 subgoal):
 1. length \<GG> = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length \<GG> = 1

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "length [] + 1 = length \<GG>"
[PROOF STATE]
proof (prove)
using this:
length \<GG> = 1

goal (1 subgoal):
 1. length [] + 1 = length \<GG>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length [] + 1 = length \<GG>

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length [] + 1 = length \<GG>

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from length
[PROOF STATE]
proof (chain)
picking this:
length \<GG> = 1
[PROOF STEP]
have char\<GG>:"\<GG> = [{\<one>\<^bsub>G\<^esub>}]"
[PROOF STATE]
proof (prove)
using this:
length \<GG> = 1

goal (1 subgoal):
 1. \<GG> = [{\<one>\<^bsub>G\<^esub>}]
[PROOF STEP]
by (metis comp\<GG>.composition_series_length_one)
[PROOF STATE]
proof (state)
this:
\<GG> = [{\<one>\<^bsub>G\<^esub>}]

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "carrier G = {\<one>\<^bsub>G\<^esub>}"
[PROOF STATE]
proof (prove)
using this:
\<GG> = [{\<one>\<^bsub>G\<^esub>}]

goal (1 subgoal):
 1. carrier G = {\<one>\<^bsub>G\<^esub>}
[PROOF STEP]
by (metis comp\<GG>.composition_series_triv_group)
[PROOF STATE]
proof (state)
this:
carrier G = {\<one>\<^bsub>G\<^esub>}

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
with length char\<GG>
[PROOF STATE]
proof (chain)
picking this:
length \<GG> = 1
\<GG> = [{\<one>\<^bsub>G\<^esub>}]
carrier G = {\<one>\<^bsub>G\<^esub>}
[PROOF STEP]
have "\<GG> = \<HH>"
[PROOF STATE]
proof (prove)
using this:
length \<GG> = 1
\<GG> = [{\<one>\<^bsub>G\<^esub>}]
carrier G = {\<one>\<^bsub>G\<^esub>}

goal (1 subgoal):
 1. \<GG> = \<HH>
[PROOF STEP]
using comp\<HH>.composition_series_triv_group
[PROOF STATE]
proof (prove)
using this:
length \<GG> = 1
\<GG> = [{\<one>\<^bsub>G\<^esub>}]
carrier G = {\<one>\<^bsub>G\<^esub>}
(carrier G = {\<one>\<^bsub>G\<^esub>}) = (\<HH> = [{\<one>\<^bsub>G\<^esub>}])

goal (1 subgoal):
 1. \<GG> = \<HH>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<GG> = \<HH>

goal (2 subgoals):
 1. length \<GG> = Suc 0 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<GG> = \<HH>

goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
next
      \<comment> \<open>Second trivial case: @{text \<GG>} is simple.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
assume "length \<GG> = 2"
[PROOF STATE]
proof (state)
this:
length \<GG> = 2

goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence \<GG>char:"\<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G]"
[PROOF STATE]
proof (prove)
using this:
length \<GG> = 2

goal (1 subgoal):
 1. \<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G]
[PROOF STEP]
by (metis comp\<GG>.length_two_unique)
[PROOF STATE]
proof (state)
this:
\<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence simple:"simple_group G"
[PROOF STATE]
proof (prove)
using this:
\<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. simple_group G
[PROOF STEP]
by (metis comp\<GG>.composition_series_simple_group)
[PROOF STATE]
proof (state)
this:
simple_group G

goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "\<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]"
[PROOF STATE]
proof (prove)
using this:
simple_group G

goal (1 subgoal):
 1. \<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]
[PROOF STEP]
using comp\<HH>.composition_series_simple_group
[PROOF STATE]
proof (prove)
using this:
simple_group G
simple_group G = (\<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G])

goal (1 subgoal):
 1. \<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
with \<GG>char
[PROOF STATE]
proof (chain)
picking this:
\<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G]
\<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]
[PROOF STEP]
have "\<GG> = \<HH>"
[PROOF STATE]
proof (prove)
using this:
\<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G]
\<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. \<GG> = \<HH>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<GG> = \<HH>

goal (1 subgoal):
 1. length \<GG> = 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<GG> = \<HH>

goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
case False
    \<comment> \<open>Non-trivial case: @{text \<GG>} has length at least 3.\<close>
[PROOF STATE]
proof (state)
this:
\<not> length \<GG> \<le> 2

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length:"length \<GG> \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
\<not> length \<GG> \<le> 2

goal (1 subgoal):
 1. 3 \<le> length \<GG>
[PROOF STEP]
by simp
    \<comment> \<open>First we show that @{text \<HH>} must have a length of at least 3.\<close>
[PROOF STATE]
proof (state)
this:
3 \<le> length \<GG>

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "\<not> simple_group G"
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>

goal (1 subgoal):
 1. \<not> simple_group G
[PROOF STEP]
using comp\<GG>.composition_series_simple_group
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>
simple_group G = (\<GG> = [{\<one>\<^bsub>G\<^esub>}, carrier G])

goal (1 subgoal):
 1. \<not> simple_group G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> simple_group G

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "\<HH> \<noteq> [{\<one>\<^bsub>G\<^esub>}, carrier G]"
[PROOF STATE]
proof (prove)
using this:
\<not> simple_group G

goal (1 subgoal):
 1. \<HH> \<noteq> [{\<one>\<^bsub>G\<^esub>}, carrier G]
[PROOF STEP]
using comp\<HH>.composition_series_simple_group
[PROOF STATE]
proof (prove)
using this:
\<not> simple_group G
simple_group G = (\<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G])

goal (1 subgoal):
 1. \<HH> \<noteq> [{\<one>\<^bsub>G\<^esub>}, carrier G]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> \<noteq> [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "length \<HH> \<noteq> 2"
[PROOF STATE]
proof (prove)
using this:
\<HH> \<noteq> [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. length \<HH> \<noteq> 2
[PROOF STEP]
using comp\<HH>.length_two_unique
[PROOF STATE]
proof (prove)
using this:
\<HH> \<noteq> [{\<one>\<^bsub>G\<^esub>}, carrier G]
length \<HH> = 2 \<Longrightarrow> \<HH> = [{\<one>\<^bsub>G\<^esub>}, carrier G]

goal (1 subgoal):
 1. length \<HH> \<noteq> 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length \<HH> \<noteq> 2

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length \<HH> \<noteq> 2

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from length
[PROOF STATE]
proof (chain)
picking this:
3 \<le> length \<GG>
[PROOF STEP]
have "carrier G \<noteq> {\<one>\<^bsub>G\<^esub>}"
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>

goal (1 subgoal):
 1. carrier G \<noteq> {\<one>\<^bsub>G\<^esub>}
[PROOF STEP]
using comp\<GG>.composition_series_length_one comp\<GG>.composition_series_triv_group
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>
(length \<GG> = 1) = (\<GG> = [{\<one>\<^bsub>G\<^esub>}])
(carrier G = {\<one>\<^bsub>G\<^esub>}) = (\<GG> = [{\<one>\<^bsub>G\<^esub>}])

goal (1 subgoal):
 1. carrier G \<noteq> {\<one>\<^bsub>G\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
carrier G \<noteq> {\<one>\<^bsub>G\<^esub>}

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "length \<HH> \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
carrier G \<noteq> {\<one>\<^bsub>G\<^esub>}

goal (1 subgoal):
 1. length \<HH> \<noteq> 1
[PROOF STEP]
using comp\<HH>.composition_series_length_one comp\<HH>.composition_series_triv_group
[PROOF STATE]
proof (prove)
using this:
carrier G \<noteq> {\<one>\<^bsub>G\<^esub>}
(length \<HH> = 1) = (\<HH> = [{\<one>\<^bsub>G\<^esub>}])
(carrier G = {\<one>\<^bsub>G\<^esub>}) = (\<HH> = [{\<one>\<^bsub>G\<^esub>}])

goal (1 subgoal):
 1. length \<HH> \<noteq> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length \<HH> \<noteq> 1

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length \<HH> \<noteq> 1

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from comp\<HH>.notempty
[PROOF STATE]
proof (chain)
picking this:
\<HH> \<noteq> []
[PROOF STEP]
have "length \<HH> \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<HH> \<noteq> []

goal (1 subgoal):
 1. length \<HH> \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length \<HH> \<noteq> 0

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length \<HH> \<noteq> 2
length \<HH> \<noteq> 1
length \<HH> \<noteq> 0
[PROOF STEP]
have length\<HH>big:"length \<HH> \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
length \<HH> \<noteq> 2
length \<HH> \<noteq> 1
length \<HH> \<noteq> 0

goal (1 subgoal):
 1. 3 \<le> length \<HH>
[PROOF STEP]
using comp\<HH>.notempty
[PROOF STATE]
proof (prove)
using this:
length \<HH> \<noteq> 2
length \<HH> \<noteq> 1
length \<HH> \<noteq> 0
\<HH> \<noteq> []

goal (1 subgoal):
 1. 3 \<le> length \<HH>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
3 \<le> length \<HH>

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define m where "m = length \<HH> - 1"
[PROOF STATE]
proof (state)
this:
m = length \<HH> - 1

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define n where "n = length \<GG> - 1"
[PROOF STATE]
proof (state)
this:
n = length \<GG> - 1

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from length\<HH>big
[PROOF STATE]
proof (chain)
picking this:
3 \<le> length \<HH>
[PROOF STEP]
have m':"m > 0" "m < length \<HH>" "(m - 1) + 1 < length \<HH>" "m - 1 = length \<HH> - 2" "m - 1 + 1 = length \<HH> - 1" "m - 1 < length \<HH>"
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>

goal (1 subgoal):
 1. (0 < m &&& m < length \<HH> &&& m - 1 + 1 < length \<HH>) &&& m - 1 = length \<HH> - 2 &&& m - 1 + 1 = length \<HH> - 1 &&& m - 1 < length \<HH>
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>

goal (1 subgoal):
 1. (0 < length \<HH> - 1 &&& length \<HH> - 1 < length \<HH> &&& length \<HH> - 1 - 1 + 1 < length \<HH>) &&& length \<HH> - 1 - 1 = length \<HH> - 2 &&& length \<HH> - 1 - 1 + 1 = length \<HH> - 1 &&& length \<HH> - 1 - 1 < length \<HH>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < m
m < length \<HH>
m - 1 + 1 < length \<HH>
m - 1 = length \<HH> - 2
m - 1 + 1 = length \<HH> - 1
m - 1 < length \<HH>

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from length
[PROOF STATE]
proof (chain)
picking this:
3 \<le> length \<GG>
[PROOF STEP]
have n':"n > 0" "n < length \<GG>" "(n - 1) + 1 < length \<GG>" "n - 1 < length \<GG>" "Suc n \<le> length \<GG>"
     "n - 1 = length \<GG> - 2" "n - 1 + 1 = length \<GG> - 1"
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>

goal (1 subgoal):
 1. (0 < n &&& n < length \<GG> &&& n - 1 + 1 < length \<GG>) &&& (n - 1 < length \<GG> &&& Suc n \<le> length \<GG>) &&& n - 1 = length \<GG> - 2 &&& n - 1 + 1 = length \<GG> - 1
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>

goal (1 subgoal):
 1. (0 < length \<GG> - 1 &&& length \<GG> - 1 < length \<GG> &&& length \<GG> - 1 - 1 + 1 < length \<GG>) &&& (length \<GG> - 1 - 1 < length \<GG> &&& Suc (length \<GG> - 1) \<le> length \<GG>) &&& length \<GG> - 1 - 1 = length \<GG> - 2 &&& length \<GG> - 1 - 1 + 1 = length \<GG> - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < n
n < length \<GG>
n - 1 + 1 < length \<GG>
n - 1 < length \<GG>
Suc n \<le> length \<GG>
n - 1 = length \<GG> - 2
n - 1 + 1 = length \<GG> - 1

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define \<GG>Pn where "\<GG>Pn = G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>"
[PROOF STATE]
proof (state)
this:
\<GG>Pn = G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define \<HH>Pm where "\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>"
[PROOF STATE]
proof (state)
this:
\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>
[PROOF STEP]
interpret grp\<GG>Pn: group \<GG>Pn
[PROOF STATE]
proof (prove)
using this:
\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>

goal (1 subgoal):
 1. Group.group \<GG>Pn
[PROOF STEP]
unfolding \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>)
[PROOF STEP]
using n'
[PROOF STATE]
proof (prove)
using this:
\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>
0 < n
n < length \<GG>
n - 1 + 1 < length \<GG>
n - 1 < length \<GG>
Suc n \<le> length \<GG>
n - 1 = length \<GG> - 2
n - 1 + 1 = length \<GG> - 1

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>)
[PROOF STEP]
by (metis comp\<GG>.normal_series_subgroups comp\<GG>.subgroup_imp_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret grp\<HH>Pm: group \<HH>Pm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group \<HH>Pm
[PROOF STEP]
unfolding \<HH>Pm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>)
[PROOF STEP]
using m' comp\<HH>.normal_series_subgroups 1(2) group.subgroup_imp_group
[PROOF STATE]
proof (prove)
using this:
0 < m
m < length \<HH>
m - 1 + 1 < length \<HH>
m - 1 = length \<HH> - 2
m - 1 + 1 = length \<HH> - 1
m - 1 < length \<HH>
?i < length \<HH> \<Longrightarrow> subgroup (\<HH> ! ?i) G
Group.group G
\<lbrakk>Group.group ?G; subgroup ?H ?G\<rbrakk> \<Longrightarrow> Group.group (?G\<lparr>carrier := ?H\<rparr>)

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have finGbl:"finite (carrier \<GG>Pn)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier \<GG>Pn)
[PROOF STEP]
using \<open>n - 1 < length \<GG>\<close> 1(3)
[PROOF STATE]
proof (prove)
using this:
n - 1 < length \<GG>
finite (carrier G)

goal (1 subgoal):
 1. finite (carrier \<GG>Pn)
[PROOF STEP]
unfolding \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
n - 1 < length \<GG>
finite (carrier G)

goal (1 subgoal):
 1. finite (carrier (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>))
[PROOF STEP]
using comp\<GG>.normal_series_subgroups comp\<GG>.subgroup_finite
[PROOF STATE]
proof (prove)
using this:
n - 1 < length \<GG>
finite (carrier G)
?i < length \<GG> \<Longrightarrow> subgroup (\<GG> ! ?i) G
\<lbrakk>subgroup ?H G; finite (carrier G)\<rbrakk> \<Longrightarrow> finite ?H

goal (1 subgoal):
 1. finite (carrier (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (carrier \<GG>Pn)

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have finHbl:"finite (carrier \<HH>Pm)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier \<HH>Pm)
[PROOF STEP]
using \<open>m - 1 < length \<HH>\<close> 1(3)
[PROOF STATE]
proof (prove)
using this:
m - 1 < length \<HH>
finite (carrier G)

goal (1 subgoal):
 1. finite (carrier \<HH>Pm)
[PROOF STEP]
unfolding \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
m - 1 < length \<HH>
finite (carrier G)

goal (1 subgoal):
 1. finite (carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>))
[PROOF STEP]
using comp\<HH>.normal_series_subgroups comp\<GG>.subgroup_finite
[PROOF STATE]
proof (prove)
using this:
m - 1 < length \<HH>
finite (carrier G)
?i < length \<HH> \<Longrightarrow> subgroup (\<HH> ! ?i) G
\<lbrakk>subgroup ?H G; finite (carrier G)\<rbrakk> \<Longrightarrow> finite ?H

goal (1 subgoal):
 1. finite (carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (carrier \<HH>Pm)

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have quots\<GG>notempty:"comp\<GG>.quotients \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp\<GG>.quotients \<noteq> []
[PROOF STEP]
using comp\<GG>.quotients_length length
[PROOF STATE]
proof (prove)
using this:
length comp\<GG>.quotients + 1 = length \<GG>
3 \<le> length \<GG>

goal (1 subgoal):
 1. comp\<GG>.quotients \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
comp\<GG>.quotients \<noteq> []

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have quots\<HH>notempty:"comp\<HH>.quotients \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp\<HH>.quotients \<noteq> []
[PROOF STEP]
using comp\<HH>.quotients_length length\<HH>big
[PROOF STATE]
proof (prove)
using this:
length comp\<HH>.quotients + 1 = length \<HH>
3 \<le> length \<HH>

goal (1 subgoal):
 1. comp\<HH>.quotients \<noteq> []
[PROOF STEP]
by auto

    \<comment> \<open>Instantiate truncated composition series since they are used for both cases\<close>
[PROOF STATE]
proof (state)
this:
comp\<HH>.quotients \<noteq> []

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<HH>butlast: composition_series \<HH>Pm "take m \<HH>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series \<HH>Pm (take m \<HH>)
[PROOF STEP]
using comp\<HH>.composition_series_prefix_closed m'(1,2) \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> length \<HH>; 0 < ?i\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := \<HH> ! (?i - 1)\<rparr>) (take ?i \<HH>)
0 < m
m < length \<HH>
\<HH>Pm = G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>

goal (1 subgoal):
 1. composition_series \<HH>Pm (take m \<HH>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<GG>butlast: composition_series \<GG>Pn "take n \<GG>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series \<GG>Pn (take n \<GG>)
[PROOF STEP]
using comp\<GG>.composition_series_prefix_closed n'(1,2) \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> length \<GG>; 0 < ?i\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := \<GG> ! (?i - 1)\<rparr>) (take ?i \<GG>)
0 < n
n < length \<GG>
\<GG>Pn = G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>

goal (1 subgoal):
 1. composition_series \<GG>Pn (take n \<GG>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have ltaken:"n = length (take n \<GG>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = length (take n \<GG>)
[PROOF STEP]
using length_take n'(2)
[PROOF STATE]
proof (prove)
using this:
length (take ?n ?xs) = min (length ?xs) ?n
n < length \<GG>

goal (1 subgoal):
 1. n = length (take n \<GG>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = length (take n \<GG>)

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have ltakem:"m = length (take m \<HH>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = length (take m \<HH>)
[PROOF STEP]
using length_take m'(2)
[PROOF STATE]
proof (prove)
using this:
length (take ?n ?xs) = min (length ?xs) ?n
m < length \<HH>

goal (1 subgoal):
 1. m = length (take m \<HH>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = length (take m \<HH>)

goal (1 subgoal):
 1. \<not> length \<GG> \<le> 2 \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
proof (cases "\<HH> ! (m - 1)  = \<GG> ! (n - 1)")
      \<comment> \<open>If @{term "\<HH> ! (l - 1) = \<GG> ! 1"}, everything is simple...\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
case True
      \<comment> \<open>The last quotients of @{term \<GG>} and @{term \<HH>} are equal.\<close>
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) = \<GG> ! (n - 1)

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have lasteq:"last comp\<GG>.quotients = last comp\<HH>.quotients"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
from length
[PROOF STATE]
proof (chain)
picking this:
3 \<le> length \<GG>
[PROOF STEP]
have lg:"length \<GG> - 1 - 1 + 1 = length \<GG> - 1"
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>

goal (1 subgoal):
 1. length \<GG> - 1 - 1 + 1 = length \<GG> - 1
[PROOF STEP]
by (metis Suc_diff_1 Suc_eq_plus1 n'(1) n_def)
[PROOF STATE]
proof (state)
this:
length \<GG> - 1 - 1 + 1 = length \<GG> - 1

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
from length\<HH>big
[PROOF STATE]
proof (chain)
picking this:
3 \<le> length \<HH>
[PROOF STEP]
have lh:"length \<HH> - 1 - 1 + 1 = length \<HH> - 1"
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>

goal (1 subgoal):
 1. length \<HH> - 1 - 1 + 1 = length \<HH> - 1
[PROOF STEP]
by (metis Suc_diff_1 Suc_eq_plus1 \<open>0 < m\<close> m_def)
[PROOF STATE]
proof (state)
this:
length \<HH> - 1 - 1 + 1 = length \<HH> - 1

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
have "last comp\<GG>.quotients =  G Mod \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last comp\<GG>.quotients = G Mod \<GG> ! (n - 1)
[PROOF STEP]
using length comp\<GG>.last_quotient
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>
1 < length \<GG> \<Longrightarrow> last comp\<GG>.quotients = G Mod \<GG> ! (length \<GG> - 1 - 1)

goal (1 subgoal):
 1. last comp\<GG>.quotients = G Mod \<GG> ! (n - 1)
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<GG>
1 < length \<GG> \<Longrightarrow> last comp\<GG>.quotients = G Mod \<GG> ! (length \<GG> - 1 - 1)

goal (1 subgoal):
 1. last comp\<GG>.quotients = G Mod \<GG> ! (length \<GG> - 1 - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
last comp\<GG>.quotients = G Mod \<GG> ! (n - 1)

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
last comp\<GG>.quotients = G Mod \<GG> ! (n - 1)

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
have "\<dots> = G Mod \<HH> ! (m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G Mod \<GG> ! (n - 1) = G Mod \<HH> ! (m - 1)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) = \<GG> ! (n - 1)

goal (1 subgoal):
 1. G Mod \<GG> ! (n - 1) = G Mod \<HH> ! (m - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
G Mod \<GG> ! (n - 1) = G Mod \<HH> ! (m - 1)

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
G Mod \<GG> ! (n - 1) = G Mod \<HH> ! (m - 1)

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
have "\<dots> = last comp\<HH>.quotients"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G Mod \<HH> ! (m - 1) = last comp\<HH>.quotients
[PROOF STEP]
using length\<HH>big comp\<HH>.last_quotient
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>
1 < length \<HH> \<Longrightarrow> last comp\<HH>.quotients = G Mod \<HH> ! (length \<HH> - 1 - 1)

goal (1 subgoal):
 1. G Mod \<HH> ! (m - 1) = last comp\<HH>.quotients
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>
1 < length \<HH> \<Longrightarrow> last comp\<HH>.quotients = G Mod \<HH> ! (length \<HH> - 1 - 1)

goal (1 subgoal):
 1. G Mod \<HH> ! (length \<HH> - 1 - 1) = last comp\<HH>.quotients
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
G Mod \<HH> ! (m - 1) = last comp\<HH>.quotients

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
last comp\<GG>.quotients = last comp\<HH>.quotients

goal (1 subgoal):
 1. last comp\<GG>.quotients = last comp\<HH>.quotients
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
last comp\<GG>.quotients = last comp\<HH>.quotients

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
last comp\<GG>.quotients = last comp\<HH>.quotients

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from ltaken
[PROOF STATE]
proof (chain)
picking this:
n = length (take n \<GG>)
[PROOF STEP]
have ind:"mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<HH>butlast.quotients)"
[PROOF STATE]
proof (prove)
using this:
n = length (take n \<GG>)

goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<HH>butlast.quotients)
[PROOF STEP]
using 1(1) True n'(5) grp\<GG>Pn.is_group finGbl \<GG>butlast.is_composition_series \<HH>butlast.is_composition_series
[PROOF STATE]
proof (prove)
using this:
n = length (take n \<GG>)
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
\<HH> ! (m - 1) = \<GG> ! (n - 1)
Suc n \<le> length \<GG>
Group.group \<GG>Pn
finite (carrier \<GG>Pn)
composition_series \<GG>Pn (take n \<GG>)
composition_series \<HH>Pm (take m \<HH>)

goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<HH>butlast.quotients)
[PROOF STEP]
unfolding \<GG>Pn_def \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
n = length (take n \<GG>)
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
\<HH> ! (m - 1) = \<GG> ! (n - 1)
Suc n \<le> length \<GG>
Group.group (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>)
finite (carrier (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>))
composition_series (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>) (take n \<GG>)
composition_series (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) (take m \<HH>)

goal (1 subgoal):
 1. mset (map group.iso_class (normal_series.quotients (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>) (take n \<GG>))) = mset (map group.iso_class (normal_series.quotients (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) (take m \<HH>)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<HH>butlast.quotients)

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "mset (map group.iso_class comp\<GG>.quotients)
                    = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))
[PROOF STEP]
by (simp add: quots\<GG>notempty)
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class (\<GG>butlast.quotients @ [last (comp\<GG>.quotients)]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients]))
[PROOF STEP]
using comp\<GG>.quotients_butlast length
[PROOF STATE]
proof (prove)
using this:
1 < length \<GG> \<Longrightarrow> butlast comp\<GG>.quotients = normal_series.quotients (G\<lparr>carrier := \<GG> ! (length \<GG> - 1 - 1)\<rparr>) (take (length \<GG> - 1) \<GG>)
3 \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients]))
[PROOF STEP]
unfolding n_def \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<GG> \<Longrightarrow> butlast comp\<GG>.quotients = normal_series.quotients (G\<lparr>carrier := \<GG> ! (length \<GG> - 1 - 1)\<rparr>) (take (length \<GG> - 1) \<GG>)
3 \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (normal_series.quotients (G\<lparr>carrier := \<GG> ! (length \<GG> - 1 - 1)\<rparr>) (take (length \<GG> - 1) \<GG>) @ [last comp\<GG>.quotients]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset ((map group.iso_class \<GG>butlast.quotients) @ [group.iso_class (last (comp\<GG>.quotients))])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class \<GG>butlast.quotients @ [group.iso_class (last comp\<GG>.quotients)])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class \<GG>butlast.quotients @ [group.iso_class (last comp\<GG>.quotients)])

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<GG>butlast.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class \<GG>butlast.quotients @ [group.iso_class (last comp\<GG>.quotients)])

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<GG>butlast.quotients) + {# group.iso_class (last (comp\<GG>.quotients)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients @ [group.iso_class (last comp\<GG>.quotients)]) = mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<GG>butlast.quotients @ [group.iso_class (last comp\<GG>.quotients)]) = mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<GG>butlast.quotients @ [group.iso_class (last comp\<GG>.quotients)]) = mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<HH>butlast.quotients) + {# group.iso_class (last (comp\<GG>.quotients)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}
[PROOF STEP]
using ind
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<HH>butlast.quotients)

goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<GG>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#}

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<HH>butlast.quotients) + {# group.iso_class (last (comp\<HH>.quotients)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#}
[PROOF STEP]
using lasteq
[PROOF STATE]
proof (prove)
using this:
last comp\<GG>.quotients = last comp\<HH>.quotients

goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#}

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<GG>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#}

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset ((map group.iso_class \<HH>butlast.quotients) @ [group.iso_class (last (comp\<HH>.quotients))])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients @ [group.iso_class (last comp\<HH>.quotients)])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients @ [group.iso_class (last comp\<HH>.quotients)])

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) + {#group.iso_class (last comp\<HH>.quotients)#} = mset (map group.iso_class \<HH>butlast.quotients @ [group.iso_class (last comp\<HH>.quotients)])

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class (\<HH>butlast.quotients @ [last (comp\<HH>.quotients)]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients @ [group.iso_class (last comp\<HH>.quotients)]) = mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients @ [group.iso_class (last comp\<HH>.quotients)]) = mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients @ [group.iso_class (last comp\<HH>.quotients)]) = mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
using length\<HH>big comp\<HH>.quotients_butlast
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>
1 < length \<HH> \<Longrightarrow> butlast comp\<HH>.quotients = normal_series.quotients (G\<lparr>carrier := \<HH> ! (length \<HH> - 1 - 1)\<rparr>) (take (length \<HH> - 1) \<HH>)

goal (1 subgoal):
 1. mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
unfolding m_def \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
3 \<le> length \<HH>
1 < length \<HH> \<Longrightarrow> butlast comp\<HH>.quotients = normal_series.quotients (G\<lparr>carrier := \<HH> ! (length \<HH> - 1 - 1)\<rparr>) (take (length \<HH> - 1) \<HH>)

goal (1 subgoal):
 1. mset (map group.iso_class (normal_series.quotients (G\<lparr>carrier := \<HH> ! (length \<HH> - 1 - 1)\<rparr>) (take (length \<HH> - 1) \<HH>) @ [last comp\<HH>.quotients])) = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<HH>butlast.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class comp\<HH>.quotients)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
using append_butlast_last_id quots\<HH>notempty
[PROOF STATE]
proof (prove)
using this:
?xs \<noteq> [] \<Longrightarrow> butlast ?xs @ [last ?xs] = ?xs
comp\<HH>.quotients \<noteq> []

goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class comp\<HH>.quotients)

goal (2 subgoals):
 1. \<HH> ! (m - 1) = \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
 2. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define \<HH>PmInt\<GG>Pn where "\<HH>PmInt\<GG>Pn = G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr>"
[PROOF STATE]
proof (state)
this:
\<HH>PmInt\<GG>Pn = G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<GG>Pnmax: max_normal_subgroup "\<GG> ! (n - 1)" G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_normal_subgroup (\<GG> ! (n - 1)) G
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_normal_subgroup (\<GG> ! (length \<GG> - 1 - 1)) G
[PROOF STEP]
by (metis add_lessD1 diff_diff_add n'(3) add.commute one_add_one 1(3) comp\<GG>.snd_to_last_max_normal)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<HH>Pmmax: max_normal_subgroup "\<HH> ! (m - 1)" G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_normal_subgroup (\<HH> ! (m - 1)) G
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_normal_subgroup (\<HH> ! (length \<HH> - 1 - 1)) G
[PROOF STEP]
by (metis add_lessD1 diff_diff_add m'(3) add.commute one_add_one 1(3) comp\<HH>.snd_to_last_max_normal)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<HH>PmnormG:"\<HH> ! (m - 1) \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<lhd> G
[PROOF STEP]
using comp\<HH>.normal_series_snd_to_last m'(4)
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (length \<HH> - 2) \<lhd> G
m - 1 = length \<HH> - 2

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<lhd> G
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (length \<HH> - 2) \<lhd> G
length \<HH> - 1 - 1 = length \<HH> - 2

goal (1 subgoal):
 1. \<HH> ! (length \<HH> - 1 - 1) \<lhd> G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<lhd> G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<GG>PnnormG:"\<GG> ! (n - 1) \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> ! (n - 1) \<lhd> G
[PROOF STEP]
using comp\<GG>.normal_series_snd_to_last n'(6)
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (length \<GG> - 2) \<lhd> G
n - 1 = length \<GG> - 2

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<lhd> G
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (length \<GG> - 2) \<lhd> G
length \<GG> - 1 - 1 = length \<GG> - 2

goal (1 subgoal):
 1. \<GG> ! (length \<GG> - 1 - 1) \<lhd> G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<GG> ! (n - 1) \<lhd> G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<HH>Pmint\<GG>PnnormG:"\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G
[PROOF STEP]
using \<HH>PmnormG \<GG>PnnormG
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<lhd> G
\<GG> ! (n - 1) \<lhd> G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G
[PROOF STEP]
by (rule comp\<GG>.normal_subgroup_intersect)
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have Intnorm\<GG>Pn:"\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn
[PROOF STEP]
using \<GG>PnnormG \<HH>PmnormG Int_lower2
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?A \<inter> ?B \<subseteq> ?B

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn
[PROOF STEP]
unfolding \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?A \<inter> ?B \<subseteq> ?B

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>
[PROOF STEP]
by (metis comp\<GG>.normal_restrict_supergroup comp\<GG>.normal_series_subgroups comp\<GG>.normal_subgroup_intersect n'(4))
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn
[PROOF STEP]
interpret grp\<GG>PnMod\<HH>Pmint\<GG>Pn: group "\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn

goal (1 subgoal):
 1. Group.group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
[PROOF STEP]
by (rule normal.factorgroup_is_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have Intnorm\<HH>Pm:"\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm
[PROOF STEP]
using \<HH>PmnormG \<GG>PnnormG Int_lower2 Int_commute
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<lhd> G
\<GG> ! (n - 1) \<lhd> G
?A \<inter> ?B \<subseteq> ?B
?A \<inter> ?B = ?B \<inter> ?A

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm
[PROOF STEP]
unfolding \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<lhd> G
\<GG> ! (n - 1) \<lhd> G
?A \<inter> ?B \<subseteq> ?B
?A \<inter> ?B = ?B \<inter> ?A

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>
[PROOF STEP]
by (metis comp\<GG>.normal_restrict_supergroup comp\<GG>.normal_subgroup_intersect comp\<HH>.normal_series_subgroups m'(6))
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm
[PROOF STEP]
interpret grp\<HH>PmMod\<HH>Pmint\<GG>Pn: group "\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm

goal (1 subgoal):
 1. Group.group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
[PROOF STEP]
by (rule normal.factorgroup_is_group)

      \<comment> \<open>Show that the second to last entries are not contained in each other.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have not\<HH>PmSub\<GG>Pn:"\<not> (\<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)
[PROOF STEP]
using \<HH>Pmmax.max_normal \<GG>PnnormG False[symmetric] \<GG>Pnmax.proper
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?J \<lhd> G; ?J \<noteq> \<HH> ! (m - 1); ?J \<noteq> carrier G\<rbrakk> \<Longrightarrow> \<not> \<HH> ! (m - 1) \<subseteq> ?J
\<GG> ! (n - 1) \<lhd> G
\<GG> ! (n - 1) \<noteq> \<HH> ! (m - 1)
\<GG> ! (n - 1) \<noteq> carrier G

goal (1 subgoal):
 1. \<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have not\<GG>PnSub\<HH>Pm:"\<not> (\<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1)
[PROOF STEP]
using \<GG>Pnmax.max_normal \<HH>PmnormG False \<HH>Pmmax.proper
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?J \<lhd> G; ?J \<noteq> \<GG> ! (n - 1); ?J \<noteq> carrier G\<rbrakk> \<Longrightarrow> \<not> \<GG> ! (n - 1) \<subseteq> ?J
\<HH> ! (m - 1) \<lhd> G
\<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1)
\<HH> ! (m - 1) \<noteq> carrier G

goal (1 subgoal):
 1. \<not> \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1)
[PROOF STEP]
by simp

      \<comment> \<open>Show that @{term "G Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))"} is a simple group.\<close>
[PROOF STATE]
proof (state)
this:
\<not> \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<HH>PmSubSetmult:"\<HH> ! (m - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
using second_isomorphism_grp.H_contained_in_set_mult \<GG>Pnmax.is_normal \<HH>PmnormG normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> ?H \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def max_normal_subgroup_def
[PROOF STATE]
proof (prove)
using this:
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> ?H \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<GG>PnSubSetmult:"\<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
using second_isomorphism_grp.S_contained_in_set_mult \<GG>Pnmax.is_normal \<HH>PmnormG normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> ?S \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def max_normal_subgroup_def
[PROOF STATE]
proof (prove)
using this:
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> ?S \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<GG> ! (n - 1) \<noteq> (\<HH> ! (m - 1)) <#>\<^bsub>G\<^esub> (\<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> ! (n - 1) \<noteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
using \<HH>PmSubSetmult not\<HH>PmSub\<GG>Pn
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
\<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<noteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<GG> ! (n - 1) \<noteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence set_multG:"(\<HH> ! (m - 1)) <#>\<^bsub>G\<^esub> (\<GG> ! (n - 1)) = carrier G"
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) \<noteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G
[PROOF STEP]
using \<GG>Pnmax.max_normal \<GG>Pnmax.is_normal \<HH>PmnormG comp\<GG>.normal_subgroup_set_mult_closed \<GG>PnSubSetmult
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) \<noteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)
\<lbrakk>?J \<lhd> G; ?J \<noteq> \<GG> ! (n - 1); ?J \<noteq> carrier G\<rbrakk> \<Longrightarrow> \<not> \<GG> ! (n - 1) \<subseteq> ?J
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
\<lbrakk>?M \<lhd> G; ?N \<lhd> G\<rbrakk> \<Longrightarrow> ?M <#>\<^bsub>G\<^esub> ?N \<lhd> G
\<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G
[PROOF STEP]
obtain \<phi> where "\<phi> \<in> iso (\<GG>Pn Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))) (G\<lparr>carrier := carrier G\<rparr> Mod \<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G

goal (1 subgoal):
 1. (\<And>\<phi>. \<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<HH> ! (m - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using second_isomorphism_grp.normal_intersection_quotient_isom \<HH>PmnormG \<GG>Pnmax.is_normal normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> (\<lambda>X. the_elem ((#>\<^bsub>?G\<^esub>) ?H ` X)) \<in> Group.iso (?G\<lparr>carrier := ?S\<rparr> Mod ?H \<inter> ?S) (?G\<lparr>carrier := ?H <#>\<^bsub>?G\<^esub> ?S\<rparr> Mod ?H)
\<HH> ! (m - 1) \<lhd> G
\<GG> ! (n - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. (\<And>\<phi>. \<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<HH> ! (m - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def max_normal_subgroup_def \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) <#>\<^bsub>G\<^esub> \<GG> ! (n - 1) = carrier G
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> (\<lambda>X. the_elem ((#>\<^bsub>?G\<^esub>) ?H ` X)) \<in> Group.iso (?G\<lparr>carrier := ?S\<rparr> Mod ?H \<inter> ?S) (?G\<lparr>carrier := ?H <#>\<^bsub>?G\<^esub> ?S\<rparr> Mod ?H)
\<HH> ! (m - 1) \<lhd> G
\<GG> ! (n - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. (\<And>\<phi>. \<phi> \<in> Group.iso (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr> Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<HH> ! (m - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence \<phi>:"\<phi> \<in> iso (\<GG>Pn Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))) (G Mod \<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. \<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G Mod \<HH> ! (m - 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G Mod \<HH> ! (m - 1))
[PROOF STEP]
obtain \<phi>2 where \<phi>2:"\<phi>2 \<in> iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)))"
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. (\<And>\<phi>2. \<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using group.iso_set_sym grp\<GG>PnMod\<HH>Pmint\<GG>Pn.is_group
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G Mod \<HH> ! (m - 1))
\<lbrakk>Group.group ?G; ?h \<in> Group.iso ?G ?H\<rbrakk> \<Longrightarrow> inv_into (carrier ?G) ?h \<in> Group.iso ?H ?G
Group.group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. (\<And>\<phi>2. \<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "simple_group (G\<lparr>carrier := \<HH> ! (m - 1 + 1)\<rparr> Mod \<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_group (G\<lparr>carrier := \<HH> ! (m - 1 + 1)\<rparr> Mod \<HH> ! (m - 1))
[PROOF STEP]
using comp\<HH>.simplefact m'(3)
[PROOF STATE]
proof (prove)
using this:
?i + 1 < length \<HH> \<Longrightarrow> simple_group (G\<lparr>carrier := \<HH> ! (?i + 1)\<rparr> Mod \<HH> ! ?i)
m - 1 + 1 < length \<HH>

goal (1 subgoal):
 1. simple_group (G\<lparr>carrier := \<HH> ! (m - 1 + 1)\<rparr> Mod \<HH> ! (m - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
simple_group (G\<lparr>carrier := \<HH> ! (m - 1 + 1)\<rparr> Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "simple_group (G Mod \<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
using this:
simple_group (G\<lparr>carrier := \<HH> ! (m - 1 + 1)\<rparr> Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. simple_group (G Mod \<HH> ! (m - 1))
[PROOF STEP]
using comp\<HH>.last last_conv_nth comp\<HH>.notempty m'(5)
[PROOF STATE]
proof (prove)
using this:
simple_group (G\<lparr>carrier := \<HH> ! (m - 1 + 1)\<rparr> Mod \<HH> ! (m - 1))
last \<HH> = carrier G
?xs \<noteq> [] \<Longrightarrow> last ?xs = ?xs ! (length ?xs - 1)
\<HH> \<noteq> []
m - 1 + 1 = length \<HH> - 1

goal (1 subgoal):
 1. simple_group (G Mod \<HH> ! (m - 1))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
simple_group (G Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
simple_group (G Mod \<HH> ! (m - 1))
[PROOF STEP]
have simple\<GG>PnModInt:"simple_group (\<GG>Pn Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)))"
[PROOF STATE]
proof (prove)
using this:
\<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
simple_group (G Mod \<HH> ! (m - 1))

goal (1 subgoal):
 1. simple_group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
[PROOF STEP]
using simple_group.iso_simple grp\<GG>PnMod\<HH>Pmint\<GG>Pn.is_group
[PROOF STATE]
proof (prove)
using this:
\<phi>2 \<in> Group.iso (G Mod \<HH> ! (m - 1)) (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
simple_group (G Mod \<HH> ! (m - 1))
\<lbrakk>simple_group ?G; Group.group ?H; ?\<phi> \<in> Group.iso ?G ?H\<rbrakk> \<Longrightarrow> simple_group ?H
Group.group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. simple_group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
simple_group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret grpGMod\<HH>Pm: group "(G Mod \<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G Mod \<HH> ! (m - 1))
[PROOF STEP]
by (metis \<HH>PmnormG normal.factorgroup_is_group)

      \<comment> \<open>Show analogues of the previous statements for @{term "\<HH> ! (m - 1)"} instead of @{term "\<GG> ! (n - 1)"}.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<HH>PmSubSetmult':"\<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
using second_isomorphism_grp.S_contained_in_set_mult \<GG>Pnmax.is_normal \<HH>PmnormG normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> ?S \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def max_normal_subgroup_def
[PROOF STATE]
proof (prove)
using this:
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> ?S \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have \<GG>PnSubSetmult':"\<GG> ! (n - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
using second_isomorphism_grp.H_contained_in_set_mult \<GG>Pnmax.is_normal \<HH>PmnormG normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> ?H \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def max_normal_subgroup_def
[PROOF STATE]
proof (prove)
using this:
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> ?H \<subseteq> ?H <#>\<^bsub>?G\<^esub> ?S
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<GG> ! (n - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<HH> ! (m - 1) \<noteq> (\<GG> ! (n - 1)) <#>\<^bsub>G\<^esub> (\<HH> ! (m - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
using \<GG>PnSubSetmult' not\<GG>PnSub\<HH>Pm
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
\<not> \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence set_multG:"(\<GG> ! (n - 1)) <#>\<^bsub>G\<^esub> (\<HH> ! (m - 1)) = carrier G"
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G
[PROOF STEP]
using \<HH>Pmmax.max_normal \<HH>Pmmax.is_normal \<GG>PnnormG comp\<GG>.normal_subgroup_set_mult_closed \<HH>PmSubSetmult'
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)
\<lbrakk>?J \<lhd> G; ?J \<noteq> \<HH> ! (m - 1); ?J \<noteq> carrier G\<rbrakk> \<Longrightarrow> \<not> \<HH> ! (m - 1) \<subseteq> ?J
\<HH> ! (m - 1) \<lhd> G
\<GG> ! (n - 1) \<lhd> G
\<lbrakk>?M \<lhd> G; ?N \<lhd> G\<rbrakk> \<Longrightarrow> ?M <#>\<^bsub>G\<^esub> ?N \<lhd> G
\<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from set_multG
[PROOF STATE]
proof (chain)
picking this:
\<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G
[PROOF STEP]
obtain \<psi> where
            "\<psi> \<in> iso (\<HH>Pm Mod (\<GG> ! (n - 1) \<inter> \<HH> ! (m - 1))) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G

goal (1 subgoal):
 1. (\<And>\<psi>. \<psi> \<in> Group.iso (\<HH>Pm Mod \<GG> ! (n - 1) \<inter> \<HH> ! (m - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using second_isomorphism_grp.normal_intersection_quotient_isom \<GG>PnnormG \<HH>Pmmax.is_normal normal_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G
second_isomorphism_grp ?H ?G ?S \<Longrightarrow> (\<lambda>X. the_elem ((#>\<^bsub>?G\<^esub>) ?H ` X)) \<in> Group.iso (?G\<lparr>carrier := ?S\<rparr> Mod ?H \<inter> ?S) (?G\<lparr>carrier := ?H <#>\<^bsub>?G\<^esub> ?S\<rparr> Mod ?H)
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. (\<And>\<psi>. \<psi> \<in> Group.iso (\<HH>Pm Mod \<GG> ! (n - 1) \<inter> \<HH> ! (m - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding second_isomorphism_grp_def second_isomorphism_grp_axioms_def max_normal_subgroup_def \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
\<GG> ! (n - 1) <#>\<^bsub>G\<^esub> \<HH> ! (m - 1) = carrier G
?H \<lhd> ?G \<and> subgroup ?S ?G \<Longrightarrow> (\<lambda>X. the_elem ((#>\<^bsub>?G\<^esub>) ?H ` X)) \<in> Group.iso (?G\<lparr>carrier := ?S\<rparr> Mod ?H \<inter> ?S) (?G\<lparr>carrier := ?H <#>\<^bsub>?G\<^esub> ?S\<rparr> Mod ?H)
\<GG> ! (n - 1) \<lhd> G
\<HH> ! (m - 1) \<lhd> G
?H \<lhd> ?G \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. (\<And>\<psi>. \<psi> \<in> Group.iso (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr> Mod \<GG> ! (n - 1) \<inter> \<HH> ! (m - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<GG> ! (n - 1) \<inter> \<HH> ! (m - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence \<psi>:"\<psi> \<in> iso (\<HH>Pm Mod (\<HH> ! (m - 1) \<inter> (\<GG> ! (n - 1)))) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<GG> ! (n - 1) \<inter> \<HH> ! (m - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<psi> \<in> Group.iso (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))
[PROOF STEP]
using Int_commute
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<GG> ! (n - 1) \<inter> \<HH> ! (m - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))
?A \<inter> ?B = ?B \<inter> ?A

goal (1 subgoal):
 1. \<psi> \<in> Group.iso (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))
[PROOF STEP]
obtain \<psi>2 where
             \<psi>2:"\<psi>2 \<in> iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)))"
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. (\<And>\<psi>2. \<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using group.iso_set_sym grp\<HH>PmMod\<HH>Pmint\<GG>Pn.is_group
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> Group.iso (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G\<lparr>carrier := carrier G\<rparr> Mod \<GG> ! (n - 1))
\<lbrakk>Group.group ?G; ?h \<in> Group.iso ?G ?H\<rbrakk> \<Longrightarrow> inv_into (carrier ?G) ?h \<in> Group.iso ?H ?G
Group.group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. (\<And>\<psi>2. \<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "simple_group (G\<lparr>carrier := \<GG> ! (n - 1 + 1)\<rparr> Mod \<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_group (G\<lparr>carrier := \<GG> ! (n - 1 + 1)\<rparr> Mod \<GG> ! (n - 1))
[PROOF STEP]
using comp\<GG>.simplefact n'(3)
[PROOF STATE]
proof (prove)
using this:
?i + 1 < length \<GG> \<Longrightarrow> simple_group (G\<lparr>carrier := \<GG> ! (?i + 1)\<rparr> Mod \<GG> ! ?i)
n - 1 + 1 < length \<GG>

goal (1 subgoal):
 1. simple_group (G\<lparr>carrier := \<GG> ! (n - 1 + 1)\<rparr> Mod \<GG> ! (n - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
simple_group (G\<lparr>carrier := \<GG> ! (n - 1 + 1)\<rparr> Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "simple_group (G Mod \<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
using this:
simple_group (G\<lparr>carrier := \<GG> ! (n - 1 + 1)\<rparr> Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. simple_group (G Mod \<GG> ! (n - 1))
[PROOF STEP]
using comp\<GG>.last last_conv_nth comp\<GG>.notempty n'(7)
[PROOF STATE]
proof (prove)
using this:
simple_group (G\<lparr>carrier := \<GG> ! (n - 1 + 1)\<rparr> Mod \<GG> ! (n - 1))
last \<GG> = carrier G
?xs \<noteq> [] \<Longrightarrow> last ?xs = ?xs ! (length ?xs - 1)
\<GG> \<noteq> []
n - 1 + 1 = length \<GG> - 1

goal (1 subgoal):
 1. simple_group (G Mod \<GG> ! (n - 1))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
simple_group (G Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
simple_group (G Mod \<GG> ! (n - 1))
[PROOF STEP]
have simple\<HH>PmModInt:"simple_group (\<HH>Pm Mod (\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)))"
[PROOF STATE]
proof (prove)
using this:
\<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
simple_group (G Mod \<GG> ! (n - 1))

goal (1 subgoal):
 1. simple_group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
[PROOF STEP]
using simple_group.iso_simple grp\<HH>PmMod\<HH>Pmint\<GG>Pn.is_group
[PROOF STATE]
proof (prove)
using this:
\<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
simple_group (G Mod \<GG> ! (n - 1))
\<lbrakk>simple_group ?G; Group.group ?H; ?\<phi> \<in> Group.iso ?G ?H\<rbrakk> \<Longrightarrow> simple_group ?H
Group.group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. simple_group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
simple_group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret grpGMod\<GG>Pn: group "(G Mod \<GG> ! (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G Mod \<GG> ! (n - 1))
[PROOF STEP]
by (metis \<GG>PnnormG normal.factorgroup_is_group)

      \<comment> \<open>Instantiate several composition series used to build up the equality of quotient multisets.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define \<KK> where "\<KK> = remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)"
[PROOF STATE]
proof (state)
this:
\<KK> = remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
define \<LL> where "\<LL> = remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)"
[PROOF STATE]
proof (state)
this:
\<LL> = remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<KK>: composition_series \<HH>Pm \<KK>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series \<HH>Pm \<KK>
[PROOF STEP]
using comp\<GG>.intersect_normal 1(3) \<HH>PmnormG
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (carrier G); ?K \<lhd> G\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := ?K\<rparr>) (remdups_adj (map ((\<inter>) ?K) \<GG>))
finite (carrier G)
\<HH> ! (m - 1) \<lhd> G

goal (1 subgoal):
 1. composition_series \<HH>Pm \<KK>
[PROOF STEP]
unfolding \<KK>_def \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (carrier G); ?K \<lhd> G\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := ?K\<rparr>) (remdups_adj (map ((\<inter>) ?K) \<GG>))
finite (carrier G)
\<HH> ! (m - 1) \<lhd> G

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<LL>: composition_series \<GG>Pn \<LL>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series \<GG>Pn \<LL>
[PROOF STEP]
using comp\<HH>.intersect_normal 1(3) \<GG>PnnormG
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (carrier G); ?K \<lhd> G\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := ?K\<rparr>) (remdups_adj (map ((\<inter>) ?K) \<HH>))
finite (carrier G)
\<GG> ! (n - 1) \<lhd> G

goal (1 subgoal):
 1. composition_series \<GG>Pn \<LL>
[PROOF STEP]
unfolding \<LL>_def \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (carrier G); ?K \<lhd> G\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := ?K\<rparr>) (remdups_adj (map ((\<inter>) ?K) \<HH>))
finite (carrier G)
\<GG> ! (n - 1) \<lhd> G

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>) (remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>))
[PROOF STEP]
by auto

      \<comment> \<open>Apply the induction hypothesis on @{text \<GG>butlast} and @{text \<LL>}\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from n'(2)
[PROOF STATE]
proof (chain)
picking this:
n < length \<GG>
[PROOF STEP]
have "Suc (length (take n \<GG>)) \<le> length \<GG>"
[PROOF STATE]
proof (prove)
using this:
n < length \<GG>

goal (1 subgoal):
 1. Suc (length (take n \<GG>)) \<le> length \<GG>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc (length (take n \<GG>)) \<le> length \<GG>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence multisets\<GG>butlast\<LL>:"mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)"
[PROOF STATE]
proof (prove)
using this:
Suc (length (take n \<GG>)) \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)
[PROOF STEP]
using  "1.hyps" grp\<GG>Pn.is_group finGbl \<GG>butlast.is_composition_series \<LL>.is_composition_series
[PROOF STATE]
proof (prove)
using this:
Suc (length (take n \<GG>)) \<le> length \<GG>
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group \<GG>Pn
finite (carrier \<GG>Pn)
composition_series \<GG>Pn (take n \<GG>)
composition_series \<GG>Pn \<LL>

goal (1 subgoal):
 1. mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length\<LL>:"n = length \<LL>"
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)

goal (1 subgoal):
 1. n = length \<LL>
[PROOF STEP]
using \<GG>butlast.quotients_length \<LL>.quotients_length length_map size_mset ltaken
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)
length \<GG>butlast.quotients + 1 = length (take n \<GG>)
length \<LL>.quotients + 1 = length \<LL>
length (map ?f ?xs) = length ?xs
size (mset ?xs) = length ?xs
n = length (take n \<GG>)

goal (1 subgoal):
 1. n = length \<LL>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
n = length \<LL>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length\<LL>':"length \<LL> > 1" "length \<LL> - 1 > 0" "length \<LL> - 1 \<le> length \<LL>"
[PROOF STATE]
proof (prove)
using this:
n = length \<LL>

goal (1 subgoal):
 1. 1 < length \<LL> &&& 0 < length \<LL> - 1 &&& length \<LL> - 1 \<le> length \<LL>
[PROOF STEP]
using n'(6) length
[PROOF STATE]
proof (prove)
using this:
n = length \<LL>
n - 1 = length \<GG> - 2
3 \<le> length \<GG>

goal (1 subgoal):
 1. 1 < length \<LL> &&& 0 < length \<LL> - 1 &&& length \<LL> - 1 \<le> length \<LL>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length \<LL>
0 < length \<LL> - 1
length \<LL> - 1 \<le> length \<LL>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have Inteq\<LL>sndlast:"\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
have "length \<LL> - 1 - 1 + 1 < length \<LL>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length \<LL> - 1 - 1 + 1 < length \<LL>
[PROOF STEP]
using length\<LL>'
[PROOF STATE]
proof (prove)
using this:
1 < length \<LL>
0 < length \<LL> - 1
length \<LL> - 1 \<le> length \<LL>

goal (1 subgoal):
 1. length \<LL> - 1 - 1 + 1 < length \<LL>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length \<LL> - 1 - 1 + 1 < length \<LL>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length \<LL> - 1 - 1 + 1 < length \<LL>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
have KGnotempty:"(map ((\<inter>) (\<GG> ! (n - 1))) \<HH>) \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []
[PROOF STEP]
using comp\<HH>.notempty
[PROOF STATE]
proof (prove)
using this:
\<HH> \<noteq> []

goal (1 subgoal):
 1. map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []
[PROOF STEP]
by (metis Nil_is_map_conv)
[PROOF STATE]
proof (state)
this:
map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length \<LL> - 1 - 1 + 1 < length \<LL>
map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []
[PROOF STEP]
obtain i where i:"i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)"
          "\<LL> ! (length \<LL> - 1 - 1) = (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>) ! i" "\<LL> ! (length \<LL> - 1 - 1 + 1) = (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>) ! (i + 1)"
[PROOF STATE]
proof (prove)
using this:
length \<LL> - 1 - 1 + 1 < length \<LL>
map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>); \<LL> ! (length \<LL> - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i; \<LL> ! (length \<LL> - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using remdups_adj_obtain_adjacency
[PROOF STATE]
proof (prove)
using this:
length \<LL> - 1 - 1 + 1 < length \<LL>
map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []
\<lbrakk>?i + 1 < length (remdups_adj ?xs); 0 < length ?xs; \<And>j. \<lbrakk>j + 1 < length ?xs; remdups_adj ?xs ! ?i = ?xs ! j; remdups_adj ?xs ! (?i + 1) = ?xs ! (j + 1)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>); \<LL> ! (length \<LL> - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i; \<LL> ! (length \<LL> - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding \<LL>_def
[PROOF STATE]
proof (prove)
using this:
length (remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)) - 1 - 1 + 1 < length (remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>))
map ((\<inter>) (\<GG> ! (n - 1))) \<HH> \<noteq> []
\<lbrakk>?i + 1 < length (remdups_adj ?xs); 0 < length ?xs; \<And>j. \<lbrakk>j + 1 < length ?xs; remdups_adj ?xs ! ?i = ?xs ! j; remdups_adj ?xs ! (?i + 1) = ?xs ! (j + 1)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>); remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>) ! (length (remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)) - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i; remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>) ! (length (remdups_adj (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)) - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)
\<LL> ! (length \<LL> - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i
\<LL> ! (length \<LL> - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
hence "\<LL> ! (length \<LL> - 1 - 1) = \<HH> ! i \<inter> \<GG> ! (n - 1)" "\<LL> ! (length \<LL> - 1 - 1 + 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)
\<LL> ! (length \<LL> - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i
\<LL> ! (length \<LL> - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)

goal (1 subgoal):
 1. \<LL> ! (length \<LL> - 1 - 1) = \<HH> ! i \<inter> \<GG> ! (n - 1) &&& \<LL> ! (length \<LL> - 1 - 1 + 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<LL> ! (length \<LL> - 1 - 1) = \<HH> ! i \<inter> \<GG> ! (n - 1)
\<LL> ! (length \<LL> - 1 - 1 + 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
hence "\<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
using this:
\<LL> ! (length \<LL> - 1 - 1) = \<HH> ! i \<inter> \<GG> ! (n - 1)
\<LL> ! (length \<LL> - 1 - 1 + 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)
[PROOF STEP]
using length\<LL>'(2)
[PROOF STATE]
proof (prove)
using this:
\<LL> ! (length \<LL> - 1 - 1) = \<HH> ! i \<inter> \<GG> ! (n - 1)
\<LL> ! (length \<LL> - 1 - 1 + 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)
0 < length \<LL> - 1

goal (1 subgoal):
 1. \<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)
[PROOF STEP]
by (metis Suc_diff_1 Suc_eq_plus1)
[PROOF STATE]
proof (state)
this:
\<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
hence \<GG>Pnsub\<HH>Pm:"\<GG> ! (n - 1) \<subseteq> \<HH> ! (i + 1)"
[PROOF STATE]
proof (prove)
using this:
\<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<HH> ! (i + 1)
[PROOF STEP]
using \<LL>.last \<LL>.notempty last_conv_nth
[PROOF STATE]
proof (prove)
using this:
\<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)
last \<LL> = carrier \<GG>Pn
\<LL> \<noteq> []
?xs \<noteq> [] \<Longrightarrow> last ?xs = ?xs ! (length ?xs - 1)

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<HH> ! (i + 1)
[PROOF STEP]
unfolding \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<LL> ! (length \<LL> - 1) = \<HH> ! (i + 1) \<inter> \<GG> ! (n - 1)
last \<LL> = carrier (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>)
\<LL> \<noteq> []
?xs \<noteq> [] \<Longrightarrow> last ?xs = ?xs ! (length ?xs - 1)

goal (1 subgoal):
 1. \<GG> ! (n - 1) \<subseteq> \<HH> ! (i + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<GG> ! (n - 1) \<subseteq> \<HH> ! (i + 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
from i(1)
[PROOF STATE]
proof (chain)
picking this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)
[PROOF STEP]
have "i + 1 < m + 1"
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)

goal (1 subgoal):
 1. i + 1 < m + 1
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)

goal (1 subgoal):
 1. i + 1 < length \<HH> - 1 + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i + 1 < m + 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i + 1 < m + 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
have "\<not> (i + 1 \<le> m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> i + 1 \<le> m - 1
[PROOF STEP]
using comp\<HH>.entries_mono m'(6) not\<GG>PnSub\<HH>Pm \<GG>Pnsub\<HH>Pm
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> ?j; ?j < length \<HH>\<rbrakk> \<Longrightarrow> \<HH> ! ?i \<subseteq> \<HH> ! ?j
m - 1 < length \<HH>
\<not> \<GG> ! (n - 1) \<subseteq> \<HH> ! (m - 1)
\<GG> ! (n - 1) \<subseteq> \<HH> ! (i + 1)

goal (1 subgoal):
 1. \<not> i + 1 \<le> m - 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> i + 1 \<le> m - 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i + 1 < m + 1
\<not> i + 1 \<le> m - 1
[PROOF STEP]
have "m - 1 = i"
[PROOF STATE]
proof (prove)
using this:
i + 1 < m + 1
\<not> i + 1 \<le> m - 1

goal (1 subgoal):
 1. m - 1 = i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m - 1 = i

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
with i
[PROOF STATE]
proof (chain)
picking this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)
\<LL> ! (length \<LL> - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i
\<LL> ! (length \<LL> - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)
m - 1 = i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<GG> ! (n - 1))) \<HH>)
\<LL> ! (length \<LL> - 1 - 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! i
\<LL> ! (length \<LL> - 1 - 1 + 1) = map ((\<inter>) (\<GG> ! (n - 1))) \<HH> ! (i + 1)
m - 1 = i

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence \<LL>sndlast:"\<HH>PmInt\<GG>Pn = (\<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)

goal (1 subgoal):
 1. \<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>
[PROOF STEP]
unfolding \<HH>PmInt\<GG>Pn_def \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)

goal (1 subgoal):
 1. G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr> = G\<lparr>carrier := \<GG> ! (n - 1), carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>
[PROOF STEP]
interpret \<LL>butlast: composition_series \<HH>PmInt\<GG>Pn "take (length \<LL> - 1) \<LL>"
[PROOF STATE]
proof (prove)
using this:
\<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>

goal (1 subgoal):
 1. composition_series \<HH>PmInt\<GG>Pn (take (length \<LL> - 1) \<LL>)
[PROOF STEP]
using length\<LL>' \<LL>.composition_series_prefix_closed
[PROOF STATE]
proof (prove)
using this:
\<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>
1 < length \<LL>
0 < length \<LL> - 1
length \<LL> - 1 \<le> length \<LL>
\<lbrakk>?i \<le> length \<LL>; 0 < ?i\<rbrakk> \<Longrightarrow> composition_series (\<GG>Pn\<lparr>carrier := \<LL> ! (?i - 1)\<rparr>) (take ?i \<LL>)

goal (1 subgoal):
 1. composition_series \<HH>PmInt\<GG>Pn (take (length \<LL> - 1) \<LL>)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from \<open>length \<LL> > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < length \<LL>
[PROOF STEP]
have quots\<LL>notemtpy:"\<LL>.quotients \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
1 < length \<LL>

goal (1 subgoal):
 1. \<LL>.quotients \<noteq> []
[PROOF STEP]
unfolding \<LL>.quotients_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<LL>

goal (1 subgoal):
 1. map (\<lambda>i. \<GG>Pn\<lparr>carrier := \<LL> ! (i + 1)\<rparr> Mod \<LL> ! i) [0..<length \<LL> - 1] \<noteq> []
[PROOF STEP]
by auto

      \<comment> \<open>Apply the induction hypothesis on @{text \<LL>butlast} and @{text \<KK>butlast}\<close>
[PROOF STATE]
proof (state)
this:
\<LL>.quotients \<noteq> []

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "length \<KK> > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length \<KK>
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 1 < length \<KK> \<Longrightarrow> False
[PROOF STEP]
assume "\<not> length \<KK> > 1"
[PROOF STATE]
proof (state)
this:
\<not> 1 < length \<KK>

goal (1 subgoal):
 1. \<not> 1 < length \<KK> \<Longrightarrow> False
[PROOF STEP]
with \<KK>.notempty
[PROOF STATE]
proof (chain)
picking this:
\<KK> \<noteq> []
\<not> 1 < length \<KK>
[PROOF STEP]
have "length \<KK> = 1"
[PROOF STATE]
proof (prove)
using this:
\<KK> \<noteq> []
\<not> 1 < length \<KK>

goal (1 subgoal):
 1. length \<KK> = 1
[PROOF STEP]
by (metis One_nat_def Suc_lessI length_greater_0_conv)
[PROOF STATE]
proof (state)
this:
length \<KK> = 1

goal (1 subgoal):
 1. \<not> 1 < length \<KK> \<Longrightarrow> False
[PROOF STEP]
hence "carrier \<HH>Pm = {\<one>\<^bsub>\<HH>Pm\<^esub>}"
[PROOF STATE]
proof (prove)
using this:
length \<KK> = 1

goal (1 subgoal):
 1. carrier \<HH>Pm = {\<one>\<^bsub>\<HH>Pm\<^esub>}
[PROOF STEP]
using \<KK>.composition_series_length_one \<KK>.composition_series_triv_group
[PROOF STATE]
proof (prove)
using this:
length \<KK> = 1
(length \<KK> = 1) = (\<KK> = [{\<one>\<^bsub>\<HH>Pm\<^esub>}])
(carrier \<HH>Pm = {\<one>\<^bsub>\<HH>Pm\<^esub>}) = (\<KK> = [{\<one>\<^bsub>\<HH>Pm\<^esub>}])

goal (1 subgoal):
 1. carrier \<HH>Pm = {\<one>\<^bsub>\<HH>Pm\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
carrier \<HH>Pm = {\<one>\<^bsub>\<HH>Pm\<^esub>}

goal (1 subgoal):
 1. \<not> 1 < length \<KK> \<Longrightarrow> False
[PROOF STEP]
hence "carrier \<HH>Pm = {\<one>\<^bsub>G\<^esub>}"
[PROOF STATE]
proof (prove)
using this:
carrier \<HH>Pm = {\<one>\<^bsub>\<HH>Pm\<^esub>}

goal (1 subgoal):
 1. carrier \<HH>Pm = {\<one>\<^bsub>G\<^esub>}
[PROOF STEP]
unfolding \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) = {\<one>\<^bsub>G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>\<^esub>}

goal (1 subgoal):
 1. carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) = {\<one>\<^bsub>G\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
carrier \<HH>Pm = {\<one>\<^bsub>G\<^esub>}

goal (1 subgoal):
 1. \<not> 1 < length \<KK> \<Longrightarrow> False
[PROOF STEP]
hence "carrier \<HH>Pm \<subseteq> \<GG> ! (n - 1)"
[PROOF STATE]
proof (prove)
using this:
carrier \<HH>Pm = {\<one>\<^bsub>G\<^esub>}

goal (1 subgoal):
 1. carrier \<HH>Pm \<subseteq> \<GG> ! (n - 1)
[PROOF STEP]
using \<GG>Pnmax.is_subgroup subgroup.one_closed
[PROOF STATE]
proof (prove)
using this:
carrier \<HH>Pm = {\<one>\<^bsub>G\<^esub>}
subgroup (\<GG> ! (n - 1)) G
subgroup ?H ?G \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<in> ?H

goal (1 subgoal):
 1. carrier \<HH>Pm \<subseteq> \<GG> ! (n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
carrier \<HH>Pm \<subseteq> \<GG> ! (n - 1)

goal (1 subgoal):
 1. \<not> 1 < length \<KK> \<Longrightarrow> False
[PROOF STEP]
with not\<HH>PmSub\<GG>Pn
[PROOF STATE]
proof (chain)
picking this:
\<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)
carrier \<HH>Pm \<subseteq> \<GG> ! (n - 1)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)
carrier \<HH>Pm \<subseteq> \<GG> ! (n - 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
\<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)
carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) \<subseteq> \<GG> ! (n - 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < length \<KK>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length\<KK>':"length \<KK> - 1 > 0" "length \<KK> - 1 \<le> length \<KK>"
[PROOF STATE]
proof (prove)
using this:
1 < length \<KK>

goal (1 subgoal):
 1. 0 < length \<KK> - 1 &&& length \<KK> - 1 \<le> length \<KK>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have Inteq\<KK>sndlast:"\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
have "length \<KK> - 1 - 1 + 1 < length \<KK>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length \<KK> - 1 - 1 + 1 < length \<KK>
[PROOF STEP]
using length\<KK>'
[PROOF STATE]
proof (prove)
using this:
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>

goal (1 subgoal):
 1. length \<KK> - 1 - 1 + 1 < length \<KK>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length \<KK> - 1 - 1 + 1 < length \<KK>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length \<KK> - 1 - 1 + 1 < length \<KK>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
have KGnotempty:"(map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []
[PROOF STEP]
using comp\<GG>.notempty
[PROOF STATE]
proof (prove)
using this:
\<GG> \<noteq> []

goal (1 subgoal):
 1. map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []
[PROOF STEP]
by (metis Nil_is_map_conv)
[PROOF STATE]
proof (state)
this:
map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length \<KK> - 1 - 1 + 1 < length \<KK>
map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []
[PROOF STEP]
obtain i where i:"i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)"
          "\<KK> ! (length \<KK> - 1 - 1) = (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) ! i" "\<KK> ! (length \<KK> - 1 - 1 + 1) = (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) ! (i + 1)"
[PROOF STATE]
proof (prove)
using this:
length \<KK> - 1 - 1 + 1 < length \<KK>
map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>); \<KK> ! (length \<KK> - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i; \<KK> ! (length \<KK> - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using remdups_adj_obtain_adjacency
[PROOF STATE]
proof (prove)
using this:
length \<KK> - 1 - 1 + 1 < length \<KK>
map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []
\<lbrakk>?i + 1 < length (remdups_adj ?xs); 0 < length ?xs; \<And>j. \<lbrakk>j + 1 < length ?xs; remdups_adj ?xs ! ?i = ?xs ! j; remdups_adj ?xs ! (?i + 1) = ?xs ! (j + 1)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>); \<KK> ! (length \<KK> - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i; \<KK> ! (length \<KK> - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding \<KK>_def
[PROOF STATE]
proof (prove)
using this:
length (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)) - 1 - 1 + 1 < length (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>))
map ((\<inter>) (\<HH> ! (m - 1))) \<GG> \<noteq> []
\<lbrakk>?i + 1 < length (remdups_adj ?xs); 0 < length ?xs; \<And>j. \<lbrakk>j + 1 < length ?xs; remdups_adj ?xs ! ?i = ?xs ! j; remdups_adj ?xs ! (?i + 1) = ?xs ! (j + 1)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>); remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) ! (length (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)) - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i; remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) ! (length (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)) - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)
\<KK> ! (length \<KK> - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i
\<KK> ! (length \<KK> - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
hence "\<KK> ! (length \<KK> - 1 - 1) = \<GG> ! i \<inter> \<HH> ! (m - 1)" "\<KK> ! (length \<KK> - 1 - 1 + 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)"
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)
\<KK> ! (length \<KK> - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i
\<KK> ! (length \<KK> - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)

goal (1 subgoal):
 1. \<KK> ! (length \<KK> - 1 - 1) = \<GG> ! i \<inter> \<HH> ! (m - 1) &&& \<KK> ! (length \<KK> - 1 - 1 + 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<KK> ! (length \<KK> - 1 - 1) = \<GG> ! i \<inter> \<HH> ! (m - 1)
\<KK> ! (length \<KK> - 1 - 1 + 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
hence "\<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)"
[PROOF STATE]
proof (prove)
using this:
\<KK> ! (length \<KK> - 1 - 1) = \<GG> ! i \<inter> \<HH> ! (m - 1)
\<KK> ! (length \<KK> - 1 - 1 + 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)
[PROOF STEP]
using length\<KK>'(1)
[PROOF STATE]
proof (prove)
using this:
\<KK> ! (length \<KK> - 1 - 1) = \<GG> ! i \<inter> \<HH> ! (m - 1)
\<KK> ! (length \<KK> - 1 - 1 + 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)
0 < length \<KK> - 1

goal (1 subgoal):
 1. \<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)
[PROOF STEP]
by (metis Suc_diff_1 Suc_eq_plus1)
[PROOF STATE]
proof (state)
this:
\<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
hence \<HH>Pmsub\<GG>Pn:"\<HH> ! (m - 1) \<subseteq> \<GG> ! (i + 1)"
[PROOF STATE]
proof (prove)
using this:
\<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<GG> ! (i + 1)
[PROOF STEP]
using \<KK>.last \<KK>.notempty last_conv_nth
[PROOF STATE]
proof (prove)
using this:
\<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)
last \<KK> = carrier \<HH>Pm
\<KK> \<noteq> []
?xs \<noteq> [] \<Longrightarrow> last ?xs = ?xs ! (length ?xs - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<GG> ! (i + 1)
[PROOF STEP]
unfolding \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
\<KK> ! (length \<KK> - 1) = \<GG> ! (i + 1) \<inter> \<HH> ! (m - 1)
last \<KK> = carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>)
\<KK> \<noteq> []
?xs \<noteq> [] \<Longrightarrow> last ?xs = ?xs ! (length ?xs - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<subseteq> \<GG> ! (i + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<subseteq> \<GG> ! (i + 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
from i(1)
[PROOF STATE]
proof (chain)
picking this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)
[PROOF STEP]
have "i + 1 < n + 1"
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)

goal (1 subgoal):
 1. i + 1 < n + 1
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)

goal (1 subgoal):
 1. i + 1 < length \<GG> - 1 + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i + 1 < n + 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i + 1 < n + 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
have "\<not> (i + 1 \<le> n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> i + 1 \<le> n - 1
[PROOF STEP]
using comp\<GG>.entries_mono n'(2) not\<HH>PmSub\<GG>Pn \<HH>Pmsub\<GG>Pn
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> ?j; ?j < length \<GG>\<rbrakk> \<Longrightarrow> \<GG> ! ?i \<subseteq> \<GG> ! ?j
n < length \<GG>
\<not> \<HH> ! (m - 1) \<subseteq> \<GG> ! (n - 1)
\<HH> ! (m - 1) \<subseteq> \<GG> ! (i + 1)

goal (1 subgoal):
 1. \<not> i + 1 \<le> n - 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> i + 1 \<le> n - 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i + 1 < n + 1
\<not> i + 1 \<le> n - 1
[PROOF STEP]
have "n - 1 = i"
[PROOF STATE]
proof (prove)
using this:
i + 1 < n + 1
\<not> i + 1 \<le> n - 1

goal (1 subgoal):
 1. n - 1 = i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n - 1 = i

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
with i
[PROOF STATE]
proof (chain)
picking this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)
\<KK> ! (length \<KK> - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i
\<KK> ! (length \<KK> - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)
n - 1 = i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i + 1 < length (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)
\<KK> ! (length \<KK> - 1 - 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! i
\<KK> ! (length \<KK> - 1 - 1 + 1) = map ((\<inter>) (\<HH> ! (m - 1))) \<GG> ! (i + 1)
n - 1 = i

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
using length\<KK>' \<KK>.composition_series_prefix_closed
[PROOF STATE]
proof (prove)
using this:
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>
\<lbrakk>?i \<le> length \<KK>; 0 < ?i\<rbrakk> \<Longrightarrow> composition_series (\<HH>Pm\<lparr>carrier := \<KK> ! (?i - 1)\<rparr>) (take ?i \<KK>)

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
unfolding \<HH>PmInt\<GG>Pn_def \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>
\<lbrakk>?i \<le> length \<KK>; 0 < ?i\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := \<HH> ! (m - 1), carrier := \<KK> ! (?i - 1)\<rparr>) (take ?i \<KK>)

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
interpret \<KK>butlast: composition_series \<HH>PmInt\<GG>Pn "(take (length \<KK> - 1) \<KK>)"
[PROOF STATE]
proof (prove)
using this:
composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)

goal (1 subgoal):
 1. composition_series \<HH>PmInt\<GG>Pn (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
using Inteq\<KK>sndlast
[PROOF STATE]
proof (prove)
using this:
composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal (1 subgoal):
 1. composition_series \<HH>PmInt\<GG>Pn (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
unfolding \<HH>PmInt\<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
composition_series (G\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from finGbl
[PROOF STATE]
proof (chain)
picking this:
finite (carrier \<GG>Pn)
[PROOF STEP]
have finInt:"finite (carrier \<HH>PmInt\<GG>Pn)"
[PROOF STATE]
proof (prove)
using this:
finite (carrier \<GG>Pn)

goal (1 subgoal):
 1. finite (carrier \<HH>PmInt\<GG>Pn)
[PROOF STEP]
unfolding \<HH>PmInt\<GG>Pn_def \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
finite (carrier (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>))

goal (1 subgoal):
 1. finite (carrier (G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (carrier \<HH>PmInt\<GG>Pn)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (carrier \<HH>PmInt\<GG>Pn)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>
[PROOF STEP]
using length\<LL>
[PROOF STATE]
proof (prove)
using this:
n = length \<LL>

goal (1 subgoal):
 1. Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
length \<GG> - 1 = length \<LL>

goal (1 subgoal):
 1. Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>
[PROOF STEP]
using n'(2)
[PROOF STATE]
proof (prove)
using this:
length \<GG> - 1 = length \<LL>
n < length \<GG>

goal (1 subgoal):
 1. Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (carrier \<HH>PmInt\<GG>Pn)
Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>
[PROOF STEP]
have multisets\<KK>\<LL>butlast:"mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)"
[PROOF STATE]
proof (prove)
using this:
finite (carrier \<HH>PmInt\<GG>Pn)
Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)
[PROOF STEP]
using "1.hyps" \<LL>butlast.is_group \<KK>butlast.is_composition_series \<LL>butlast.is_composition_series
[PROOF STATE]
proof (prove)
using this:
finite (carrier \<HH>PmInt\<GG>Pn)
Suc (length (take (length \<LL> - 1) \<LL>)) \<le> length \<GG>
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group \<HH>PmInt\<GG>Pn
composition_series \<HH>PmInt\<GG>Pn (take (length \<KK> - 1) \<KK>)
composition_series \<HH>PmInt\<GG>Pn (take (length \<LL> - 1) \<LL>)

goal (1 subgoal):
 1. mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "length (take (length \<KK> - 1) \<KK>) = length (take (length \<LL> - 1) \<LL>)"
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)

goal (1 subgoal):
 1. length (take (length \<KK> - 1) \<KK>) = length (take (length \<LL> - 1) \<LL>)
[PROOF STEP]
using \<KK>butlast.quotients_length \<LL>butlast.quotients_length length_map size_mset
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)
length \<KK>butlast.quotients + 1 = length (take (length \<KK> - 1) \<KK>)
length \<LL>butlast.quotients + 1 = length (take (length \<LL> - 1) \<LL>)
length (map ?f ?xs) = length ?xs
size (mset ?xs) = length ?xs

goal (1 subgoal):
 1. length (take (length \<KK> - 1) \<KK>) = length (take (length \<LL> - 1) \<LL>)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
length (take (length \<KK> - 1) \<KK>) = length (take (length \<LL> - 1) \<LL>)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence "length (take (length \<KK> - 1) \<KK>) = n - 1"
[PROOF STATE]
proof (prove)
using this:
length (take (length \<KK> - 1) \<KK>) = length (take (length \<LL> - 1) \<LL>)

goal (1 subgoal):
 1. length (take (length \<KK> - 1) \<KK>) = n - 1
[PROOF STEP]
using length\<LL> n'(1)
[PROOF STATE]
proof (prove)
using this:
length (take (length \<KK> - 1) \<KK>) = length (take (length \<LL> - 1) \<LL>)
n = length \<LL>
0 < n

goal (1 subgoal):
 1. length (take (length \<KK> - 1) \<KK>) = n - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (take (length \<KK> - 1) \<KK>) = n - 1

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length\<KK>:"length \<KK> = n"
[PROOF STATE]
proof (prove)
using this:
length (take (length \<KK> - 1) \<KK>) = n - 1

goal (1 subgoal):
 1. length \<KK> = n
[PROOF STEP]
by (metis Suc_diff_1 \<KK>.notempty butlast_conv_take length_butlast length_greater_0_conv n'(1))

      \<comment> \<open>Apply the induction hypothesis on @{text \<KK>} and @{text \<HH>butlast}\<close>
[PROOF STATE]
proof (state)
this:
length \<KK> = n

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from Inteq\<KK>sndlast
[PROOF STATE]
proof (chain)
picking this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)
[PROOF STEP]
have \<KK>sndlast:"\<HH>PmInt\<GG>Pn = (\<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal (1 subgoal):
 1. \<HH>PmInt\<GG>Pn = \<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>
[PROOF STEP]
unfolding \<HH>PmInt\<GG>Pn_def \<HH>Pm_def \<KK>_def
[PROOF STATE]
proof (prove)
using this:
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) ! (length (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)) - 1 - 1)

goal (1 subgoal):
 1. G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr> = G\<lparr>carrier := \<HH> ! (m - 1), carrier := remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>) ! (length (remdups_adj (map ((\<inter>) (\<HH> ! (m - 1))) \<GG>)) - 1 - 1)\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<HH>PmInt\<GG>Pn = \<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
from length\<KK>
[PROOF STATE]
proof (chain)
picking this:
length \<KK> = n
[PROOF STEP]
have "Suc (length \<KK>) \<le> length \<GG>"
[PROOF STATE]
proof (prove)
using this:
length \<KK> = n

goal (1 subgoal):
 1. Suc (length \<KK>) \<le> length \<GG>
[PROOF STEP]
using n'(2)
[PROOF STATE]
proof (prove)
using this:
length \<KK> = n
n < length \<GG>

goal (1 subgoal):
 1. Suc (length \<KK>) \<le> length \<GG>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc (length \<KK>) \<le> length \<GG>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence multisets\<HH>butlast\<KK>:"mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)"
[PROOF STATE]
proof (prove)
using this:
Suc (length \<KK>) \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)
[PROOF STEP]
using  "1.hyps" grp\<HH>Pm.is_group finHbl \<HH>butlast.is_composition_series \<KK>.is_composition_series
[PROOF STATE]
proof (prove)
using this:
Suc (length \<KK>) \<le> length \<GG>
\<forall>m. Suc m \<le> length \<GG> \<longrightarrow> (\<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. Group.group xb \<longrightarrow> finite (carrier xb) \<longrightarrow> composition_series xb x \<longrightarrow> composition_series xb xa \<longrightarrow> mset (map group.iso_class (normal_series.quotients xb x)) = mset (map group.iso_class (normal_series.quotients xb xa))))
Group.group \<HH>Pm
finite (carrier \<HH>Pm)
composition_series \<HH>Pm (take m \<HH>)
composition_series \<HH>Pm \<KK>

goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence length\<KK>:"m = length \<KK>"
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)

goal (1 subgoal):
 1. m = length \<KK>
[PROOF STEP]
using \<HH>butlast.quotients_length \<KK>.quotients_length length_map size_mset ltakem
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)
length \<HH>butlast.quotients + 1 = length (take m \<HH>)
length \<KK>.quotients + 1 = length \<KK>
length (map ?f ?xs) = length ?xs
size (mset ?xs) = length ?xs
m = length (take m \<HH>)

goal (1 subgoal):
 1. m = length \<KK>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
m = length \<KK>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence  "length \<KK> > 1" "length \<KK> - 1 > 0" "length \<KK> - 1 \<le> length \<KK>"
[PROOF STATE]
proof (prove)
using this:
m = length \<KK>

goal (1 subgoal):
 1. 1 < length \<KK> &&& 0 < length \<KK> - 1 &&& length \<KK> - 1 \<le> length \<KK>
[PROOF STEP]
using m'(4) length\<HH>big
[PROOF STATE]
proof (prove)
using this:
m = length \<KK>
m - 1 = length \<HH> - 2
3 \<le> length \<HH>

goal (1 subgoal):
 1. 1 < length \<KK> &&& 0 < length \<KK> - 1 &&& length \<KK> - 1 \<le> length \<KK>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length \<KK>
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
hence quots\<KK>notemtpy:"\<KK>.quotients \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
1 < length \<KK>
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>

goal (1 subgoal):
 1. \<KK>.quotients \<noteq> []
[PROOF STEP]
unfolding \<KK>.quotients_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<KK>
0 < length \<KK> - 1
length \<KK> - 1 \<le> length \<KK>

goal (1 subgoal):
 1. map (\<lambda>i. \<HH>Pm\<lparr>carrier := \<KK> ! (i + 1)\<rparr> Mod \<KK> ! i) [0..<length \<KK> - 1] \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<KK>.quotients \<noteq> []

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<KK>butlastadd\<GG>Pn: composition_series \<GG>Pn "(take (length \<KK> - 1) \<KK>) @ [\<GG> ! (n - 1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series \<GG>Pn (take (length \<KK> - 1) \<KK> @ [\<GG> ! (n - 1)])
[PROOF STEP]
using grp\<GG>Pn.composition_series_extend \<KK>butlast.is_composition_series simple\<GG>PnModInt Intnorm\<GG>Pn
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>composition_series (\<GG>Pn\<lparr>carrier := ?H\<rparr>) ?\<HH>; simple_group (\<GG>Pn Mod ?H); ?H \<lhd> \<GG>Pn\<rbrakk> \<Longrightarrow> composition_series \<GG>Pn (?\<HH> @ [carrier \<GG>Pn])
composition_series \<HH>PmInt\<GG>Pn (take (length \<KK> - 1) \<KK>)
simple_group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<GG>Pn

goal (1 subgoal):
 1. composition_series \<GG>Pn (take (length \<KK> - 1) \<KK> @ [\<GG> ! (n - 1)])
[PROOF STEP]
unfolding \<GG>Pn_def \<HH>PmInt\<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>composition_series (G\<lparr>carrier := \<GG> ! (n - 1), carrier := ?H\<rparr>) ?\<HH>; simple_group (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr> Mod ?H); ?H \<lhd> G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>) (?\<HH> @ [carrier (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>)])
composition_series (G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
simple_group (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr> Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<GG> ! (n - 1)\<rparr>) (take (length \<KK> - 1) \<KK> @ [\<GG> ! (n - 1)])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
interpret \<LL>butlastadd\<HH>Pm: composition_series \<HH>Pm "(take (length \<LL> - 1) \<LL>) @ [\<HH> ! (m - 1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composition_series \<HH>Pm (take (length \<LL> - 1) \<LL> @ [\<HH> ! (m - 1)])
[PROOF STEP]
using grp\<HH>Pm.composition_series_extend \<LL>butlast.is_composition_series simple\<HH>PmModInt Intnorm\<HH>Pm
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>composition_series (\<HH>Pm\<lparr>carrier := ?H\<rparr>) ?\<HH>; simple_group (\<HH>Pm Mod ?H); ?H \<lhd> \<HH>Pm\<rbrakk> \<Longrightarrow> composition_series \<HH>Pm (?\<HH> @ [carrier \<HH>Pm])
composition_series \<HH>PmInt\<GG>Pn (take (length \<LL> - 1) \<LL>)
simple_group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> \<HH>Pm

goal (1 subgoal):
 1. composition_series \<HH>Pm (take (length \<LL> - 1) \<LL> @ [\<HH> ! (m - 1)])
[PROOF STEP]
unfolding \<HH>Pm_def \<HH>PmInt\<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>composition_series (G\<lparr>carrier := \<HH> ! (m - 1), carrier := ?H\<rparr>) ?\<HH>; simple_group (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr> Mod ?H); ?H \<lhd> G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>\<rbrakk> \<Longrightarrow> composition_series (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) (?\<HH> @ [carrier (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>)])
composition_series (G\<lparr>carrier := \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)\<rparr>) (take (length \<LL> - 1) \<LL>)
simple_group (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr> Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) \<lhd> G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>

goal (1 subgoal):
 1. composition_series (G\<lparr>carrier := \<HH> ! (m - 1)\<rparr>) (take (length \<LL> - 1) \<LL> @ [\<HH> ! (m - 1)])
[PROOF STEP]
by auto

      \<comment> \<open>Prove equality of those composition series.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "mset (map group.iso_class comp\<GG>.quotients)
                    = mset (map group.iso_class ((butlast comp\<GG>.quotients) @ [last comp\<GG>.quotients]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))
[PROOF STEP]
using quots\<GG>notempty
[PROOF STATE]
proof (prove)
using this:
comp\<GG>.quotients \<noteq> []

goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients]))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)]))
[PROOF STEP]
using comp\<GG>.quotients_butlast comp\<GG>.last_quotient length
[PROOF STATE]
proof (prove)
using this:
1 < length \<GG> \<Longrightarrow> butlast comp\<GG>.quotients = normal_series.quotients (G\<lparr>carrier := \<GG> ! (length \<GG> - 1 - 1)\<rparr>) (take (length \<GG> - 1) \<GG>)
1 < length \<GG> \<Longrightarrow> last comp\<GG>.quotients = G Mod \<GG> ! (length \<GG> - 1 - 1)
3 \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)]))
[PROOF STEP]
unfolding n_def \<GG>Pn_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<GG> \<Longrightarrow> butlast comp\<GG>.quotients = normal_series.quotients (G\<lparr>carrier := \<GG> ! (length \<GG> - 1 - 1)\<rparr>) (take (length \<GG> - 1) \<GG>)
1 < length \<GG> \<Longrightarrow> last comp\<GG>.quotients = G Mod \<GG> ! (length \<GG> - 1 - 1)
3 \<le> length \<GG>

goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (normal_series.quotients (G\<lparr>carrier := \<GG> ! (length \<GG> - 1 - 1)\<rparr>) (take (length \<GG> - 1) \<GG>) @ [G Mod \<GG> ! (length \<GG> - 1 - 1)]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)]))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast comp\<GG>.quotients @ [last comp\<GG>.quotients])) = mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)]))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class ((butlast \<LL>.quotients) @ [last \<LL>.quotients])) + {# group.iso_class (G Mod \<GG> ! (n - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)])) = mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#}
[PROOF STEP]
using multisets\<GG>butlast\<LL> quots\<LL>notemtpy
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<GG>butlast.quotients) = mset (map group.iso_class \<LL>.quotients)
\<LL>.quotients \<noteq> []

goal (1 subgoal):
 1. mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)])) = mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)])) = mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<GG>butlast.quotients @ [G Mod \<GG> ! (n - 1)])) = mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {# group.iso_class (G Mod \<GG> ! (n - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#}
[PROOF STEP]
using \<LL>.quotients_butlast \<LL>.last_quotient \<open>length \<LL> > 1\<close> \<LL>sndlast Inteq\<LL>sndlast
[PROOF STATE]
proof (prove)
using this:
1 < length \<LL> \<Longrightarrow> butlast \<LL>.quotients = normal_series.quotients (\<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>) (take (length \<LL> - 1) \<LL>)
1 < length \<LL> \<Longrightarrow> last \<LL>.quotients = \<GG>Pn Mod \<LL> ! (length \<LL> - 1 - 1)
1 < length \<LL>
\<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<LL> ! (length \<LL> - 1 - 1)

goal (1 subgoal):
 1. mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#}
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<LL> \<Longrightarrow> butlast \<LL>.quotients = normal_series.quotients (\<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>) (take (length \<LL> - 1) \<LL>)
1 < length \<LL> \<Longrightarrow> last \<LL>.quotients = \<GG>Pn Mod \<LL> ! (length \<LL> - 1 - 1)
1 < length \<LL>
\<HH>PmInt\<GG>Pn = \<GG>Pn\<lparr>carrier := \<LL> ! (length \<LL> - 1 - 1)\<rparr>
\<HH> ! (m - 1) \<inter> \<GG> ! (length \<GG> - 1 - 1) = \<LL> ! (length \<LL> - 1 - 1)

goal (1 subgoal):
 1. mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#group.iso_class (G Mod \<GG> ! (length \<GG> - 1 - 1))#} = mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (length \<GG> - 1 - 1)])) + {#group.iso_class (G Mod \<GG> ! (length \<GG> - 1 - 1))#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast \<LL>.quotients @ [last \<LL>.quotients])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<KK>butlast.quotients) + {# group.iso_class (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) #} + {# group.iso_class (G Mod \<GG> ! (n - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#}
[PROOF STEP]
using multisets\<KK>\<LL>butlast
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<LL>butlast.quotients) = mset (map group.iso_class \<KK>butlast.quotients)

goal (1 subgoal):
 1. mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (\<LL>butlast.quotients @ [\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)])) + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<KK>butlast.quotients) + {# group.iso_class (G Mod \<HH> ! (m - 1)) #} + {# group.iso_class (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#}
[PROOF STEP]
using \<phi> \<psi>2 iso_classes_iff grp\<GG>PnMod\<HH>Pmint\<GG>Pn.is_group grpGMod\<HH>Pm.is_group grpGMod\<GG>Pn.is_group grp\<HH>PmMod\<HH>Pmint\<GG>Pn.is_group
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> Group.iso (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) (G Mod \<HH> ! (m - 1))
\<psi>2 \<in> Group.iso (G Mod \<GG> ! (n - 1)) (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
\<lbrakk>Group.group ?G; Group.group ?H\<rbrakk> \<Longrightarrow> (\<exists>\<phi>. \<phi> \<in> Group.iso ?G ?H) = (group.iso_class ?G = group.iso_class ?H)
Group.group (\<GG>Pn Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))
Group.group (G Mod \<HH> ! (m - 1))
Group.group (G Mod \<GG> ! (n - 1))
Group.group (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1))

goal (1 subgoal):
 1. mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<GG>PnMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<KK>butlast.quotients) + {# group.iso_class (\<HH>Pm Mod \<HH> ! (m - 1) \<inter> \<GG> ! (n - 1)) #} + {# group.iso_class (G Mod \<HH> ! (m - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<KK>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} = mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class ((butlast \<KK>.quotients) @ [last \<KK>.quotients])) + {# group.iso_class (G Mod \<HH> ! (m - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#}
[PROOF STEP]
using \<KK>.quotients_butlast \<KK>.last_quotient \<open>length \<KK> > 1\<close> \<KK>sndlast Inteq\<KK>sndlast
[PROOF STATE]
proof (prove)
using this:
1 < length \<KK> \<Longrightarrow> butlast \<KK>.quotients = normal_series.quotients (\<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
1 < length \<KK> \<Longrightarrow> last \<KK>.quotients = \<HH>Pm Mod \<KK> ! (length \<KK> - 1 - 1)
1 < length \<KK>
\<HH>PmInt\<GG>Pn = \<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>
\<HH> ! (m - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal (1 subgoal):
 1. mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#}
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<KK> \<Longrightarrow> butlast \<KK>.quotients = normal_series.quotients (\<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>) (take (length \<KK> - 1) \<KK>)
1 < length \<KK> \<Longrightarrow> last \<KK>.quotients = \<HH>Pm Mod \<KK> ! (length \<KK> - 1 - 1)
1 < length \<KK>
\<HH>PmInt\<GG>Pn = \<HH>Pm\<lparr>carrier := \<KK> ! (length \<KK> - 1 - 1)\<rparr>
\<HH> ! (length \<HH> - 1 - 1) \<inter> \<GG> ! (n - 1) = \<KK> ! (length \<KK> - 1 - 1)

goal (1 subgoal):
 1. mset (map group.iso_class \<KK>butlast.quotients) + {#group.iso_class (\<HH>Pm Mod \<HH> ! (length \<HH> - 1 - 1) \<inter> \<GG> ! (n - 1))#} + {#group.iso_class (G Mod \<HH> ! (length \<HH> - 1 - 1))#} = mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#group.iso_class (G Mod \<HH> ! (length \<HH> - 1 - 1))#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<KK>butlast.quotients) + {#grp\<HH>PmMod\<HH>Pmint\<GG>Pn.iso_class#} + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class \<HH>butlast.quotients) + {# group.iso_class (G Mod \<HH> ! (m - 1)) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#}
[PROOF STEP]
using multisets\<HH>butlast\<KK> quots\<KK>notemtpy
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class \<HH>butlast.quotients) = mset (map group.iso_class \<KK>.quotients)
\<KK>.quotients \<noteq> []

goal (1 subgoal):
 1. mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast \<KK>.quotients @ [last \<KK>.quotients])) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#}

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class ((butlast comp\<HH>.quotients) @ [last comp\<HH>.quotients]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
using comp\<HH>.quotients_butlast comp\<HH>.last_quotient length\<HH>big
[PROOF STATE]
proof (prove)
using this:
1 < length \<HH> \<Longrightarrow> butlast comp\<HH>.quotients = normal_series.quotients (G\<lparr>carrier := \<HH> ! (length \<HH> - 1 - 1)\<rparr>) (take (length \<HH> - 1) \<HH>)
1 < length \<HH> \<Longrightarrow> last comp\<HH>.quotients = G Mod \<HH> ! (length \<HH> - 1 - 1)
3 \<le> length \<HH>

goal (1 subgoal):
 1. mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
unfolding m_def \<HH>Pm_def
[PROOF STATE]
proof (prove)
using this:
1 < length \<HH> \<Longrightarrow> butlast comp\<HH>.quotients = normal_series.quotients (G\<lparr>carrier := \<HH> ! (length \<HH> - 1 - 1)\<rparr>) (take (length \<HH> - 1) \<HH>)
1 < length \<HH> \<Longrightarrow> last comp\<HH>.quotients = G Mod \<HH> ! (length \<HH> - 1 - 1)
3 \<le> length \<HH>

goal (1 subgoal):
 1. mset (map group.iso_class (normal_series.quotients (G\<lparr>carrier := \<HH> ! (length \<HH> - 1 - 1)\<rparr>) (take (length \<HH> - 1) \<HH>))) + {#group.iso_class (G Mod \<HH> ! (length \<HH> - 1 - 1))#} = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class \<HH>butlast.quotients) + {#grpGMod\<HH>Pm.iso_class#} = mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients]))

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
have "\<dots> = mset (map group.iso_class comp\<HH>.quotients)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
using quots\<HH>notempty
[PROOF STATE]
proof (prove)
using this:
comp\<HH>.quotients \<noteq> []

goal (1 subgoal):
 1. mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class (butlast comp\<HH>.quotients @ [last comp\<HH>.quotients])) = mset (map group.iso_class comp\<HH>.quotients)

goal (1 subgoal):
 1. \<HH> ! (m - 1) \<noteq> \<GG> ! (n - 1) \<Longrightarrow> mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal (1 subgoal):
 1. mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mset (map group.iso_class comp\<GG>.quotients) = mset (map group.iso_class comp\<HH>.quotients)

goal:
No subgoals!
[PROOF STEP]
qed