# HG changeset patch # User wenzelm # Date 973879590 -3600 # Node ID 7528f9e30ca48ed02752845cc84b422596884375 # Parent 98c421dd597246c9ec6983f26b71858428fde50b improved cong_definition theorems; overloaded standard operations; diff -r 98c421dd5972 -r 7528f9e30ca4 src/HOL/Library/Quotient.thy --- a/src/HOL/Library/Quotient.thy Fri Nov 10 19:05:28 2000 +0100 +++ b/src/HOL/Library/Quotient.thy Fri Nov 10 19:06:30 2000 +0100 @@ -136,35 +136,67 @@ on quotient types. *} -theorem cong_definition1: - "(!!X. f X == g (pick X)) ==> - (!!x x'. x \ x' ==> g x = g x') ==> - f \a\ = g a" +theorem quot_definition1: + "(!!X. f X == \g (pick X)\) ==> + (!!x x'. x \ x' ==> g x \ g x') ==> + f \a\ = \g a\" proof - - assume cong: "!!x x'. x \ x' ==> g x = g x'" - assume "!!X. f X == g (pick X)" - hence "f \a\ = g (pick \a\)" by (simp only:) - also have "\ = g a" - proof (rule cong) - show "pick \a\ \ a" .. + assume cong: "!!x x'. x \ x' ==> g x \ g x'" + assume "!!X. f X == \g (pick X)\" + hence "f \a\ = \g (pick \a\)\" by (simp only:) + also have "\ = \g a\" + proof + show "g (pick \a\) \ g a" + proof (rule cong) + show "pick \a\ \ a" .. + qed qed finally show ?thesis . qed -theorem cong_definition2: - "(!!X Y. f X Y == g (pick X) (pick Y)) ==> - (!!x x' y y'. x \ x' ==> y \ y' ==> g x y = g x' y') ==> - f \a\ \b\ = g a b" +theorem quot_definition2: + "(!!X Y. f X Y == \g (pick X) (pick Y)\) ==> + (!!x x' y y'. x \ x' ==> y \ y' ==> g x y \ g x' y') ==> + f \a\ \b\ = \g a b\" proof - - assume cong: "!!x x' y y'. x \ x' ==> y \ y' ==> g x y = g x' y'" - assume "!!X Y. f X Y == g (pick X) (pick Y)" - hence "f \a\ \b\ = g (pick \a\) (pick \b\)" by (simp only:) - also have "\ = g a b" - proof (rule cong) - show "pick \a\ \ a" .. - show "pick \b\ \ b" .. + assume cong: "!!x x' y y'. x \ x' ==> y \ y' ==> g x y \ g x' y'" + assume "!!X Y. f X Y == \g (pick X) (pick Y)\" + hence "f \a\ \b\ = \g (pick \a\) (pick \b\)\" by (simp only:) + also have "\ = \g a b\" + proof + show "g (pick \a\) (pick \b\) \ g a b" + proof (rule cong) + show "pick \a\ \ a" .. + show "pick \b\ \ b" .. + qed qed finally show ?thesis . qed + +text {* + \medskip HOL's collection of overloaded standard operations is lifted + to quotient types in the canonical manner. +*} + +instance quot :: (zero) zero .. +instance quot :: (plus) plus .. +instance quot :: (minus) minus .. +instance quot :: (times) times .. +instance quot :: (inverse) inverse .. +instance quot :: (power) power .. +instance quot :: (number) number .. + +defs (overloaded) + zero_quot_def: "0 == \0\" + add_quot_def: "X + Y == \pick X + pick Y\" + diff_quot_def: "X - Y == \pick X - pick Y\" + minus_quot_def: "- X == \- pick X\" + abs_quot_def: "abs X == \abs (pick X)\" + mult_quot_def: "X * Y == \pick X * pick Y\" + inverse_quot_def: "inverse X == \inverse (pick X)\" + divide_quot_def: "X / Y == \pick X / pick Y\" + power_quot_def: "X^n == \(pick X)^n\" + number_of_quot_def: "number_of b == \number_of b\" + end