# HG changeset patch # User Cezary Kaliszyk # Date 1275725022 -7200 # Node ID 6aaec9dd0c6230aa7e9337e7e004c72cd686324a # Parent 5952b0f28261a3d03ccbf603b064737d6c610545 qpaper / example interaction diff -r 5952b0f28261 -r 6aaec9dd0c62 Quotient-Paper/Paper.thy --- a/Quotient-Paper/Paper.thy Sat Jun 05 08:02:39 2010 +0200 +++ b/Quotient-Paper/Paper.thy Sat Jun 05 10:03:42 2010 +0200 @@ -521,7 +521,49 @@ section {* Examples *} +(* Mention why equivalence *) +text {* + + A user of our quotient package first needs to define an equivalence relation: + + @{text "fun \ where (x, y) \ (u, v) = (x + v = u + y)"} + + Then the user defines a quotient type: + + @{text "quotient_type int = (nat \ nat) / \"} + + Which leaves a proof obligation that the relation is an equivalence relation, + that can be solved with the automatic tactic with two definitions. + + The user can then specify the constants on the quotient type: + + @{text "quotient_definition 0 \ int is (0\nat, 0\nat)"} + @{text "fun plus_raw where plus_raw (x, y) (u, v) = (x + u, y + v)"} + @{text "quotient_definition (op +) \ (int \ int \ int) is plus_raw"} + + Lets first take a simple theorem about addition on the raw level: + + @{text "lemma plus_zero_raw: plus_raw (0, 0) i \ i"} + + When the user tries to lift a theorem about integer addition, the respectfulness + proof obligation is left, so let us prove it first: + + @{text "lemma (op \ \ op \ \ op \) plus_raw plus_raw"} + + Can be proved automatically by the system just by unfolding the definition + of @{term "op \"}. + + Now the user can either prove a lifted lemma explicitely: + + @{text "lemma 0 + i = i by lifting plus_zero_raw"} + + Or in this simple case use the automated translation mechanism: + + @{text "thm plus_zero_raw[quot_lifted]"} + + obtaining the same result. +*} section {* Related Work *} @@ -549,6 +591,8 @@ \end{itemize} *} +section {* Conclusion *} + (*<*) end (*>*)