Problem: linear_search

Your task is to implement the Linear Search algorithm (specifically the lower_bound variant) and verify its correctness in Dafny. You are given a sorted sequence of integers and a target value. The algorithm finds the first index $k$ such that $s[k] \ge target$ in $O(N)$ time logic. In the incomplete code, the specification is_sorted is provided. You must implement the standard linear search loop and prove that the returned index is the correct boundary. This requires a two-sided invariant: (1) Left Side: All elements to the left of the current window (0..low) are strictly less than the target. (2) Right Side: All elements to the right of the current window (high..|s|) are greater than or equal to the target.

// Following is the block for necessary definitions
// <preamble>
predicate is_sorted(s: seq<int>) {
    forall i, j {:trigger s[i], s[j]} :: 
        0 <= i <= j < |s| ==> s[i] <= s[j]
}
// </preamble>

// Following is the block for potential helper specifications
// <helpers>

// </helpers>

// Following is the block for proofs of lemmas
// <proofs>

// </proofs>

// Following is the block for the main specification
// <spec>
method linear_search_lower_bound(s: seq<int>, target: int) returns (result: int)
    requires |s| <= 0x7FFFFFFF
    requires is_sorted(s)
    ensures result >= 0
    ensures result <= |s|
    ensures forall i {:trigger s[i]} :: 0 <= i < result ==> s[i] < target
    ensures forall i {:trigger s[i]} :: result <= i < |s| ==> s[i] >= target
// </spec>
// <code>
{
    // Implement and verify the linear search for lower bound here.
}
// </code>

method main() {}