use*_*850 -1 haskell proof induction
我需要证明
f (g xs) == g (f xs)
Run Code Online (Sandbox Code Playgroud)
当 xs 是 Int 的有限列表时。
假设 f 和 g 都是 [Int]->[Int] 类型
反例反证:
f xs = []
g xs = [1]
Run Code Online (Sandbox Code Playgroud)
如果您希望保留此属性,则需要对什么f和g是什么进行更具体的约束。
你可能会想到法律
(map f . map g) == map (f . g)
Run Code Online (Sandbox Code Playgroud)
这确实可以证明。