OP's argument is that this distributed consensus algorithm works only if there is already consensus about which algorithm to use in the first place! If you and I disagree about which block history is valid (for example, because my history includes blocks with a lower difficulty), then the assumptions are no longer valid and there's a hard fork. Also, note that a 51% attack can only exclude transactions or allow double spending - the ledger still can't be arbitrarily manipulated since transactions are signed by private keys.