NatOrder.split_at_element: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/proofs/nat_order.bend as NatOrder Lines 71-80 of stelliferous@0.0.2.0/proofs/nat_order.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/proofs/nat_order.bend&start_line=71&end_line=80 import Base import stelliferous@0.0.2.0/proofs/word_encoding.bend as WordEncoding def split_at_element(+total: Nat,+index: Nat,inside: {Nat.is_lt(index,total) == True{} : Bool}) -> {Nat.add(index,1n+Nat.sub(total,1n+index)) == total : Nat}: match total index: case 0n 0n: Empty.absurd({1n == 0n : Nat},WordEncoding.false_true(inside)) case 1n+ +rest 0n: Equal.cong(Nat,Nat,n => 1n+n,Nat.sub(rest,0n),rest,subtract_zero(rest)) case 0n 1n+ +index: Empty.absurd({Nat.add(1n+index,1n) == 0n : Nat},WordEncoding.false_true(inside)) case 1n+ +rest 1n+ +index: Equal.cong(Nat,Nat,n => 1n+n,Nat.add(index,1n+Nat.sub(rest,1n+index)),rest,split_at_element(rest,index,inside)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Empty.absurd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/nat_order.bend&name=subtract_zero https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/proofs/word_encoding.bend&name=false_true