Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
69 views

Regarding the array reversal problem, I guess loop invariants are logically correct, based on the symmetry of the elements in the array and their relationship after reversal. However, I don’t ...
Morgan's user avatar
  • 13
3 votes
1 answer
93 views

I am currently writing common theorems of intuitionistic logic in Haskell using the Curry-Howard isomorphism: import Data.Void type a :> b = a -> b -- implies type a :+ b = Either a b -- or data ...
Zayd Mohammed's user avatar
1 vote
2 answers
60 views

I'm having trouble proving this within a while loop in Dafny: assert multiset(seqa) == multiset(seqa[..i] + seqa[i..]); Note: An invariant exists ensuring that 0 <= i <= |seqa|. There are no ...
Marko K's user avatar
  • 11
0 votes
1 answer
116 views

I am having trouble with a piece of Rocq code that I think has to do with providing a proof argument to a function, but I am not sure. Here's the relevant code. The code below typechecks: Require ...
Anirudh's user avatar
  • 361
0 votes
0 answers
37 views

I have been trying to understand the Raft protocol for quite some time now. One thing that has always stumped me is the proof of the Log Matching property. One of my concerns is that the proof in the ...
arl's user avatar
  • 118
2 votes
2 answers
89 views

The problem involves proving, using mathematical induction, the correctness of the recursive function presenza_strg (comments are in italian sorry for that) /*Controlla in maniera ricorsiva se s1 è ...
Nicola Pirozzi's user avatar
0 votes
0 answers
50 views

I'm currently studying concepts related to linearizability and I struggle with going from the linearization points of an implementation to the actual proof of linearizability. As far as I have ...
Malaski's user avatar
1 vote
1 answer
164 views

I am trying to use Lean 4 to reduce the halting problem to hyperbolic geometry to prove the undecidability of hyperbolic geometry, having problems with the diagonalization of the Turing machines, also ...
João Teixeira's user avatar
0 votes
2 answers
81 views

I've implemented a proof system from a paper in Coq, as shown below. Term proof System Require Import Ensembles. Definition Var := nat. Definition Name := nat. Inductive Term: Type := | VarTerm (v: ...
satiscugcat's user avatar
1 vote
0 answers
99 views

Trigger I am writing an exercise in Functional Programming in Lean. The example shows a way to generate an instance for GetElem' (NonEmptyList α) Nat α .. with a bound. I explain it as to implement ...
Chuannan Zhang's user avatar
6 votes
2 answers
148 views

The following problem and partial solution are from Richard Bird's Thinking Functionally with Haskell (pp 132-133, 139) given foldl f e (x:xs) = foldl f (f e x) xs foldl f e [] = e Prove foldl (@) e ...
planarian's user avatar
  • 2,183
0 votes
0 answers
103 views

Doing the leetcode problem https://leetcode.com/problems/longest-substring-without-repeating-characters/ I found this solution: def lengthOfLongestSubstring(self, s: str) -> int: left = 0 ...
Javier Lázaro's user avatar
1 vote
0 answers
52 views

Given a Voronoi diagram in three dimensions, what is the expected number of full neighbors E(C) of a Voronoi cell? Two adjacent cells are considered full (or Gabriel) neighbours in R^3 if the line ...
student.a's user avatar
0 votes
3 answers
181 views

I got a bit confused about analzsis of data structure basic operation like inserting or deleting. when I am asked about creating an data structure that support deleting operation, or inserting in O(1),...
miiky123's user avatar
  • 119
0 votes
1 answer
95 views

I want to prove that the following code returns a given amount (money) in 5 and 3 bills/coins: function sum(ns: seq<nat>): nat { if |ns| == 0 then 0 else ns[0] + sum(ns[1..]) } ...
Pablo Fernandez's user avatar
2 votes
1 answer
95 views

I am a new Frama-C User and I am trying to prove certain properties for a large project. I was seeing a particular proof fail, and tried reducing the problem to a minimum reproducible example, and the ...
LakshyAAAgrawal's user avatar
0 votes
1 answer
114 views

A minimal example of my issue looks as follows: Goal let x := True in x. This is immediately solved by simpl. auto., but auto. does not work. In my actual case, the search tree is a bit bigger than ...
radrow's user avatar
  • 7,413
1 vote
1 answer
60 views

I am new to Idris2 and need some guidance on proving the following relationship: simplify_max : (LTE x y) -> (max x y) = y simplify_max prf = ?code I read in the docs that the constructors for LTE ...
Hermes's user avatar
  • 21
0 votes
1 answer
318 views

Sorry, I'm not sure if the title is the adequate question. I have been going through Logical Foundations. In the Lemma "double_plus" i solved it with this solution: Lemma double_plus : ...
udduu's user avatar
  • 131
1 vote
1 answer
79 views

I am triying to make a simple reduction to absurd proof with Dafny, normally when I do so (in real life mathematics) I use arguments like "ok, now lets choose a p that fullfills this property ...
Pablo Martín Viñuelas's user avatar
0 votes
1 answer
109 views

I understand how ccontr works, however I am unsure how (or even if it is possible) to use it on a lemma declared with assumption(s). Take this simple example, all is good: lemma l1: "A⊆B ⟶ A ∩ B =...
Alicia M.'s user avatar
1 vote
0 answers
48 views

I would want to formalise a calculus in Isabelle. I started with this definitions: type_synonym Signature = "string ⇀ nat" type_synonym 'a Interpretation = "string ⇀ 'a list set" ...
Montserrat Hermo's user avatar
0 votes
2 answers
612 views

I am a green hand in studying Coq with the reference book softwarefoundation-induction In the last part of this phrase, there is an exercise about proving that change a binary to a nature number and ...
luxuriant_lettuce's user avatar
-2 votes
3 answers
93 views

Would "there exists a pair x,y in the subarray arr[left:right+1] that sums up to k." be a good loop variant for the code below which determines given a sorted array of integers if there is a ...
Cool Kid's user avatar
-1 votes
2 answers
113 views

I tried to use sledgehammer in proof and got such output Sledgehammering... vampire found a proof... Derived "False" from these facts alone: SymbolicE, const_bool_simp, ptype_bool_not, ...
bearhug15's user avatar
0 votes
1 answer
58 views

I have created a recursive Datatype „Positive“ in Agda. Im using this datatype to Index some Tree. On those trees I am trying to proof that a set operation on some Index q doesnt affect a get ...
Max Podpera's user avatar
0 votes
1 answer
128 views

I'm learning about AVL trees and their rotations in data structures. I wish my lectures had showcased the simplest complete right rotation because I found the topic became way easier for me when I ...
guardianfecal's user avatar
0 votes
1 answer
142 views

I have created a Tree datatype. And a get function that should retrieve a value from it. I now want to create a Proof that retrieving any Value from an Empty Tree will return "nothing". (I ...
Max Podpera's user avatar
-1 votes
1 answer
557 views

my example: seems to throw an error. am i doing something wrong? is my syntax the error? if so, how do i fix it? or how do i change me logic if i'm making a logical error? /- ## Problem 2 -/ /- 1. ...
pop123_123's user avatar
0 votes
0 answers
58 views

Consider a variant of Josephus Problem. Instead of finding the initial position p_survive of the survivor, I want vary the skip interval k and determine if the following is true: For all positions p ...
twc00's user avatar
  • 23
-2 votes
1 answer
75 views

I got this challenge: Given 𝐿 = { 𝑤 ∊ {0, 1}* : 01 is a substring of 𝑤 } Show 𝐿 compliment is regular. My understanding is that a DFA for the compliment of this language would need to reject 01 ...
sukhi's user avatar
  • 9
1 vote
0 answers
69 views

I want to prove that some value that is stored in smart contract on Near is takes part of calcualtion in whole blockchain state root. I have found the view-state function that odes the job of the ...
Dmytro Shashkevych's user avatar
2 votes
1 answer
834 views

The problem is as follows: Problem: "Your car starts at position 0 and speed +1 on an infinite number line. Your car can go into negative positions. Your car drives automatically according to a ...
punypaw's user avatar
  • 135
1 vote
1 answer
98 views

I have the following assertion: ∀x(E(x) ↔ ¬F (x)), ∀x(E(x) → G(x)) |= ∃x(F (x) ∧ ¬G(x)) Using the semantic tableaux method, I was able to get a counterexample in the form of G(a)=true, E(a)=true and ...
user avatar
0 votes
1 answer
61 views

In Coq, I have an inductive property on elements which may appear many times in the same proof. I would like to know if it is possible for Coq to memorize elements for which the property has already ...
Henri_S's user avatar
  • 57
0 votes
0 answers
85 views

Is there any simple way to prove the Taylor's Expansion Formula of inverse functions ? How Lagrange Inversion Formula can be proven ? Is there any easy way to make it ? thank you Since if f(a) = b ...
quantum77's user avatar
1 vote
1 answer
80 views

Is it possible to prove forall n, n + S n = S (n + n) (with or without induction) without using forall n m, n + S m = S (n + m)? Looking at the proof, if I start by using induction on n, we end up in ...
Yousef Alhessi's user avatar
0 votes
0 answers
46 views

I was working on a problem, where I was proving that for someone taking random-sized steps in 2-D, the relation between the total distance covered and the square root of the number of steps is linear. ...
Belal Bahaa's user avatar
0 votes
1 answer
39 views

I am trying to verify the following solution to this problem. https://leetcode.com/problems/diameter-of-binary-tree/description/ function diameter(node: TreeNode | null): [number, number] { if(node =...
Hath995's user avatar
  • 1,308
0 votes
0 answers
49 views

Gödel’s proof considers an arbitrary system K containing natural number. The proof defines a relation Q(x,y) then considers ∀x(Q(x,p)) where p is a particular natural number. The proof shows that the ...
user49413's user avatar
6 votes
2 answers
263 views

Suppose a scenario where you have an application config, the structure of which has changed a few times. To provide ease of use for users, you wish to allow automatic migration from each version to ...
notquiteamonad's user avatar
-2 votes
1 answer
156 views

When using skolemization to replace existentially quantified variables in an expression, any existential bound at the top level can be replaced by a new globally unique constant, however if the ...
Jean-Baptiste's user avatar
0 votes
0 answers
323 views

I am currently learning Loop Invariants and is wondering whether I have generated them correctly here. The algorithm pseudocode is: **EvenSumming(A)** outcome=0 for i=1 to n if A[i] is even outcome=...
darklight213's user avatar
-1 votes
1 answer
335 views

I get as far as this theorem problem_2 : (p → ¬ q) → ¬ (p ∧ q) := by intro hp intro hpw which gets me to ⊢ False
helpoatmeal's user avatar
0 votes
2 answers
691 views

Intuitively stating that xs is equal to ys is the same as saying that the respective reverse lists are equal to each other. I'm currently learning Lean 4 and so I set myself the following exercise. I ...
user11718766's user avatar
4 votes
2 answers
500 views

I'm learning prolog, and I'm confused by the claim that prolog uses proof by contradiction: The resolution proof process makes use of a technique that is known as reduction to the absurd: suppose ...
Joseph Garvin's user avatar
0 votes
1 answer
90 views

apowAddition verifies when I comment out containsInverses(g) in my definition of a valid group theory algebra, but when I uncomment it fails to verify, death by timeout. I can guess that Dafny is ...
Hath995's user avatar
  • 1,308
1 vote
3 answers
115 views

I want to write a proof about my function export foo : Nat -> Nat but since it's only export not public export, how can I do that? Afaik public makes the implementation public.
joel's user avatar
  • 8,122
0 votes
2 answers
738 views

I am a beginner in lean prover and I have struggled a bit with the following example: I need to proof the following ∃ x, f x Where f is a function defined earlier in the lean file. This seems simple ...
trusis's user avatar
  • 75
0 votes
1 answer
88 views

When I write: div_1_2_lower_than_1 : div (S Z) 2 < (S Z) = True div_1_2_lower_than_1 = Refl I get error: While processing right hand side of div_1_2_lower_than_1. Can't solve constraint between: ...
N0lim's user avatar
  • 65

1
2 3 4 5
18