theorem-proving

Z3: Performing Matrix Operations

 ̄綄美尐妖づ 提交于 2019-12-10 14:36:23
问题 My Situation I'm working on a project which needs to: Prove the correctness of 3D matrix transformation formulas involving matrix operations Find a model with the values of the unknown matrix entries. My Question What's the best way to express formulas using matrix operations so that they can be solved by z3 ? (The way used in Z3Py's Sudoku Example isn't very elegant and doesn't seem suitable for more complex matrix operations.) Thanks. - If anything's unclear, please leave a question comment

Proving that a reversible list is a palindrome in Coq

断了今生、忘了曾经 提交于 2019-12-10 12:55:04
问题 Here is my inductive definition of palindromes: Inductive pal { X : Type } : list X -> Prop := | pal0 : pal [] | pal1 : forall ( x : X ), pal [x] | pal2 : forall ( x : X ) ( l : list X ), pal l -> pal ( x :: l ++ [x] ). And the theorem I want to prove, from Software Foundations : Theorem rev_eq_pal : forall ( X : Type ) ( l : list X ), l = rev l -> pal l. My informal outlines of the proof are as follows: Suppose l0 is an arbitrary list such that l0 = rev l0 . Then one of the following three

Avoiding quantifiers in Z3

不羁岁月 提交于 2019-12-10 03:24:21
问题 I am experimenting with Z3 where I combine the theories of arithmetic, quantifiers and equality. This does not seem to be very efficient, in fact it seems to be more efficient to replace the quantifiers with all instantiated ground instances when possible. Consider the following example, in which I have encoded the unique names axiom for a function f that takes two arguments of sort Obj and returns an interpreted sort S . This axiom states that each unique list of arguments to f returns a

Isabelle matrix arithmetic: det_linear_row_setsum in library with different notation

拥有回忆 提交于 2019-12-08 21:46:30
I recently started using the Isabelle theorem prover. As I want to prove another lemma, I would like to use a different notation than the one used in the lemma "det_linear_row_setsum", which can be found in the HOL library. More specifically, I would like to use the "χ i j notation" instead of "χ i". I have been trying to formulate an equivalent expression for some time, but couldn't figure it out yet. (* ORIGINAL lemma from library *) (* from HOL/Multivariate_Analysis/Determinants.thy *) lemma det_linear_row_setsum: assumes fS: "finite S" shows "det ((χ i. if i = k then setsum (a i) S else c

Isabelle: transpose a matrix that includes a constant factor

元气小坏坏 提交于 2019-12-08 10:04:34
问题 In my Isabelle theory I have a matrix with a constant factor: ... k :: 'n and c :: 'a (χ i j. if j = k then c * (A $ i $ j) else A $ i $ j) I can calculate the transposed matrix: (transpose (χ i j. if j = k then c * (A $ i $ j) else A $ i $ j)) In my eyes the latter should be equivalent to (χ i j. if i = k then c * (A $ j $ i) else A $ j $ i)) by the definition of transpose . But this is not true. What is my error here? By the way, the definition of transposed is: definition transpose where "

Isabelle: getting three different results with sledgehammer for what seems to be identical lemmas

家住魔仙堡 提交于 2019-12-08 06:40:29
问题 You need this to have my imports: (* tested with Isabelle2013-2 *) theory Notepad imports Main "~~/src/HOL/Library/Polynomial" begin notepad begin I have three almost identical lemmas. Version1: { fix a :: "('a:: comm_ring_1) poly" have "degree((monom 1 1) -CONST pCons a 0) =1" sledgehammer Version2: { fix a :: "('a:: comm_ring_1) poly" def p ≡ "(monom 1 1) - CONST pCons a 0" from p_def have "degree p = 1" Version3: { fix a :: "('a:: comm_ring_1) poly" have "p ≡ (monom 1 1) - CONST pCons a 0

Use prolog to show cause of boolean logic failure

旧时模样 提交于 2019-12-08 03:31:08
问题 Suppose i have the following boolean logic: Z = (A or B) and (A or C) Is it possible to use prolog possibly (maybe together with some library) to figure out why Z is false and to return the answer in the following formats: Z is false because A or (b and c) are false If i substitute some known values (or all) like (c = true) that it will say: Z is false because A is false It can tell me which rule or which part of the rule causes this problem: Z is false because A is false in (A or B) of "Z =

Isabelle - exI and refl behavior explanation needed

血红的双手。 提交于 2019-12-08 00:27:30
问题 I am trying to understand the lemma below. Why is the ?y2 schematic variable introduced in exI ? And why it is not considered in refl (so: x = x )? lemma "∀x. ∃y. x = y" apply(rule allI) (* ⋀x. ∃y. x = y *) thm exI (* ?P ?x ⟹ ∃x. ?P x *) apply(rule exI) (* ⋀x. x = ?y2 x *) thm refl (* ?t = ?t *) apply(rule refl) done UPDATE (because I can't format code in comments): This is the same lemma with a different proof, using simp . lemma "∀x. ∃y. x = y" using [[simp_trace, simp_trace_depth_limit =

What is a Quotient type pattern in Isabelle?

和自甴很熟 提交于 2019-12-07 16:36:12
问题 What is a "Quotient type pattern" in Isabelle? I couldn't find any explanation over the internet. 回答1: It would be better if you would quote a little from where you saw the phrase. I know of "pattern matching," and I know of "quotient type," but I don't know of "quotient type pattern." I prefer not to ask for clarification, and then wait, so I pick two of the three words, "quotient type." If I'm on the wrong track, it's still a worthy subject, and a big and important part of Isabelle/HOL.

Isabelle: getting three different results with sledgehammer for what seems to be identical lemmas

泪湿孤枕 提交于 2019-12-07 03:04:28
You need this to have my imports: (* tested with Isabelle2013-2 *) theory Notepad imports Main "~~/src/HOL/Library/Polynomial" begin notepad begin I have three almost identical lemmas. Version1: { fix a :: "('a:: comm_ring_1) poly" have "degree((monom 1 1) -CONST pCons a 0) =1" sledgehammer Version2: { fix a :: "('a:: comm_ring_1) poly" def p ≡ "(monom 1 1) - CONST pCons a 0" from p_def have "degree p = 1" Version3: { fix a :: "('a:: comm_ring_1) poly" have "p ≡ (monom 1 1) - CONST pCons a 0 ⟹ degree p = 1" Here is the result of running sledgehammer, showing only the e theorem-prover results;