[STATEMENT]
lemma sup_gmctxt_least:
  assumes "(D, E) \<in> comp_gmctxt"
    and "D \<le> C" and "E \<le> C"
  shows "D \<squnion> E \<le> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<squnion> E \<le> C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(D, E) \<in> comp_gmctxt
D \<le> C
E \<le> C

goal (1 subgoal):
 1. D \<squnion> E \<le> C
[PROOF STEP]
apply (induct arbitrary: C)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>D C. \<lbrakk>GMHole \<le> C; D \<le> C\<rbrakk> \<Longrightarrow> GMHole \<squnion> D \<le> C
 2. \<And>C Ca. \<lbrakk>C \<le> Ca; GMHole \<le> Ca\<rbrakk> \<Longrightarrow> C \<squnion> GMHole \<le> Ca
 3. \<And>f g Cs Ds C. \<lbrakk>f = g; length Cs = length Ds; \<forall>i<length Ds. (Cs ! i, Ds ! i) \<in> comp_gmctxt \<and> (\<forall>x\<ge>Cs ! i. Ds ! i \<le> x \<longrightarrow> Cs ! i \<squnion> Ds ! i \<le> x); GMFun f Cs \<le> C; GMFun g Ds \<le> C\<rbrakk> \<Longrightarrow> GMFun f Cs \<squnion> GMFun g Ds \<le> C
[PROOF STEP]
apply (auto simp: less_eq_gmctxt_def elim!: inf_gmctxt.elims intro!: nth_equalityI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>Csa Csb Dsb i. \<lbrakk>length Csa = length Dsb; \<forall>i<length Dsb. (Csa ! i, Csb ! i) \<in> comp_gmctxt \<and> (\<forall>x. Csa ! i \<sqinter> x = Csa ! i \<longrightarrow> Csb ! i \<sqinter> x = Csb ! i \<longrightarrow> (Csa ! i \<squnion> Csb ! i) \<sqinter> x = Csa ! i \<squnion> Csb ! i); Csa = map2 (\<sqinter>) Csa Dsb; Csb = map2 (\<sqinter>) Csb Dsb; length Csb = length Dsb; i < length Dsb\<rbrakk> \<Longrightarrow> (Csa ! i \<squnion> Csb ! i) \<sqinter> Dsb ! i = Csa ! i \<squnion> Csb ! i
 2. \<And>Csa fb Csb gb Dsb. \<lbrakk>length Csa = length Csb; \<forall>i<length Csb. (Csa ! i, Csb ! i) \<in> comp_gmctxt \<and> (\<forall>x. Csa ! i \<sqinter> x = Csa ! i \<longrightarrow> Csb ! i \<sqinter> x = Csb ! i \<longrightarrow> (Csa ! i \<squnion> Csb ! i) \<sqinter> x = Csa ! i \<squnion> Csb ! i); GMFun fb Csa = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csa Dsb) else GMHole); GMFun fb Csb = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csb Dsb) else GMHole)\<rbrakk> \<Longrightarrow> fb = gb
 3. \<And>Csa fb Csb gb Dsb. \<lbrakk>length Csa = length Csb; \<forall>i<length Csb. (Csa ! i, Csb ! i) \<in> comp_gmctxt \<and> (\<forall>x. Csa ! i \<sqinter> x = Csa ! i \<longrightarrow> Csb ! i \<sqinter> x = Csb ! i \<longrightarrow> (Csa ! i \<squnion> Csb ! i) \<sqinter> x = Csa ! i \<squnion> Csb ! i); GMFun fb Csa = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csa Dsb) else GMHole); GMFun fb Csb = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csb Dsb) else GMHole)\<rbrakk> \<Longrightarrow> length Csb = length Dsb
[PROOF STEP]
apply (metis (erased, lifting) length_map nth_map nth_zip split_conv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>Csa fb Csb gb Dsb. \<lbrakk>length Csa = length Csb; \<forall>i<length Csb. (Csa ! i, Csb ! i) \<in> comp_gmctxt \<and> (\<forall>x. Csa ! i \<sqinter> x = Csa ! i \<longrightarrow> Csb ! i \<sqinter> x = Csb ! i \<longrightarrow> (Csa ! i \<squnion> Csb ! i) \<sqinter> x = Csa ! i \<squnion> Csb ! i); GMFun fb Csa = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csa Dsb) else GMHole); GMFun fb Csb = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csb Dsb) else GMHole)\<rbrakk> \<Longrightarrow> fb = gb
 2. \<And>Csa fb Csb gb Dsb. \<lbrakk>length Csa = length Csb; \<forall>i<length Csb. (Csa ! i, Csb ! i) \<in> comp_gmctxt \<and> (\<forall>x. Csa ! i \<sqinter> x = Csa ! i \<longrightarrow> Csb ! i \<sqinter> x = Csb ! i \<longrightarrow> (Csa ! i \<squnion> Csb ! i) \<sqinter> x = Csa ! i \<squnion> Csb ! i); GMFun fb Csa = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csa Dsb) else GMHole); GMFun fb Csb = (if fb = gb \<and> length Csb = length Dsb then GMFun fb (map2 (\<sqinter>) Csb Dsb) else GMHole)\<rbrakk> \<Longrightarrow> length Csb = length Dsb
[PROOF STEP]
apply (case_tac "fb = gb \<and> length Csb = length Dsb", simp_all)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done