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/Identity.thy | 2 +- spartan/theories/Spartan.thy | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/spartan/theories/Identity.thy b/spartan/theories/Identity.thy index 0edf20e..19b8b7a 100644 --- a/spartan/theories/Identity.thy +++ b/spartan/theories/Identity.thy @@ -261,7 +261,7 @@ Lemma transport_comp [comps]: "A: U i" "\x. x: A \ P x: U i" shows "trans P (refl a) \ id (P a)" - unfolding transport_def id_def by reduce + unfolding transport_def by reduce \ \TODO: Build transport automation!\ 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