I'm using AGDA to do some classical mathematical proofs. I'd like to prove that the number of subsets of a set of cardinality n is equal to 2^n (i.e pow (2, n)). To do so, my strategy would be the following :
1) Write a function sub n, that, given each natural, it returns a list of all the possible subsets of naturals less or equal to n.
2) Write two functions "length " and "pow ", that separately compute the length of the list and 2^n
3) Put the 3 functions together to prove the statement.
However, I'm having troubles to solve point 1 ). My idea is to make the function return a list of type "list Nat", but I am having some problem to implement the recursion. Basically my idea for the inductive step is to associate to each subset of "n" two new subsets : itself and the subset obtained adding "n+1".
Do you think it is an effective strategy? And moreover, how can I solve my troubles with point 1? Thanks