[STATEMENT]
lemma get_host_valid_tag_name:
  assumes "heap_is_wellformed h" and "type_wf h"
  assumes "h \<turnstile> get_host shadow_root_ptr \<rightarrow>\<^sub>r host"
  assumes "h \<turnstile> get_tag_name host \<rightarrow>\<^sub>r tag"
  shows "tag \<in> safe_shadow_root_element_types"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tag \<in> safe_shadow_root_element_types
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tag \<in> safe_shadow_root_element_types
[PROOF STEP]
obtain host' where
    "host' |\<in>| element_ptr_kinds h" and
    "|h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types"
    and "h \<turnstile> get_shadow_root host' \<rightarrow>\<^sub>r Some shadow_root_ptr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>host'. \<lbrakk>host' |\<in>| element_ptr_kinds h; |h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types; h \<turnstile> get_shadow_root host' \<rightarrow>\<^sub>r Some shadow_root_ptr\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
heap_is_wellformed h
type_wf h
h \<turnstile> get_host shadow_root_ptr \<rightarrow>\<^sub>r host
h \<turnstile> get_tag_name host \<rightarrow>\<^sub>r tag

goal (1 subgoal):
 1. (\<And>host'. \<lbrakk>host' |\<in>| element_ptr_kinds h; |h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types; h \<turnstile> get_shadow_root host' \<rightarrow>\<^sub>r Some shadow_root_ptr\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis finite_set_in get_host_ptr_in_heap local.a_shadow_root_valid_def
        local.get_shadow_root_ok local.heap_is_wellformed_def returns_result_select_result)
[PROOF STATE]
proof (state)
this:
host' |\<in>| element_ptr_kinds h
|h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types
h \<turnstile> get_shadow_root host' \<rightarrow>\<^sub>r Some shadow_root_ptr

goal (1 subgoal):
 1. tag \<in> safe_shadow_root_element_types
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
host' |\<in>| element_ptr_kinds h
|h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types
h \<turnstile> get_shadow_root host' \<rightarrow>\<^sub>r Some shadow_root_ptr
[PROOF STEP]
have "host = host'"
[PROOF STATE]
proof (prove)
using this:
host' |\<in>| element_ptr_kinds h
|h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types
h \<turnstile> get_shadow_root host' \<rightarrow>\<^sub>r Some shadow_root_ptr

goal (1 subgoal):
 1. host = host'
[PROOF STEP]
by (meson assms(1) assms(2) assms(3) shadow_root_host_dual shadow_root_same_host)
[PROOF STATE]
proof (state)
this:
host = host'

goal (1 subgoal):
 1. tag \<in> safe_shadow_root_element_types
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
host = host'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
host = host'

goal (1 subgoal):
 1. tag \<in> safe_shadow_root_element_types
[PROOF STEP]
using \<open>|h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types\<close> assms(4)
[PROOF STATE]
proof (prove)
using this:
host = host'
|h \<turnstile> get_tag_name host'|\<^sub>r \<in> safe_shadow_root_element_types
h \<turnstile> get_tag_name host \<rightarrow>\<^sub>r tag

goal (1 subgoal):
 1. tag \<in> safe_shadow_root_element_types
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tag \<in> safe_shadow_root_element_types

goal:
No subgoals!
[PROOF STEP]
qed