berghofe@13403: (* Title: HOL/Extraction.thy berghofe@13403: Author: Stefan Berghofer, TU Muenchen berghofe@13403: *) berghofe@13403: berghofe@13403: header {* Program extraction for HOL *} berghofe@13403: nipkow@15131: theory Extraction blanchet@58112: imports Option nipkow@15131: begin berghofe@13403: wenzelm@48891: ML_file "Tools/rewrite_hol_proof.ML" wenzelm@48891: berghofe@13403: subsection {* Setup *} berghofe@13403: wenzelm@16121: setup {* wenzelm@18708: Extraction.add_types berghofe@29930: [("bool", ([], NONE))] #> wenzelm@18708: Extraction.set_preprocessor (fn thy => berghofe@13403: Proofterm.rewrite_proof_notypes wenzelm@28797: ([], RewriteHOLProof.elim_cong :: ProofRewriteRules.rprocs true) o wenzelm@17203: Proofterm.rewrite_proof thy berghofe@37233: (RewriteHOLProof.rews, berghofe@37233: ProofRewriteRules.rprocs true @ [ProofRewriteRules.expand_of_class thy]) o haftmann@27982: ProofRewriteRules.elim_vars (curry Const @{const_name default})) berghofe@13403: *} berghofe@13403: berghofe@13403: lemmas [extraction_expand] = berghofe@22281: meta_spec atomize_eq atomize_all atomize_imp atomize_conj berghofe@13403: allE rev_mp conjE Eq_TrueI Eq_FalseI eqTrueI eqTrueE eq_cong2 haftmann@20941: notE' impE' impE iffE imp_cong simp_thms eq_True eq_False wenzelm@18456: induct_forall_eq induct_implies_eq induct_equal_eq induct_conj_eq berghofe@34913: induct_atomize induct_atomize' induct_rulify induct_rulify' berghofe@34913: induct_rulify_fallback induct_trueI berghofe@25424: True_implies_equals TrueE berghofe@13403: wenzelm@33704: lemmas [extraction_expand_def] = wenzelm@33704: induct_forall_def induct_implies_def induct_equal_def induct_conj_def berghofe@34913: induct_true_def induct_false_def wenzelm@33704: blanchet@58350: datatype (plugins only: code extraction) sumbool = Left | Right berghofe@13403: berghofe@13403: subsection {* Type of extracted program *} berghofe@13403: berghofe@13403: extract_type berghofe@13403: "typeof (Trueprop P) \ typeof P" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE(Null)) \ typeof Q \ Type (TYPE('Q)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('Q))" berghofe@13403: berghofe@13403: "typeof Q \ Type (TYPE(Null)) \ typeof (P \ Q) \ Type (TYPE(Null))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE('P)) \ typeof Q \ Type (TYPE('Q)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('P \ 'Q))" berghofe@13403: berghofe@13403: "(\x. typeof (P x)) \ (\x. Type (TYPE(Null))) \ berghofe@13403: typeof (\x. P x) \ Type (TYPE(Null))" berghofe@13403: berghofe@13403: "(\x. typeof (P x)) \ (\x. Type (TYPE('P))) \ berghofe@13403: typeof (\x::'a. P x) \ Type (TYPE('a \ 'P))" berghofe@13403: berghofe@13403: "(\x. typeof (P x)) \ (\x. Type (TYPE(Null))) \ berghofe@13403: typeof (\x::'a. P x) \ Type (TYPE('a))" berghofe@13403: berghofe@13403: "(\x. typeof (P x)) \ (\x. Type (TYPE('P))) \ berghofe@13403: typeof (\x::'a. P x) \ Type (TYPE('a \ 'P))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE(Null)) \ typeof Q \ Type (TYPE(Null)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE(sumbool))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE(Null)) \ typeof Q \ Type (TYPE('Q)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('Q option))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE('P)) \ typeof Q \ Type (TYPE(Null)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('P option))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE('P)) \ typeof Q \ Type (TYPE('Q)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('P + 'Q))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE(Null)) \ typeof Q \ Type (TYPE('Q)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('Q))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE('P)) \ typeof Q \ Type (TYPE(Null)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('P))" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE('P)) \ typeof Q \ Type (TYPE('Q)) \ berghofe@13403: typeof (P \ Q) \ Type (TYPE('P \ 'Q))" berghofe@13403: berghofe@13403: "typeof (P = Q) \ typeof ((P \ Q) \ (Q \ P))" berghofe@13403: berghofe@13403: "typeof (x \ P) \ typeof P" berghofe@13403: berghofe@13403: subsection {* Realizability *} berghofe@13403: berghofe@13403: realizability berghofe@13403: "(realizes t (Trueprop P)) \ (Trueprop (realizes t P))" berghofe@13403: berghofe@13403: "(typeof P) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ (realizes Null P \ realizes t Q)" berghofe@13403: berghofe@13403: "(typeof P) \ (Type (TYPE('P))) \ berghofe@13403: (typeof Q) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ (\x::'P. realizes x P \ realizes Null Q)" berghofe@13403: berghofe@13403: "(realizes t (P \ Q)) \ (\x. realizes x P \ realizes (t x) Q)" berghofe@13403: berghofe@13403: "(\x. typeof (P x)) \ (\x. Type (TYPE(Null))) \ berghofe@13403: (realizes t (\x. P x)) \ (\x. realizes Null (P x))" berghofe@13403: berghofe@13403: "(realizes t (\x. P x)) \ (\x. realizes (t x) (P x))" berghofe@13403: berghofe@13403: "(\x. typeof (P x)) \ (\x. Type (TYPE(Null))) \ berghofe@13403: (realizes t (\x. P x)) \ (realizes Null (P t))" berghofe@13403: berghofe@13403: "(realizes t (\x. P x)) \ (realizes (snd t) (P (fst t)))" berghofe@13403: berghofe@13403: "(typeof P) \ (Type (TYPE(Null))) \ berghofe@13403: (typeof Q) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ berghofe@13403: (case t of Left \ realizes Null P | Right \ realizes Null Q)" berghofe@13403: berghofe@13403: "(typeof P) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ berghofe@13403: (case t of None \ realizes Null P | Some q \ realizes q Q)" berghofe@13403: berghofe@13403: "(typeof Q) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ berghofe@13403: (case t of None \ realizes Null Q | Some p \ realizes p P)" berghofe@13403: berghofe@13403: "(realizes t (P \ Q)) \ berghofe@13403: (case t of Inl p \ realizes p P | Inr q \ realizes q Q)" berghofe@13403: berghofe@13403: "(typeof P) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ (realizes Null P \ realizes t Q)" berghofe@13403: berghofe@13403: "(typeof Q) \ (Type (TYPE(Null))) \ berghofe@13403: (realizes t (P \ Q)) \ (realizes t P \ realizes Null Q)" berghofe@13403: berghofe@13403: "(realizes t (P \ Q)) \ (realizes (fst t) P \ realizes (snd t) Q)" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE(Null)) \ berghofe@13403: realizes t (\ P) \ \ realizes Null P" berghofe@13403: berghofe@13403: "typeof P \ Type (TYPE('P)) \ berghofe@13403: realizes t (\ P) \ (\x::'P. \ realizes x P)" berghofe@13403: berghofe@13403: "typeof (P::bool) \ Type (TYPE(Null)) \ berghofe@13403: typeof Q \ Type (TYPE(Null)) \ berghofe@13403: realizes t (P = Q) \ realizes Null P = realizes Null Q" berghofe@13403: berghofe@13403: "(realizes t (P = Q)) \ (realizes t ((P \ Q) \ (Q \ P)))" berghofe@13403: berghofe@13403: subsection {* Computational content of basic inference rules *} berghofe@13403: berghofe@13403: theorem disjE_realizer: berghofe@13403: assumes r: "case x of Inl p \ P p | Inr q \ Q q" berghofe@13403: and r1: "\p. P p \ R (f p)" and r2: "\q. Q q \ R (g q)" berghofe@13403: shows "R (case x of Inl p \ f p | Inr q \ g q)" berghofe@13403: proof (cases x) berghofe@13403: case Inl berghofe@13403: with r show ?thesis by simp (rule r1) berghofe@13403: next berghofe@13403: case Inr berghofe@13403: with r show ?thesis by simp (rule r2) berghofe@13403: qed berghofe@13403: berghofe@13403: theorem disjE_realizer2: berghofe@13403: assumes r: "case x of None \ P | Some q \ Q q" berghofe@13403: and r1: "P \ R f" and r2: "\q. Q q \ R (g q)" berghofe@13403: shows "R (case x of None \ f | Some q \ g q)" berghofe@13403: proof (cases x) berghofe@13403: case None berghofe@13403: with r show ?thesis by simp (rule r1) berghofe@13403: next berghofe@13403: case Some berghofe@13403: with r show ?thesis by simp (rule r2) berghofe@13403: qed berghofe@13403: berghofe@13403: theorem disjE_realizer3: berghofe@13403: assumes r: "case x of Left \ P | Right \ Q" berghofe@13403: and r1: "P \ R f" and r2: "Q \ R g" berghofe@13403: shows "R (case x of Left \ f | Right \ g)" berghofe@13403: proof (cases x) berghofe@13403: case Left berghofe@13403: with r show ?thesis by simp (rule r1) berghofe@13403: next berghofe@13403: case Right berghofe@13403: with r show ?thesis by simp (rule r2) berghofe@13403: qed berghofe@13403: berghofe@13403: theorem conjI_realizer: berghofe@13403: "P p \ Q q \ P (fst (p, q)) \ Q (snd (p, q))" berghofe@13403: by simp berghofe@13403: berghofe@13403: theorem exI_realizer: berghofe@13918: "P y x \ P (snd (x, y)) (fst (x, y))" by simp berghofe@13918: berghofe@13918: theorem exE_realizer: "P (snd p) (fst p) \ berghofe@15393: (\x y. P y x \ Q (f x y)) \ Q (let (x, y) = p in f x y)" berghofe@15393: by (cases p) (simp add: Let_def) berghofe@13918: berghofe@13918: theorem exE_realizer': "P (snd p) (fst p) \ berghofe@13918: (\x y. P y x \ Q) \ Q" by (cases p) simp berghofe@13403: berghofe@13403: realizers berghofe@13725: impI (P, Q): "\pq. pq" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q pq (h: _). allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h \ x))" berghofe@13403: berghofe@13403: impI (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q (h: _). allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h \ x))" berghofe@13403: wenzelm@52486: impI (Q): "\q. q" "\<^bold>\(c: _) P Q q. impI \ _ \ _" berghofe@13403: berghofe@13725: impI: "Null" "impI" berghofe@13403: berghofe@13725: mp (P, Q): "\pq. pq" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q pq (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ c \ h)" berghofe@13403: berghofe@13403: mp (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ c \ h)" berghofe@13403: wenzelm@52486: mp (Q): "\q. q" "\<^bold>\(c: _) P Q q. mp \ _ \ _" berghofe@13403: berghofe@13725: mp: "Null" "mp" berghofe@13403: wenzelm@52486: allI (P): "\p. p" "\<^bold>\(c: _) P (d: _) p. allI \ _ \ d" berghofe@13403: berghofe@13725: allI: "Null" "allI" berghofe@13403: wenzelm@52486: spec (P): "\x p. p x" "\<^bold>\(c: _) P x (d: _) p. spec \ _ \ x \ d" berghofe@13403: berghofe@13725: spec: "Null" "spec" berghofe@13403: wenzelm@52486: exI (P): "\x p. (x, p)" "\<^bold>\(c: _) P x (d: _) p. exI_realizer \ P \ p \ x \ c \ d" berghofe@13403: wenzelm@52486: exI: "\x. x" "\<^bold>\P x (c: _) (h: _). h" berghofe@13403: berghofe@15393: exE (P, Q): "\p pq. let (x, y) = p in pq x y" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q (e: _) p (h: _) pq. exE_realizer \ P \ p \ Q \ pq \ c \ e \ d \ h" berghofe@13403: berghofe@13403: exE (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q (d: _) p. exE_realizer' \ _ \ _ \ _ \ c \ d" berghofe@13403: berghofe@13725: exE (Q): "\x pq. pq x" wenzelm@52486: "\<^bold>\(c: _) P Q (d: _) x (h1: _) pq (h2: _). h2 \ x \ h1" berghofe@13403: berghofe@13403: exE: "Null" wenzelm@52486: "\<^bold>\P Q (c: _) x (h1: _) (h2: _). h2 \ x \ h1" berghofe@13403: berghofe@13725: conjI (P, Q): "Pair" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q p (h: _) q. conjI_realizer \ P \ p \ Q \ q \ c \ d \ h" berghofe@13403: berghofe@13725: conjI (P): "\p. p" wenzelm@52486: "\<^bold>\(c: _) P Q p. conjI \ _ \ _" berghofe@13403: berghofe@13725: conjI (Q): "\q. q" wenzelm@52486: "\<^bold>\(c: _) P Q (h: _) q. conjI \ _ \ _ \ h" berghofe@13403: berghofe@13725: conjI: "Null" "conjI" berghofe@13403: berghofe@13725: conjunct1 (P, Q): "fst" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q pq. conjunct1 \ _ \ _" berghofe@13403: berghofe@13725: conjunct1 (P): "\p. p" wenzelm@52486: "\<^bold>\(c: _) P Q p. conjunct1 \ _ \ _" berghofe@13403: berghofe@13403: conjunct1 (Q): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q q. conjunct1 \ _ \ _" berghofe@13403: berghofe@13725: conjunct1: "Null" "conjunct1" berghofe@13403: berghofe@13725: conjunct2 (P, Q): "snd" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q pq. conjunct2 \ _ \ _" berghofe@13403: berghofe@13403: conjunct2 (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q p. conjunct2 \ _ \ _" berghofe@13403: berghofe@13725: conjunct2 (Q): "\p. p" wenzelm@52486: "\<^bold>\(c: _) P Q p. conjunct2 \ _ \ _" berghofe@13403: berghofe@13725: conjunct2: "Null" "conjunct2" berghofe@13725: berghofe@13725: disjI1 (P, Q): "Inl" blanchet@55642: "\<^bold>\(c: _) (d: _) P Q p. iffD2 \ _ \ _ \ (sum.case_1 \ P \ _ \ p \ arity_type_bool \ c \ d)" berghofe@13403: berghofe@13725: disjI1 (P): "Some" blanchet@55642: "\<^bold>\(c: _) P Q p. iffD2 \ _ \ _ \ (option.case_2 \ _ \ P \ p \ arity_type_bool \ c)" berghofe@13403: berghofe@13725: disjI1 (Q): "None" blanchet@55642: "\<^bold>\(c: _) P Q. iffD2 \ _ \ _ \ (option.case_1 \ _ \ _ \ arity_type_bool \ c)" berghofe@13403: berghofe@13725: disjI1: "Left" blanchet@55642: "\<^bold>\P Q. iffD2 \ _ \ _ \ (sumbool.case_1 \ _ \ _ \ arity_type_bool)" berghofe@13403: berghofe@13725: disjI2 (P, Q): "Inr" blanchet@55642: "\<^bold>\(d: _) (c: _) Q P q. iffD2 \ _ \ _ \ (sum.case_2 \ _ \ Q \ q \ arity_type_bool \ c \ d)" berghofe@13403: berghofe@13725: disjI2 (P): "None" blanchet@55642: "\<^bold>\(c: _) Q P. iffD2 \ _ \ _ \ (option.case_1 \ _ \ _ \ arity_type_bool \ c)" berghofe@13403: berghofe@13725: disjI2 (Q): "Some" blanchet@55642: "\<^bold>\(c: _) Q P q. iffD2 \ _ \ _ \ (option.case_2 \ _ \ Q \ q \ arity_type_bool \ c)" berghofe@13403: berghofe@13725: disjI2: "Right" blanchet@55642: "\<^bold>\Q P. iffD2 \ _ \ _ \ (sumbool.case_2 \ _ \ _ \ arity_type_bool)" berghofe@13403: berghofe@13725: disjE (P, Q, R): "\pq pr qr. berghofe@13403: (case pq of Inl p \ pr p | Inr q \ qr q)" wenzelm@52486: "\<^bold>\(c: _) (d: _) (e: _) P Q R pq (h1: _) pr (h2: _) qr. berghofe@37233: disjE_realizer \ _ \ _ \ pq \ R \ pr \ qr \ c \ d \ e \ h1 \ h2" berghofe@13403: berghofe@13725: disjE (Q, R): "\pq pr qr. berghofe@13403: (case pq of None \ pr | Some q \ qr q)" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr. berghofe@37233: disjE_realizer2 \ _ \ _ \ pq \ R \ pr \ qr \ c \ d \ h1 \ h2" berghofe@13403: berghofe@13725: disjE (P, R): "\pq pr qr. berghofe@13403: (case pq of None \ qr | Some p \ pr p)" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr (h3: _). berghofe@37233: disjE_realizer2 \ _ \ _ \ pq \ R \ qr \ pr \ c \ d \ h1 \ h3 \ h2" berghofe@13403: berghofe@13725: disjE (R): "\pq pr qr. berghofe@13403: (case pq of Left \ pr | Right \ qr)" wenzelm@52486: "\<^bold>\(c: _) P Q R pq (h1: _) pr (h2: _) qr. berghofe@37233: disjE_realizer3 \ _ \ _ \ pq \ R \ pr \ qr \ c \ h1 \ h2" berghofe@13403: berghofe@13403: disjE (P, Q): "Null" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q R pq. disjE_realizer \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ d \ arity_type_bool" berghofe@13403: berghofe@13403: disjE (Q): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q R pq. disjE_realizer2 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ arity_type_bool" berghofe@13403: berghofe@13403: disjE (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q R pq (h1: _) (h2: _) (h3: _). berghofe@37233: disjE_realizer2 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ arity_type_bool \ h1 \ h3 \ h2" berghofe@13403: berghofe@13403: disjE: "Null" wenzelm@52486: "\<^bold>\P Q R pq. disjE_realizer3 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ arity_type_bool" berghofe@13403: haftmann@27982: FalseE (P): "default" wenzelm@52486: "\<^bold>\(c: _) P. FalseE \ _" berghofe@13403: berghofe@13725: FalseE: "Null" "FalseE" berghofe@13403: berghofe@13403: notI (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P (h: _). allI \ _ \ c \ (\<^bold>\x. notI \ _ \ (h \ x))" berghofe@13403: berghofe@13725: notI: "Null" "notI" berghofe@13403: haftmann@27982: notE (P, R): "\p. default" wenzelm@52486: "\<^bold>\(c: _) (d: _) P R (h: _) p. notE \ _ \ _ \ (spec \ _ \ p \ c \ h)" berghofe@13403: berghofe@13403: notE (P): "Null" wenzelm@52486: "\<^bold>\(c: _) P R (h: _) p. notE \ _ \ _ \ (spec \ _ \ p \ c \ h)" berghofe@13403: haftmann@27982: notE (R): "default" wenzelm@52486: "\<^bold>\(c: _) P R. notE \ _ \ _" berghofe@13403: berghofe@13725: notE: "Null" "notE" berghofe@13403: berghofe@13725: subst (P): "\s t ps. ps" wenzelm@52486: "\<^bold>\(c: _) s t P (d: _) (h: _) ps. subst \ s \ t \ P ps \ d \ h" berghofe@13403: berghofe@13725: subst: "Null" "subst" berghofe@13725: berghofe@13725: iffD1 (P, Q): "fst" wenzelm@52486: "\<^bold>\(d: _) (c: _) Q P pq (h: _) p. berghofe@37233: mp \ _ \ _ \ (spec \ _ \ p \ d \ (conjunct1 \ _ \ _ \ h))" berghofe@13403: berghofe@13725: iffD1 (P): "\p. p" wenzelm@52486: "\<^bold>\(c: _) Q P p (h: _). mp \ _ \ _ \ (conjunct1 \ _ \ _ \ h)" berghofe@13403: berghofe@13403: iffD1 (Q): "Null" wenzelm@52486: "\<^bold>\(c: _) Q P q1 (h: _) q2. berghofe@37233: mp \ _ \ _ \ (spec \ _ \ q2 \ c \ (conjunct1 \ _ \ _ \ h))" berghofe@13403: berghofe@13725: iffD1: "Null" "iffD1" berghofe@13403: berghofe@13725: iffD2 (P, Q): "snd" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q pq (h: _) q. berghofe@37233: mp \ _ \ _ \ (spec \ _ \ q \ d \ (conjunct2 \ _ \ _ \ h))" berghofe@13403: berghofe@13725: iffD2 (P): "\p. p" wenzelm@52486: "\<^bold>\(c: _) P Q p (h: _). mp \ _ \ _ \ (conjunct2 \ _ \ _ \ h)" berghofe@13403: berghofe@13403: iffD2 (Q): "Null" wenzelm@52486: "\<^bold>\(c: _) P Q q1 (h: _) q2. berghofe@37233: mp \ _ \ _ \ (spec \ _ \ q2 \ c \ (conjunct2 \ _ \ _ \ h))" berghofe@13403: berghofe@13725: iffD2: "Null" "iffD2" berghofe@13403: berghofe@13725: iffI (P, Q): "Pair" wenzelm@52486: "\<^bold>\(c: _) (d: _) P Q pq (h1 : _) qp (h2 : _). conjI_realizer \ berghofe@13725: (\pq. \x. P x \ Q (pq x)) \ pq \ berghofe@13725: (\qp. \x. Q x \ P (qp x)) \ qp \ berghofe@37233: (arity_type_fun \ c \ d) \ berghofe@37233: (arity_type_fun \ d \ c) \ wenzelm@52486: (allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h1 \ x))) \ wenzelm@52486: (allI \ _ \ d \ (\<^bold>\x. impI \ _ \ _ \ (h2 \ x)))" berghofe@13403: berghofe@13725: iffI (P): "\p. p" wenzelm@52486: "\<^bold>\(c: _) P Q (h1 : _) p (h2 : _). conjI \ _ \ _ \ wenzelm@52486: (allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h1 \ x))) \ berghofe@13403: (impI \ _ \ _ \ h2)" berghofe@13403: berghofe@13725: iffI (Q): "\q. q" wenzelm@52486: "\<^bold>\(c: _) P Q q (h1 : _) (h2 : _). conjI \ _ \ _ \ berghofe@13403: (impI \ _ \ _ \ h1) \ wenzelm@52486: (allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h2 \ x)))" berghofe@13403: berghofe@13725: iffI: "Null" "iffI" berghofe@13403: berghofe@13403: end