Fair point, and thank you for the example! But I'm not only trying to guarantee types in one program. I'm trying to reason about a whole system with many actors and operations: a registry, a DNS root, chains of certificates (issued by the org's root or by another person, never by an agent, and not revoked), revocation, key replacement, delegation. The full catastrophe.
The Lean theorem is that in the model, no sequence of operations, by anyone, ever yields a chain from an agent to a valid person. That's an induction over every possible history, which a type checker doesn't do.
It's been invaluable for us. It lets us think in a structured way and explore scenarios without writing all the code. It found design flaws before any code existed, and it lets us prove that things must be possible, not only forbidden.
I believe this kind of approach is going to be critical in security thinking (I think AWS's Cedar is doing more or less the same).
I was going to add a comment about this possibility, but I didn't want to get carried away without knowing more.
If you control the code for the systems you're talking about, then you can still use approaches like this if the communication between them involves cryptographically signed claims. So service 1 sends a request to service 2, with a signed claim that e.g. identifies the user as a human or agent, or whatever property you want to communicate - cert issued by an org's root, or whatever else has been validated by the source system. On the receiving end, you convert those claims back into their typed representations. This effectively allows static typing guarantees to be reliably extended across distinct services.
But, it sounds like you might be describing something that this might not satisfy. In that case, I'd be interested to understand the details better - it seems to me that anything Lean can prove about a system ought to be encodable using techniques like these.
> It lets us think in a structured way and explore scenarios without writing all the code. It found design flaws before any code existed, and it lets us prove that things must be possible, not only forbidden.
Prototyping with code like the example I linked can provide these benefits as well, with much less effort imo. But, I may be missing something.
The Lean theorem is that in the model, no sequence of operations, by anyone, ever yields a chain from an agent to a valid person. That's an induction over every possible history, which a type checker doesn't do.
It's been invaluable for us. It lets us think in a structured way and explore scenarios without writing all the code. It found design flaws before any code existed, and it lets us prove that things must be possible, not only forbidden.
I believe this kind of approach is going to be critical in security thinking (I think AWS's Cedar is doing more or less the same).
Replies (1)
If you control the code for the systems you're talking about, then you can still use approaches like this if the communication between them involves cryptographically signed claims. So service 1 sends a request to service 2, with a signed claim that e.g. identifies the user as a human or agent, or whatever property you want to communicate - cert issued by an org's root, or whatever else has been validated by the source system. On the receiving end, you convert those claims back into their typed representations. This effectively allows static typing guarantees to be reliably extended across distinct services.
But, it sounds like you might be describing something that this might not satisfy. In that case, I'd be interested to understand the details better - it seems to me that anything Lean can prove about a system ought to be encodable using techniques like these.
> It lets us think in a structured way and explore scenarios without writing all the code. It found design flaws before any code existed, and it lets us prove that things must be possible, not only forbidden.
Prototyping with code like the example I linked can provide these benefits as well, with much less effort imo. But, I may be missing something.