No, Dumbledore did not know the Horcrux they retrieved from the cave was fake before they recovered it.
The Discovery of the Fake Locket
According to the information available, Harry Potter and Dumbledore undertook a dangerous mission to recover what they believed to be one of Lord Voldemort's Horcruxes – Salazar Slytherin's locket – from a seaside cave. This quest came at a great cost, significantly weakening Dumbledore just hours before his death.
However, the retrieved locket was not the genuine Horcrux. As the reference states, they discovered only after recovering the locket from the cave that it was a fake. A note found inside revealed that R.A.B., later identified as Regulus Arcturus Black, along with his House-elf Kreacher, had located the real locket, removed it, and substituted a family heirloom in its place.
The Timeline of Events
Here's a breakdown of the key events related to the locket's discovery:
- Dumbledore and Harry journey to the cave, believing the genuine Horcrux is inside.
- They overcome significant obstacles to retrieve the locket.
- Dumbledore is gravely weakened by the ordeal in the cave.
- They return with the locket.
- After retrieving the locket, they discover that it is a fake.
This sequence confirms that Dumbledore was unaware of the locket's true nature during the perilous mission to retrieve it.
In summary, Dumbledore did not possess prior knowledge that the locket in the cave was a fake. He and Harry discovered this crucial fact only after they had successfully retrieved the substitute locket at considerable personal sacrifice.