# Ssreflect re write as a logarithmic equation

Two things that come in handy here, in particular, are the theories of permutations and sets over finite types that are available in MathComp. Basics The informal proof of this result is fairly simple: If a comparison sort is correct, then it must be capable of shuffling an input vector of size n according to any of the n!

The permutation in Done specifies how to rearrange the elements of the input array to produce an answer. Hence, n! Both libraries cover a wide range of theories, including fairly sophisticated Mathematics - as a matter of fact, they are featured in the Coq formalization of the Feit-Thompson theoremknown for its extremely complex and detailed proof. For our purposes, a comparison sort can be seen as a binary tree: internal nodes indicate when a comparison between two elements occurs, with the right and left branches telling how to proceed depending on its result. As we will see, having good library support can help a lot when doing mechanized proofs, even for such simple results as this one. Lemma finvK : cancel finv f. Bounding the number of permutations performed by an algorithm is simple, and amounts to invoking basic lemmas about arithmetic and sets.

### Rewriting exponential equations in logarithmic form worksheet

We can then proceed with a straightforward although not completlely trivial inductive argument. Basics The informal proof of this result is fairly simple: If a comparison sort is correct, then it must be capable of shuffling an input vector of size n according to any of the n! Require Import Ssreflect. Bounding the number of permutations performed by an algorithm is simple, and amounts to invoking basic lemmas about arithmetic and sets. Coq's rules forbid you from using proofs of propositions to build elements that have computational content such as natural numbers , except in very particular cases. By restricting the argument type, we can write an inverse function finv that takes an arbitrary nat and returns another number that is greater than 2. I've taken the liberty of doing the following script with the ssreflect library, which makes writing this kind of function easier: Require Import Ssreflect. Two things that come in handy here, in particular, are the theories of permutations and sets over finite types that are available in MathComp.

Doing the last step is a bit trickier, as we don't have a proof of Stirling's approximation we can use. The idea is that, when running our algorithm, the i and j arguments of Compare tell which elements of our array to compare.

Finally, to translate the above informal argument, we will need some more definitions.

### Rewrite the logarithmic equation in exponential form

The permutation in Done specifies how to rearrange the elements of the input array to produce an answer. Basics The informal proof of this result is fairly simple: If a comparison sort is correct, then it must be capable of shuffling an input vector of size n according to any of the n! Both libraries cover a wide range of theories, including fairly sophisticated Mathematics - as a matter of fact, they are featured in the Coq formalization of the Feit-Thompson theorem , known for its extremely complex and detailed proof. The leaves of the tree mark when the algorithm ends and yields back a result. As we will see, having good library support can help a lot when doing mechanized proofs, even for such simple results as this one. Finally, to translate the above informal argument, we will need some more definitions. Let's analyze this declaration in detail. The idea is that, when running our algorithm, the i and j arguments of Compare tell which elements of our array to compare. Bounding the number of permutations performed by an algorithm is simple, and amounts to invoking basic lemmas about arithmetic and sets. That is, different permutations produce different arrays. By restricting the argument type, we can write an inverse function finv that takes an arbitrary nat and returns another number that is greater than 2. You may then wonder "but wait a second, the natural numbers aren't closed under subtraction, so how can this make sense? Doing the last step is a bit trickier, as we don't have a proof of Stirling's approximation we can use.

By restricting the argument type, we can write an inverse function finv that takes an arbitrary nat and returns another number that is greater than 2.

What this means in practice is that you are always allowed to "subtract" two natural numbers and get a natural number back, but in order for this subtraction make sense, the first argument needs to be greater than the second.

Before starting, I should point out that this is the first post in this blog to use the Ssreflect and the Mathematical Components MathComp libraries.

Rated 9/10 based on 29 review