Builds a proof of String.ofList l₁ ≠ String.ofList l₂ for two distinct string literals.
The proof avoids both String.decEq (expensive UTF-8 byte array comparison) and full
List Char comparison. It reduces to List Char via String.ofList_injective, then
proves the lists differ using one of two strategies depending on whether the strings
share a common prefix of the shorter string's full length:
Different characters at position
i: UsescongrArg (fun l => (List.get!Internal l i).toNat)to project down toNat, thenNat.ne_of_beq_eq_false rflfor a singleNat.beqcomparison. This avoidsDecidableinstances entirely — the kernel only evaluatesNat.beqon two concrete natural numbers.One string is a prefix of the other: Uses
congrArg (List.drop n ·)wherenis the shorter string's length, thenList.cons_ne_nilto prove the non-empty tail differs from[]. This avoidsdecideentirely sincecons_ne_nilis a definitional proof.
Equations
- One or more equations did not get rendered due to their size.