src/FOL/ex/Locale_Test/Locale_Test1.thy
changeset 62020 5d208fd2507d
parent 61701 e89cfc004f18
child 67119 acb0807ddb56
equal deleted inserted replaced
62019:9de1eb745aeb 62020:5d208fd2507d
    84 print_locale! perturbation thm perturbation_def
    84 print_locale! perturbation thm perturbation_def
    85 
    85 
    86 locale pert_hom = d1: perturbation f d1 + d2: perturbation f d2 for f d1 d2
    86 locale pert_hom = d1: perturbation f d1 + d2: perturbation f d2 for f d1 d2
    87 print_locale! pert_hom thm pert_hom_def
    87 print_locale! pert_hom thm pert_hom_def
    88 
    88 
    89 text \<open>Alternative expression, obtaining nicer names in @{text "semi f"}.\<close>
    89 text \<open>Alternative expression, obtaining nicer names in \<open>semi f\<close>.\<close>
    90 locale pert_hom' = semi f + d1: perturbation f d1 + d2: perturbation f d2 for f d1 d2
    90 locale pert_hom' = semi f + d1: perturbation f d1 + d2: perturbation f d2 for f d1 d2
    91 print_locale! pert_hom' thm pert_hom'_def
    91 print_locale! pert_hom' thm pert_hom'_def
    92 
    92 
    93 
    93 
    94 section \<open>Syntax declarations\<close>
    94 section \<open>Syntax declarations\<close>
   729 sublocale lgrp < "def"?: dgrp
   729 sublocale lgrp < "def"?: dgrp
   730   rewrites one_equation: "dgrp.one(prod) = one" and inv_equation: "dgrp.inv(prod, x) = inv(x)"
   730   rewrites one_equation: "dgrp.one(prod) = one" and inv_equation: "dgrp.inv(prod, x) = inv(x)"
   731 proof -
   731 proof -
   732   show "dgrp(prod)" by unfold_locales
   732   show "dgrp(prod)" by unfold_locales
   733   from this interpret d: dgrp .
   733   from this interpret d: dgrp .
   734   -- Unit
   734   \<comment> Unit
   735   have "dgrp.one(prod) = glob_one(prod)" by (rule d.one_def)
   735   have "dgrp.one(prod) = glob_one(prod)" by (rule d.one_def)
   736   also have "... = glob_one(prod) ** one" by (simp add: rone)
   736   also have "... = glob_one(prod) ** one" by (simp add: rone)
   737   also have "... = one" by (simp add: glob_lone)
   737   also have "... = one" by (simp add: glob_lone)
   738   finally show "dgrp.one(prod) = one" .
   738   finally show "dgrp.one(prod) = one" .
   739   -- Inverse
   739   \<comment> Inverse
   740   then have "dgrp.inv(prod, x) ** x = inv(x) ** x" by (simp add: glob_linv d.linv linv)
   740   then have "dgrp.inv(prod, x) ** x = inv(x) ** x" by (simp add: glob_linv d.linv linv)
   741   then show "dgrp.inv(prod, x) = inv(x)" by (simp add: rcancel)
   741   then show "dgrp.inv(prod, x) = inv(x)" by (simp add: rcancel)
   742 qed
   742 qed
   743 
   743 
   744 print_locale! lgrp
   744 print_locale! lgrp