Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 1,330 Bytes
4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
(* Author: Andreas Lochbihler, ETH Zurich *)
section \<open>Examples of applicative lifting\<close>
subsection \<open>Algebraic operations for the environment functor\<close>
theory Applicative_Environment_Algebra imports
Applicative_Environment
"HOL-Library.Function_Division"
begin
text \<open> Link between applicative instance of the environment functor with the pointwise operations
for the algebraic type classes \<close>
context includes applicative_syntax
begin
lemma plus_fun_af [applicative_unfold]: "f + g = pure (+) \<diamondop> f \<diamondop> g"
unfolding plus_fun_def const_def apf_def ..
lemma zero_fun_af [applicative_unfold]: "0 = pure 0"
unfolding zero_fun_def const_def ..
lemma times_fun_af [applicative_unfold]: "f * g = pure (*) \<diamondop> f \<diamondop> g"
unfolding times_fun_def const_def apf_def ..
lemma one_fun_af [applicative_unfold]: "1 = pure 1"
unfolding one_fun_def const_def ..
lemma of_nat_fun_af [applicative_unfold]: "of_nat n = pure (of_nat n)"
unfolding of_nat_fun const_def ..
lemma inverse_fun_af [applicative_unfold]: "inverse f = pure inverse \<diamondop> f"
unfolding inverse_fun_def o_def const_def apf_def ..
lemma divide_fun_af [applicative_unfold]: "divide f g = pure divide \<diamondop> f \<diamondop> g"
unfolding divide_fun_def const_def apf_def ..
end
end
|