From 2781c68f0fdb435827097efc497c2172d6050e50 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Thu, 2 Apr 2020 23:27:06 +0200 Subject: 1. make id function an abbrev. 2. fix reduce method --- spartan/theories/Spartan.thy | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'spartan/theories/Spartan.thy') diff --git a/spartan/theories/Spartan.thy b/spartan/theories/Spartan.thy index ac12937..a79f209 100644 --- a/spartan/theories/Spartan.thy +++ b/spartan/theories/Spartan.thy @@ -242,7 +242,7 @@ setup \ ctxt addSolver (mk_solver "" typechk_tac)) \ -method reduce uses add = (simp add: comps add | subst comps, reduce add: add)+ +method reduce uses add = (simp add: comps add | subst comps)+ section \Implicit notations\ @@ -355,23 +355,21 @@ translations "g \ f" \ "g \\<^bsub>A\<^esub> f" subsection \Identity function\ -definition id where "id A \ \x: A. x" +abbreviation id where "id A \ \x: A. x" lemma - idI [typechk]: "A: U i \ id A: A \ A" and - id_comp [comps]: "x: A \ (id A) x \ x" - unfolding id_def by reduce + id_type[typechk]: "A: U i \ id A: A \ A" and + id_comp [comps]: "x: A \ (id A) x \ x" \ \for the occasional manual rewrite\ + by reduce lemma id_left [comps]: assumes "f: A \ B" "A: U i" "B: U i" shows "(id B) \\<^bsub>A\<^esub> f \ f" - unfolding id_def by (subst eta_exp[of f]) (reduce, rule eta) lemma id_right [comps]: assumes "f: A \ B" "A: U i" "B: U i" shows "f \\<^bsub>A\<^esub> (id A) \ f" - unfolding id_def by (subst eta_exp[of f]) (reduce, rule eta) lemma id_U [typechk]: -- cgit v1.2.3